[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Lost Context
On Mon, Feb 15, 2010 at 10:23 AM, Chris Marrin <email@example.com>
On Feb 13, 2010, at 3:57 PM, Vladimir Vukicevic wrote:
>Let's not get too hasty here, saying that there is no way to automatically recover from a context loss. First of all, what does context loss mean? Does it mean that some or all of the resources (textures, VBOs, etc.) are lost, or is the GL state lost as well?
> Yep, it's not that we don't want to discuss it, it's more that there's really no sane way around it -- the only alternative is to keep a copy of every user resource. It would be better if the underlying GL/D3D impl would take care of all of that, and I'd guess that we'll get there eventually..
If it's the former then it's just a matter of keeping a shadow copy of all the buffer data. Often the source data is from an HTML image, which is cached anyway.
It's both resources and state but if we wanted to recover we could shadow the state as well.
What we can't recover is framebuffers and renderbuffers.
Actually this brings up a new problem. I don't know what all the implementations do but I suspect some of them are using an FBO to store the contents of the canvas and they never copy that store to CPU memory except on toDataURL or ctx2d.drawImage. But that brings up the issue that a lost-context can loose the FBO state which isn't what's supposed to happen for the <canvas> tag. Once you've drawn something it's supposed to be permanent. I guess we can ask the HTML5 guys to change the <canvas> spec to say the canvas can lose its contents at any time.
I know it would incur extra work and storage overhead to do automatic recovery. But let's not discard the notion before analyzing it some more. This is the web and web authors expect that lots of the background work will be done for them.
You are currently subscribe to firstname.lastname@example.org.
To unsubscribe, send an email to email@example.com with
the following command in the body of your email: