Closed Bug 1239488 Opened 8 years ago Closed 8 years ago

Add int/uint to vertex attrib data type

Categories

(Core :: Graphics: CanvasWebGL, defect)

46 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: brad.kotsopoulos, Assigned: brad.kotsopoulos)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Steps to reproduce:

https://www.khronos.org/registry/webgl/sdk/tests/deqp/functional/gles3/instancedrendering.html?webglVersion=2&quiet=0

The last 8 test cases, for int/uint vectors.




Actual results:

In WebGLContext::ValidateBufferFetching we divide by the result of actualStride()

... = ((checked_byteLength - checked_sizeOfLastElement) / vd.actualStride()) + 1;

actualStride() calls componentSize() with type = LOCAL_GL_INT, which isn't handled in the enum, and returns 0.  We end up dividing by zero.

We get the following error message (as the divide by zero is caught by using checked ints):

FAIL instanced_rendering.types.int: GL error INVALID_OPERATION in drawArraysInstanced


Expected results:

We should return the size of int and uint.
Attached patch vertex_attrib_data_v1.pat (obsolete) — Splinter Review
Change to add int/uint support to switch statement.
Attachment #8707650 - Flags: review?(jmuizelaar)
Attachment #8707650 - Flags: review?(jgilbert)
Comment on attachment 8707650 [details] [diff] [review]
vertex_attrib_data_v1.pat

Review of attachment 8707650 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/canvas/WebGLVertexAttribData.h
@@ +62,5 @@
>          case LOCAL_GL_FLOAT:
>              return sizeof(GLfloat);
>  
>          default:
> +            MOZ_ASSERT(!"Should never get here!");

MOZ_ASSERT(false, "...
Attachment #8707650 - Flags: review?(jmuizelaar)
Attachment #8707650 - Flags: review?(jgilbert)
Attachment #8707650 - Flags: review+
Fixing assert.
Attachment #8707650 - Attachment is obsolete: true
Keywords: checkin-needed
Assignee: nobody → bkotsopoulos
https://hg.mozilla.org/mozilla-central/rev/b113b4874656
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.