WebGL Can Be Moved Off The Main Thread With Latest Firefox
With Firefox 44 and newer it will be possible to move the WebGL rendering work off the main processing thread.
With Firefox 44 when setting the gfx.offscreencanvas.enabled option, it's possible to move the WebGL rendering work off the main thread and to allow for the alternative thread(s) to change what is displayed to the user. "This API is the first that allows a thread other than the main thread to change what is displayed to the user. This allows rendering to progress no matter what is going on in the main thread...Developers will now be able to render to the screen without blocking on the main thread, thanks to the new OffscreenCanvas API. There’s still more work to do with getting requestAnimationFrame on Workers. I was able to port existing WebGL code to run in a worker in a few minutes. For comparison, see animation.html vs. animation-worker.html and worker.js."
More details on this new off-main-thread rendering support can be found via this Mozilla Hacks blog post.
With Firefox 44 when setting the gfx.offscreencanvas.enabled option, it's possible to move the WebGL rendering work off the main thread and to allow for the alternative thread(s) to change what is displayed to the user. "This API is the first that allows a thread other than the main thread to change what is displayed to the user. This allows rendering to progress no matter what is going on in the main thread...Developers will now be able to render to the screen without blocking on the main thread, thanks to the new OffscreenCanvas API. There’s still more work to do with getting requestAnimationFrame on Workers. I was able to port existing WebGL code to run in a worker in a few minutes. For comparison, see animation.html vs. animation-worker.html and worker.js."
More details on this new off-main-thread rendering support can be found via this Mozilla Hacks blog post.
8 Comments