[Public WebGL] Optimization or bug?

Mark Callow [email protected]
Tue May 10 20:58:36 PDT 2011

We have discovered an interesting edge case regarding clearing of the
drawing buffer after presentation when preserveDrawingBuffer is false
where the implementations have different behaviour. A simple test
program is attached.

The test program clears only the color channels; the alpha channel is
masked. Both Chrome & Safari clear the alpha channel to zero as required
by the specification. Firefox 4 does not. On the systems I have tested
so far, the initial value set by of 1.0 set when the test starts,
remains in the alpha channel. Most likely the underlying GL
implementations I've been able to test with preserve the drawing buffer
across swap giving this result.

But is this a bug in Firefox or a smart optimization? One could argue
that if the WebGL implementation knows that the GL is preserving the
buffer contents and the application has cleared the channel at least
once, no further action is necessary to preserve security. What do the
list members think?

By the way, the spec language needs a small tweak. Section 2.2 says

    "The table below also shows the value to which these buffers shall
    be cleared when first created or when the size is changed."

It needs to say

    "... when first created, when the size is changed or after
    presentation when preserveDrawingBuffer is false."



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20110511/ac041247/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20110511/ac041247/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: callow_mark.vcf
Type: text/x-vcard
Size: 412 bytes
Desc: not available
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20110511/ac041247/attachment.vcf>

More information about the public_webgl mailing list