An Initial Version Of LunarGLASS-LLVM For Mesa

The focus is upon removing the number of IRs (intermediate representations) and to turn to using LLVM IR as the common representation. The original LunarGLASS proposal also praised Low-Level Virtual Machine as being a better candidate for being able to handle OpenCL and more complex GLSL (GL Shading Language) going forward.
While the LunarGLASS proposal is very interesting, some parties (such as the Intel developers who last year invested significantly in rewriting Mesa's GLSL compiler) objected to using LLVM IR as it not being the right solution for high and low level optimizations. Some questioned whether this was even possible of using LLVM IR and then translating it to TGSI (the Gallium3D instruction language) or Mesa IR. The end result of LunarGLASS is to reduce the development burden in creating advanced graphics compiler stacks and to increase the level of optimizations for real-world graphics workloads.
LunarG in the months since has been working out to figure if this will indeed work. Today they are indeed announcing progress and that it is in fact working.
LunarG's John Kessenich announced last night on the Mesa mailing list the availability of the LunarGLASS exploration. To prove that LunarGLASS is possible, LunarG had to define the LLVM IR and then to produce a working experiment to see if translating these IRs was possible and efficient.
LunarG has published their initial IR specification at LunarGLASS.org. They have also setup a Google Code page for their current source-code hosting and to have a mailing list discussion group.
John says in his email message, "Results so far are quite encouraging for the few simple shaders we targeted (still absent flow control). In short, we were able to generate identical results to glsl2 when targeting Mesa IR, using LLVM optimizations instead of glsl2 optimizations. That is, going through the path GLSL -> glsl2-front-end -> Top-IR -> LLVM optimizations -> Mesa-IR."
While this is certainly progress in the right direction, it's not yet production-ready and the LunarGLASS design is still subject to change.
LunarG has put LunarGLASS code under the GPLv2 and the specification under the Creative Commons Attribution No Derivatives license. Though when digging around the LunarGLASS web-site, contributions to LunarGLASS must require accepting LunarG's contributors agreement
7 Comments