LunarGLASS Shader-Compiler Stack
LunarGLASS is an LLVM‐based shader‐compiler stack and optimizer for shaders, including front-end adapters for GLSL and SPIR-V and a back-end adapter for GLSL. It significantly reduces the effort required to develop new GPU compiler stacks.
It provides a shared compiler middle end, including:
- A set of conventions layered on top of LLVM
- A set of optimization and analysis passes for handling issues special to shaders
- Graphical pipeline state‐driven code generation
- Passes tailored by back‐end queries
The primary benefits of LunarGLASS are:
- Reduces the development burden of creating advanced shader‐compiler stacks
- Increases the level of optimization achieved by real‐world applications
- Creates a robust and modular approach that works well across a diverse set of hardware architectures
LunarGLASS is based on establishing common intermediate representations (IRs) allowing modularity between stack layers. Each source-language front end would benefit from a common set of high- and mid-level optimizations, as would each back end, without the need to invent additional IRs.
It brings a new approach by splitting the common shared intermediate representation (IR) into two levels:
- Top level IR ‐ completely platform independent
- Bottom level IR ‐ dynamically tailorable to different families of architecture
Both levels lend themselves to portability and sharing of tools. Together, they solve the problem of having a standard portable IR without being biased toward a specific class of target architecture.
LunarGLASS is open-source software and available on the LunarG GitHub page.