[Public WebGL] OT: exception handling

Florian Bösch [email protected]
Fri Apr 6 01:05:26 PDT 2012

I think the whole idea of context lost is perverted and broken. If a system
process runs out of memory. It gets sigtermed, if it oversteps its memory,
it gets sighalted, no reasonably programming scheme would do things like
silently free memory you've been using. It's why virtual memory managers,
swap, protected memory etc. have been invented oh roundabouts 1970 and been
thoroughly implemented on all personal computing hardware to around 1985,
to being fully supported by any OS by around 1995. GPUs context lost is a
barbaric regression to the glory days of 1950 or thereabouts in this regard.

On Fri, Apr 6, 2012 at 4:33 AM, Glenn Maynard <[email protected]> wrote:

> (A thought, though: users could patch their contexts, or
> WebGLRenderingContext.prototype if they're feeling more invasive, wrapping
> each function to check for null and throw an exception.  That's a little
> tricky, since you need to call getError to tell whether a null response is
> a context lost or a legitimate null response; you'd need some tricks to
> deal with that without breaking getError.  I think it could be done,
> though; maybe I'll give it a shot.

I don't believe in whatever flavor you paint context lost, that it's ever
going to be handleable in any reasonable way. 100% of current webgl
frameworks and probably pretty close to 100% of webgl apps out there are
"broken" right now. They'll remain broken, and that's the end of story.
It's the one extension nobody will give diddly squat about. If you loose
context, you can just as well go and set every ctx function to
function(){throw 'go away'} in the context lost callback.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20120406/aa8c8f51/attachment.html>

More information about the public_webgl mailing list