[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] inconsistent clear behavior for preserveDrawingBuffer: false (the default)
On Fri, Jun 1, 2012 at 3:49 PM, Gregg Tavares (社用) <firstname.lastname@example.org>
I think this means the spec should be more clear. Instead of saying "but only if the drawing buffer has been modified since the last compositing operation" it should be specific and say " but only if clear, drawArrays or drawElements have been called since the last compositing operation".
It would be more concrete to say:
"WebGL presents its drawing buffer to the HTML page compositor immediately before a compositing operation if the drawing buffer dirty flag is set. After presentation, the drawing buffer dirty flag is cleared, and if the the preserveDrawingBuffer attribute in the context's actual context parameters is false, the contents of the backbuffer are cleared to their default values."
and add "Each WebGLRenderingContext has a drawing buffer dirty flag, which is initially set." to 2.1, and "Set the context's drawing buffer dirty flag." to the clear, drawArrays and drawElements definitions.
This makes the state of whether the backbuffer should be recomposited, and whether it should be cleared, an explicit piece of state.
This could be made *closer* to testable by adding eg. getParameter(CONTEXT_DIRTY), which returns the value of the dirty flag. This wouldn't actually test whether the compositing and clearing behaviour is really working correctly, but it'd sort of get halfway there. I doubt there are any use cases for this other than testing, though, so it's probably not worth it.