Last Comment Bug 636942 - pass webgl-specific.html again: adapt to latest spec changes
: pass webgl-specific.html again: adapt to latest spec changes
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Benoit Jacob [:bjacob] (mostly away)
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-25 20:46 PST by Benoit Jacob [:bjacob] (mostly away)
Modified: 2011-06-11 00:37 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
part 1: stencil separate param validation must now occur on draw calls (9.71 KB, patch)
2011-02-25 20:46 PST, Benoit Jacob [:bjacob] (mostly away)
jmuizelaar: review+
Details | Diff | Splinter Review
part 2: remove _LENGTH constants (2.51 KB, patch)
2011-02-25 20:47 PST, Benoit Jacob [:bjacob] (mostly away)
jmuizelaar: review+
Details | Diff | Splinter Review
part 1 rebased (11.82 KB, patch)
2011-05-10 15:25 PDT, Benoit Jacob [:bjacob] (mostly away)
jacob.benoit.1: review+
Details | Diff | Splinter Review

Description Benoit Jacob [:bjacob] (mostly away) 2011-02-25 20:46:36 PST
Created attachment 515288 [details] [diff] [review]
part 1: stencil separate param validation must now occur on draw calls
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2011-02-25 20:47:17 PST
Created attachment 515289 [details] [diff] [review]
part 2: remove _LENGTH constants
Comment 2 Benoit Jacob [:bjacob] (mostly away) 2011-03-02 09:03:59 PST
(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.
Comment 3 Benoit Jacob [:bjacob] (mostly away) 2011-03-02 09:27:27 PST
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 4 Jeff Muizelaar [:jrmuizel] 2011-03-02 19:18:18 PST
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.
Comment 5 Benoit Jacob [:bjacob] (mostly away) 2011-03-03 05:24:53 PST
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 6 Jeff Muizelaar [:jrmuizel] 2011-03-03 08:44:30 PST
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.
Comment 7 Benoit Jacob [:bjacob] (mostly away) 2011-05-10 15:25:25 PDT
Created attachment 531475 [details] [diff] [review]
part 1 rebased

Note You need to log in before you can comment on or make changes to this bug.