[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Help with the WebGL Context Lost specification
On Wed, Dec 14, 2011 at 9:07 AM, Glenn Maynard <email@example.com>
(Another gigantic email...)
On Wed, Dec 14, 2011 at 11:54 AM, Benoit Jacob <firstname.lastname@example.org>
The current spec says (IIUC) that the first WebGL call, and only the first call, following a context loss, should generate an WEBGL_CONTEXT_LOST error.
All it says is:
- GLenum getError()
(OpenGL ES 2.0 §2.5, man page)
If the context's webgl context lost flag is set,
CONTEXT_LOST_WEBGL the first time this method is
called. Afterward, returns
NO_ERROR until the context has
The ED puts it differently, but has the same effect.
So IIUC it requires the implementation to keep track of whether a WebGL call was already made since the context loss.
It doesn't require any of the that. Most implementations either have a set of error flags or a last error. When context lost is detected, in the error flags case you do this
error_flags = CONTEXT_LOST_WEBGL_BIT;
which effectively clears all the bits except 1. In the last error case you do
last_error = CONTEXT_LOST_WEBGL
After that since every function is a no-op, and since getError always clears the error or the bit for a specific error you'll only get one CONTEXT_LOST_WEBGL error. No checking needed
Maybe you want want to change the spec to make that clearer?
As for bugs in the context lost conformance test Douglas is correct, it's a bug. At the time I fixed the test there was no spec compliant WEBGL_lose_context extension so there was no way to test it. The line mentioned
shouldGenerateGLError(gl, gl.NO_ERROR, "extension.loseContext()");
should be changed to
Similarly, most likely, any other calls to extension. should not be wrapped in a shouldGenerateGLError
That's just an oversight from copying and pasting lines and not having the ability to test.