Bug 48669

Summary: A different mask or reference value in stencil operations should generate INVALID_OPERATION
Product: WebKit Reporter: Zhenyao Mo <zmo>
Component: WebGLAssignee: Zhenyao Mo <zmo>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, enne, kbr
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch kbr: review+, zmo: commit-queue-

Description Zhenyao Mo 2010-10-29 14:05:21 PDT
WebGL Spec:

6.5 Stencil Separate Mask and Reference Value

In the WebGL API it is illegal to specify a different mask or reference value for front facing and back facing triangles in stencil operations. A call to stencilMaskSeparate will generate an INVALID_OPERATION error if FRONT mask is not equal to BACK mask. Similarly, a call to stencilFuncSeparate will generate an INVALID_OPERATION error if FRONT ref is not equal to BACK ref or FRONT mask is not equal to BACK mask.
Comment 1 Zhenyao Mo 2010-11-02 17:35:34 PDT
Created attachment 72775 [details]
patch
Comment 2 Kenneth Russell 2010-11-03 16:32:32 PDT
Comment on attachment 72775 [details]
patch

This bug strongly indicates that stencilFuncSeparate and stencilMaskSeparate are completely useless in the WebGL API. Before r+'ing this I want to raise this issue with the WebGL working group.
Comment 3 Zhenyao Mo 2010-11-03 16:36:54 PDT
(In reply to comment #2)
> (From update of attachment 72775 [details])
> This bug strongly indicates that stencilFuncSeparate and stencilMaskSeparate are completely useless in the WebGL API. Before r+'ing this I want to raise this issue with the WebGL working group.

For stencilMaskSeparate yes, for stencilFuncSeparate, you can still specify different funcs for front and back, although they have to have the same ref and mask values.
Comment 4 Kenneth Russell 2010-11-03 16:42:58 PDT
Comment on attachment 72775 [details]
patch

Thanks for pointing that out. Looks good in that case.
Comment 5 Zhenyao Mo 2010-11-03 16:53:39 PDT
Committed r71282: <http://trac.webkit.org/changeset/71282>