Bug 50716 - Update validation of stencil mask and ref values
Summary: Update validation of stencil mask and ref values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-08 14:05 PST by Kenneth Russell
Modified: 2011-01-04 12:44 PST (History)
6 users (show)

See Also:


Attachments
Patch (26.07 KB, patch)
2010-12-29 10:59 PST, Zhenyao Mo
kbr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2010-12-08 14:05:56 PST
Based on feedback from Daniel Koch from TransGaming, the section in the WebGL spec on restrictions on the stencil mask and ref values has been changed to do the validation at draw time rather than when stencilMaskSeparate and stencilFuncSeparate are called, since generating an INVALID_OPERATION error from those entry points may make it hard for applications to transition between states. The WebKit implementation needs to be updated to do the validation then as well. Ideally stencilMaskSeparate and stencilFuncSeparate would set a boolean flag which can be easily checked in drawArrays and drawElements.
Comment 1 Zhenyao Mo 2010-12-29 10:59:33 PST
Created attachment 77631 [details]
Patch
Comment 2 Kenneth Russell 2010-12-29 18:34:20 PST
Comment on attachment 77631 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=77631&action=review

Looks good; one cleanup upon landing please.

> WebCore/html/canvas/WebGLRenderingContext.cpp:1119
> +    if (m_stencilMask != m_stencilMaskBack || m_stencilFuncRef != m_stencilFuncRefBack || m_stencilFuncMask != m_stencilFuncMaskBack) {
> +        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
> +        return;
> +    }
> +

Could you please refactor these tests into a helper function similar to validateDrawMode?
Comment 3 Zhenyao Mo 2010-12-30 11:11:43 PST
(In reply to comment #2)
> (From update of attachment 77631 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=77631&action=review
> 
> Looks good; one cleanup upon landing please.
> 
> > WebCore/html/canvas/WebGLRenderingContext.cpp:1119
> > +    if (m_stencilMask != m_stencilMaskBack || m_stencilFuncRef != m_stencilFuncRefBack || m_stencilFuncMask != m_stencilFuncMaskBack) {
> > +        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
> > +        return;
> > +    }
> > +
> 
> Could you please refactor these tests into a helper function similar to validateDrawMode?

Will do.
Comment 4 Zhenyao Mo 2010-12-30 17:34:15 PST
Committed r74818: <http://trac.webkit.org/changeset/74818>
Comment 5 Zhenyao Mo 2010-12-30 17:36:00 PST
Again, webkit-patch land does not close the bug automatically and I had to manually add the committed message and close the bug.

This is the second time this happened.  Both time I called webkit-patch land remotely through PUTTY.
Comment 6 WebKit Review Bot 2010-12-30 18:18:19 PST
http://trac.webkit.org/changeset/74818 might have broken SnowLeopard Intel Release (Tests)
Comment 7 Zhenyao Mo 2010-12-30 18:48:39 PST
Committed r74820: <http://trac.webkit.org/changeset/74820>
Comment 8 Zhenyao Mo 2010-12-30 18:51:11 PST
(In reply to comment #7)
> Committed r74820: <http://trac.webkit.org/changeset/74820>

I had to commit test changes a second time.  I really don't understand what's happening here.  Seems like r74818 only picked up changes under WebCore but not under LayoutTests; however, it picked up both change logs.  Really strange.

Again, I did the two commits through PUTTY.
Comment 9 Kenneth Russell 2011-01-04 12:44:19 PST
(In reply to comment #8)
> (In reply to comment #7)
> > Committed r74820: <http://trac.webkit.org/changeset/74820>
> 
> I had to commit test changes a second time.  I really don't understand what's happening here.  Seems like r74818 only picked up changes under WebCore but not under LayoutTests; however, it picked up both change logs.  Really strange.
> 
> Again, I did the two commits through PUTTY.

I'm not sure this could be the issue, but I always run webkit-patch land while cd'd into the top-level WebKit directory, just like svn-create-patch.