Bug 47111 - stencil support should be optional in tests context*.html
Summary: stencil support should be optional in tests context*.html
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Adrienne Walker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-04 14:01 PDT by Zhenyao Mo
Modified: 2010-11-09 20:24 PST (History)
4 users (show)

See Also:


Attachments
Patch (5.35 KB, patch)
2010-11-09 09:00 PST, Adrienne Walker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenyao Mo 2010-10-04 14:01:27 PDT
Currently if stencil buffer is not supported, these tests will fail.  They should pass instead.
Comment 1 Adrienne Walker 2010-10-04 14:05:24 PDT
Thanks for filing this so that we can track it.

kbr had mentioned to me that updating the spec regarding the stencil buffer had been discussed at the Khronos face-to-face.  I was going to wait until the spec had been updated to make the test match that.  If it's the case that the only addition is to make it acceptable for the stencil buffer to be provided even if it was not requested, then we could go ahead and update this test now.
Comment 2 Kenneth Russell 2010-10-04 18:09:36 PDT
The spec has finally been updated (apologies for this taking so long) so please feel free to go ahead with this work.
Comment 3 Adrienne Walker 2010-11-09 08:03:55 PST
Stencil support is now optional in context-attributes-alpha-etc.html.  I will go ahead and remove the now redundant context-attributes.html test.
Comment 4 Adrienne Walker 2010-11-09 09:00:26 PST
Created attachment 73382 [details]
Patch
Comment 5 Chris Marrin 2010-11-09 09:56:35 PST
Remind me about our policy regarding stencil. Support for it is required in OpenGL ES 2.0, isn't it?
Comment 6 Adrienne Walker 2010-11-09 10:09:53 PST
(In reply to comment #5)
> Remind me about our policy regarding stencil. Support for it is required in OpenGL ES 2.0, isn't it?

In the past, context-attributes.html used to test various permutations of default attributes and non-default attributes, verifying that the defaults and the requests were as expected in getContextAttributes.

As per section 2.1 of the WebGL spec, context creation attributes are now requests and not requirements.  There is no way to test (in a layout or conformance test) what the defaults are anymore.  So, context-attributes.html is now redundant when compared to context-attributes-alpha-depth-stencil.html and I'd like to remove it.

In a technical sense, support for stencil is not required by the spec as it stands.  In a practical sense, given the "the implementation should make a best effort" language, it should be supported everywhere.
Comment 7 Chris Marrin 2010-11-09 10:54:30 PST
(In reply to comment #6)
> (In reply to comment #5)
> > Remind me about our policy regarding stencil. Support for it is required in OpenGL ES 2.0, isn't it?
> 
> In the past, context-attributes.html used to test various permutations of default attributes and non-default attributes, verifying that the defaults and the requests were as expected in getContextAttributes.
> 
> As per section 2.1 of the WebGL spec, context creation attributes are now requests and not requirements.  There is no way to test (in a layout or conformance test) what the defaults are anymore.  So, context-attributes.html is now redundant when compared to context-attributes-alpha-depth-stencil.html and I'd like to remove it.
> 
> In a technical sense, support for stencil is not required by the spec as it stands.  In a practical sense, given the "the implementation should make a best effort" language, it should be supported everywhere.

I'm not sure if the spec says that stencil support is optional. Certainly there is language in the attributes section about the fact that the attributes are requests rather than requirements. But by that logic depth buffer support would also be optional. Is that true?

I was unable to find any requirements in the OpenGL or OpenGL ES 2.0 specs about minimum drawing buffer requirements.

Section 6.3 Framebuffer Object Attachments talks about combinations of stencil and depth buffers, but implies that some combination will always work. But that language could be made more clear as well.
Comment 8 Adrienne Walker 2010-11-09 11:09:07 PST
(In reply to comment #7)
> I'm not sure if the spec says that stencil support is optional. Certainly there is language in the attributes section about the fact that the attributes are requests rather than requirements. But by that logic depth buffer support would also be optional. Is that true?

"The passed attributes are requests, not requirements. The WebGL implementation does not guarantee that they will be obeyed, but should make a best effort to honor them."

By my reading of that language, depth support is optional if for some reason the implementation's "best effort" couldn't support it.  This seems unlikely to ever occur.

> Section 6.3 Framebuffer Object Attachments talks about combinations of stencil and depth buffers, but implies that some combination will always work. But that language could be made more clear as well.

I think this is already specified in section 2.1:

"Combinations of attributes not supported by the WebGL implementation or graphics hardware shall not cause a failure to create a WebGLRenderingContext."
Comment 9 Adrienne Walker 2010-11-09 11:12:32 PST
Additionally, I think this is a secondary discussion.

I believe that my attached patch brings the conformance tests into alignment with the current spec.  I would like to get it reviewed and committed.

Chris, if you want to change the language of the spec (and then change the tests to reflect that), we should have that conversation elsewhere.
Comment 10 Kenneth Russell 2010-11-09 17:57:14 PST
Comment on attachment 73382 [details]
Patch

As Adrienne points out, the WebGL spec is deliberately written so that implementations that don't have stencil buffer support can be compliant. The context-attributes-alpha-depth-stencil-antialias.html test verifies that all of the configurations in this test produce a valid WebGL context (and do more work with the context than this test does) so I think that removing it is fine.

r=me
Comment 11 WebKit Commit Bot 2010-11-09 20:24:16 PST
Comment on attachment 73382 [details]
Patch

Clearing flags on attachment: 73382

Committed r71713: <http://trac.webkit.org/changeset/71713>
Comment 12 WebKit Commit Bot 2010-11-09 20:24:21 PST
All reviewed patches have been landed.  Closing bug.