[Public WebGL] Non-binding context creation attributes, specifically 'stencil'

Jeff Gilbert [email protected]
Mon Apr 16 20:45:31 PDT 2012

This demo which works 'correctly' in Chrome does not work in Firefox:

This is because the author does not request a stencil buffer at context creation. In the absence of a selection, the context creation hint 'stencil' defaults to false. However, 'antialias', 'depth', and 'stencil' are non-binding hints. That is, a compliant implementation can ignore them.

While this is necessary for when such buffers are not available, it is also allowable to always supply such buffers, even when they are (implicitly or explicitly) not requested.  Firefox never supplies such buffers when the relevant context creation attribute is false, which is the default for stencil buffers. Chrome appears to supply stencil buffers in the absence of any request. (possibly in spite of a negative request, but I have not checked) I have not yet checked other browsers.

This implementation-defined behavior causes the above demo to render as intended in Chrome, but fails to do so in Firefox. If we were to have a strict or adverse reference renderer, this demo would also fail to consistently render as intended there. Since the two implementations are (in as far as this demo is concerned) spec-compliant, I believe this is a spec issue.

I move that we require any (implicit or explicit) negative requests for 'antialias', 'depth', and 'stencil' to guarantee they will not be supplied with that respective buffer type, similar to 'alpha'. Because 'stencil' defaults to false, this means that in the absence of a positive request for a stencil buffer, the context will not receive one.


Firefox bugs filed because of this are:

You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl

More information about the public_webgl mailing list