Bug 85338 - Enforce alpha:false and depth:false more consistently
Summary: Enforce alpha:false and depth:false more consistently
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on: 85317
  Show dependency treegraph
Reported: 2012-05-01 19:09 PDT by Kenneth Russell
Modified: 2014-01-09 20:15 PST (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2012-05-01 19:09:24 PDT
WebKit's WebGL implementation currently relies heavily on the OpenGL driver to provide certain behavior, such as when the developer requests that the alpha channel be disabled for the back buffer, or no depth buffer be provided.

Gregg Tavares went to great lengths in Chromium to avoid running into driver bugs in these areas. For example, if the user requests no alpha channel, his code will always allocate an RGBA texture, but do tricks with the color mask and clear color to ensure that its alpha channel is always populated with 0xFF. These workarounds were motivated by driver bugs encountered in real applications; see for example Bug 61091. Unfortunately, Gregg's workarounds were lost when moving WebKit's WebGL implementation to use a user-allocated FBO (in DrawingBuffer) for its rendering results.

Bug 85317 restores the behavior for the stencil buffer. For best robustness, similar code is needed for the color mask, depth mask and other state. See ApplyDirtyState in http://src.chromium.org/viewvc/chrome/trunk/src/gpu/command_buffer/service/gles2_cmd_decoder.cc . This code should be added to WebGLRenderingContext and other classes to apply to all WebKit ports.