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

Re: [Public WebGL] OT: exception handling





On Fri, Apr 6, 2012 at 5:40 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
At least some UA vendors are considering triggering context lost on purpose every so often, just so that it creates visible breakage.
Which nicely demonstrates that context-lost is a bug, rather than a "feature".
 
Unless context lost becomes a reasonably common occurrence, yes?
No. The effort required to handle this is stupendous, and the best-case scenario is that you'll incur considerable reload times for no discernable reason to the user, WebGL living in a webpage being particularly disadvantaged there due to inability to control file-system access (I'm aware of the work-arounds/hacks/hopefuls to "solve" this, no need to discuss them).

The code to re-establish a running application is (in any framework and any web application) the initialization code anyway. The nature of JS makes it very inviting to manage your state in closures and objects. The context lost breaks all your living objects and closures. Re-establishing your running application state on a whim is a seriously non-trivial undertaking. The only remotely reasonable/doable approach is to just hit the reset button on your app and start from scratch. And even so, that just won't be possible for some use cases, which out of necessity retain the resources they work with exclusively in vram (GPGPU, games which make efficient usage of buffers, etc.)

If you (or anybody) thinks shooting live resources from under programmers away will make them more likely to invest a stupendous amount of work to create a miserable user-experience, you're delusional.