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

Re: [Public WebGL] Losing GL context during rAF execution?

I've been unsure about the wording as to whether it's possible to actually lose the context in the middle of a stream of GL calls, or if that can happen only when execution is yielded back to the browser. I guess since the spec doesn't say anything about it specifically, then the former should be assumed. Thanks, I think that clears it up.

2015-01-02 20:12 GMT+02:00 Zhenyao Mo <zmo@chromium.org>:
Context lost can happen any time.

On Wed, Dec 31, 2014 at 6:02 AM, Jukka Jylänki <jujjyl@gmail.com> wrote:
> Hi there,
> Is it possible to lose the WebGL context *during* the execution of a rAF
> handler (or for that matter, during some other JS code)? That is, if I have
> the following code:
> function rAF() {
>    if (gl.isContextLost()) {
>       // handle loss
>       return;
>    }
>    gl.xxx();
>    gl.yyy();
>    window.requestAnimationFrame(rAF);
> }
> is it allowed that the GL context gets lost during the GL calls in the
> middle?
> Thanks,
>    Jukka