[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Help with the WebGL Context Lost specification

What is "the conditions in the WebGL specification for restoring the context" in WEBGL_lose_context referring to?

On Wed, Dec 14, 2011 at 9:00 AM, Benoit Jacob <bjacob@mozilla.com> wrote:
My understanding is that the first webgl call on a lost context will generate a CONTEXT_LOST_WEBGL error, but the context loss itself doesn't generate an error, hence { loseContext(); return getError(); } does not return an error. If this interpretation is correct, then the test seems passable. But I'm not expressing an opinion here either way about whether it's a great behavior to specify, it does seem to require some convolution to implement correctly (perhaps with a flag "hasCallBeenMadeSinceContextLoss"??)

We talked about that briefly, but havn't done it.  The idea was to make it more concrete when context loss happens: either when a WebGL call is made, or during the event loop (eg. when no scripts are running).  I'm not sure this is really needed, so I havn't returned to it.

It might be good to integrate CONTEXT_LOST_WEBGL better with OpenGL's error state.  For example, as part of context loss (5.15.2), around step 4, clear all OpenGL error flags and generate a CONTEXT_LOST_WEBGL error according to OpenGL semantics.  getError would then have no special CONTEXT_LOST_WEBGL magic.
From my point of view as an implementer interested in having a simpler implementation, I think I would support that, as it would remove the special "context lost but no webgl call made since" state that the current spec creates.


Glenn Maynard