New DirectX Shader Compiler based on Clang/LLVM now available as Open Source

Chas

January 23rd, 2017

The DirectX HLSL (High Level Shading Language) compiler is now available as an open source project built on the Clang/LLVM framework.

Microsoft drives the leading GPU shader language

Since 2002, HLSL has been a key focus of industry collaboration on GPU programming. As the shader language for the popular DirectX12 API, HLSL is at the forefront of innovation in gaming on both Windows 10 and Xbox. Due to the clear importance of industry collaboration, we have made our latest technology available to a broader audience. This release brings industry collaboration on GPU programming and shader compiler development into a new era of opportunity.

The DirectX Shader Compiler is now open source

Yes, the source is public. Because the source is available, developers can check to see how the compiler works at the smallest level of detail. You can download it, modify it, and make it a part of any system you are building. You can port it to other platforms. You can also contribute your ideas and code to the project directly, or collaborate with other partners (including hardware vendors) on new contributions.

The HLSL compiler is now based on Clang/LLVM technology

The Clang/LLVM framework is a large-scale compiler framework suitable for compiling massive codebases. Using Clang for the shader front-end enables robust operation immediately, plus easier extensibility and innovation over time. Using the LLVM framework, the new compiler emits a new binary shader format known as DXIL. The large Clang/LLVM ecosystem of tools, utilities, documentation, expertise, etc. is now available to help with integrating shaders into major products.

HLSL now supports new wave intrinsics

While the primary focus of the new codebase has been on consistency and scale, a new GPU programming model is enabled in HLSL via the wave intrinsics. These new routines help developers write shaders that take explicit advantage of the SIMD nature of GPU processors to improve performance for algorithms like geometry culling, lighting, and I/O.

User impact

The broader collaboration opportunities of open source, combined with the production scale technology of the Clang/LLVM foundation should result in faster creation of more complex shaders in apps and games. User will see these as much richer visual experiences arriving in shorter timeframes.

For more information

Check out the project readme and wiki pages: https://github.com/Microsoft/DirectXShaderCompiler