Closed Bug 636942 Opened 13 years ago Closed 13 years ago

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

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bjacob, Assigned: bjacob)

Details

Attachments

(3 files)

Attachment #515289 - Flags: review?(vladimir)
Attachment #515288 - Flags: review?(vladimir) → review?(jmuizelaar)
Attachment #515289 - Flags: review?(vladimir) → review?(jmuizelaar)
(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.
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+
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+
Attached patch part 1 rebasedSplinter Review
Attachment #531475 - Flags: review+
Assignee: nobody → bjacob
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: