pass webgl-specific.html again: adapt to latest spec changes

RESOLVED FIXED

Status

()

Core
Canvas: WebGL
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: bjacob, Assigned: bjacob)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Created attachment 515288 [details] [diff] [review]
part 1: stencil separate param validation must now occur on draw calls
Attachment #515288 - Flags: review?(vladimir)
(Assignee)

Comment 1

7 years ago
Created attachment 515289 [details] [diff] [review]
part 2: remove _LENGTH constants
Attachment #515289 - Flags: review?(vladimir)
(Assignee)

Updated

7 years ago
Attachment #515288 - Flags: review?(vladimir) → review?(jmuizelaar)
(Assignee)

Updated

7 years ago
Attachment #515289 - Flags: review?(vladimir) → review?(jmuizelaar)
(Assignee)

Comment 2

7 years ago
(In reply to comment #0)
> Created attachment 515288 [details] [diff] [review]
> part 1: stencil separate param validation must now occur on draw calls

Explanation: these OpenGL functions,

   StencilFuncSeparate
   StencilMaskSeparate

allow to specify separate values for the front and back faces. But in WebGL 1.0, that's not allowed. Until now, we were therefore checking for this in these functions and generating INVALID_OPERATION errors when trying to using separate values for front and back. But the updated spec and test now want this to only get checked in drawArray() and drawElements() calls. So this patch adds the required state so we remember these values and check them in these draw-functions.
(Assignee)

Comment 3

7 years ago
The risk is very low because this is well-tested and if something escaped the tests, it would be a fine detail of StencilFunc/StencilMask[Separate] which are not very much used anyway.
Comment on attachment 515288 [details] [diff] [review]
part 1: stencil separate param validation must now occur on draw calls

Wouldn't it be easier to just track whether the current stencil mask configuration is valid instead of tracking all of the stencil mask state? That would reduce keep the size of WebGLContext down and not introduce an additional slowdown into the draw functions.
Attachment #515289 - Flags: review?(jmuizelaar) → review+
(Assignee)

Comment 5

7 years ago
That would be more complex, because there is more than one function involved here. The validity of the state is not a function of the pair (previous validity, parameters passed to current function). For example, from an invalid state where everything is wrong, if you first call stencilFunc with good parameters, then the state is still invalid, but if you then call stencilMask with good parameters, the state becomes valid. Even withing the stencilMask state, from an invalid state, if you first call stencilMaskSeparate to set the FRONT value and then stencilMaskSeparate to set the BACK value, then if the two are equal you get a valid state.
Comment on attachment 515288 [details] [diff] [review]
part 1: stencil separate param validation must now occur on draw calls

I talked with Benoit in person and convinced him that caching the validity of the state would work. However, he convinced me that it's not worth it without measurement.
Attachment #515288 - Flags: review?(jmuizelaar) → review+
(Assignee)

Comment 7

6 years ago
Created attachment 531475 [details] [diff] [review]
part 1 rebased
Attachment #531475 - Flags: review+
(Assignee)

Comment 8

6 years ago
http://hg.mozilla.org/mozilla-central/rev/349c33c682a0
http://hg.mozilla.org/mozilla-central/rev/f5a4b8d232fa
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Assignee: nobody → bjacob
You need to log in before you can comment on or make changes to this bug.