Turning Mesa Into JavaScript For The Web?

Written by Michael Larabel in Mesa on 6 March 2012 at 08:19 AM EST. 13 Comments
MESA
Besides the recent talk about using Gallium3D's LLVMpipe for Mozilla Firefox, there's another interesting technical discussion happening now about using Mesa on the web to emulate the full OpenGL API using the WebGL API.

Alon Zakai is one of the developers behind Emscripten and started the latest Mesa-for-the-web talk. Emscripten is the interesting project I talked about last year for generating JavaScript from LLVM bit-code. If the code can be lowered-down via LLVM, it can be converted to JavaScript that can be executed in the browser. C/C++ can be easily lowered-down via LLVM and then executed in the browser. Emscripten developers have already used this means of translation to bring Python, Poppler, and other large projects into becoming large JavaScript projects on the web.

The Emscripten developers latest effort has been "to be able to compile OpenGL games from desktop so that they work on WebGL on the web." Quite interesting. The problem that the open-source developers are facing at the moment is the lack of the full OpenGL API on the web, but rather they have just the WebGL API to poke. The Emscripten developers therefore hope using Mesa in some manner may come to their rescue for being able to expose the full OpenGL API while internally it's using the WebGL interfaces. Mesa is largely written in C (and can be built under LLVM/Clang already) so in theory it might possibly work to use Emscripten to convert portions of the code-base into JavaScript.

The developers working on this so far have been able to implement a portion of the OpenGL ES 2.0 API and then brought the es2gears demo to the web. WebGL effectively provides a sub-set of OpenGL ES 2.0 functionality so right now that much isn't a huge challenge.

The discussion about the possibilities for Mesa and Emscripten can be explored further via this mailing list thread, but at the moment there isn't any definitive outcome.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week