The Khronos Group, the consortium managing such important projects as OpenGL, WebGPU, OpenAL and Vulkan just announced a major new imitative, the Slang shader language. Khronos Group just made the following tweet:
Details from the press release:
Beaverton, OR – November 21, 2024 – The Khronos® Group, an open consortium of industry leaders in interoperability standards, has announced the launch of the new Slang™ Initiative. This initiative will oversee and advance the open-source Slang shading language and compiler, building on 15 years of research, development, and deployment experience. Supported by NVIDIA since 2017, Slang has been widely adopted in production projects across the industry.
Slang empowers real-time graphics developers with innovative features that complement existing shading languages, including modular code development, portable deployment to multiple target APIs, and neural computation in graphics shaders. Hosting under multi-company governance at Khronos will enable and foster industry-wide collaboration to drive Slang’s continued evolution.
“Slang is now a significant shading language option for graphics developers everywhere, as all are enabled to directly influence and participate in its ongoing development,” said Neil Trevett, president of The Khronos Group and vice president developer ecosystems, NVIDIA. “Khronos’s innovative Slang governance structure blends open-source development agility with the patent safeguards of open standards. Slang is freely available for any platform or API to use, including Khronos, which will leverage Slang in the Vulkan ecosystem while ensuring SPIR-V remains responsive to Slang’s requirements.”
“NVIDIA will continue its longstanding investment in Slang, which is designed to meet the needs of today’s graphics developers while paving the way for the neural graphics revolution,” said Nicholas Haemel, vice president of graphics and system software, NVIDIA. “With Slang in open governance at Khronos, the graphics community can collaboratively advance and harness the advantages of cross-platform support, scalable graphics systems, reduced compile times, and enhanced modularity.”
In terms of what Slang brings to the table:
Slang is designed to address the evolving needs of real-time graphics developers, especially those working with large-scale shader codebases. By supporting modular development with features like modules, interfaces, and generics, Slang simplifies shader creation and maintenance while significantly reducing compilation times.
Many developers must currently rewrite shader code to run on multiple target APIs and platforms or use complex translation or recompilation toolchains. The Slang compiler directly supports multiple backend targets for portable code deployment across diverse APIs and platforms, including SPIR-V for Vulkan, HLSL for Direct3D, GLSL for OpenGL, WGSL for WebGPU, and Metal Shading Language for Apple platforms. For example, Autodesk uses Slang in the Aurora path tracing renderer to enable a single-source ray tracing codebase.
The Slang compiler enables ingestion of existing HLSL and GLSL shader codebases for developers who wish to incrementally migrate to Slang’s modern language features. For example, Valve compiled the entire production Source 2 HLSL codebase with Slang while modifying only 10 lines of code.
Slang supports automatic differentiation as a first-class language feature, making it ideal for integrating neural computation into graphics shaders. Slang can automatically generate both forward- and backward-derivative propagation code for complex functions to easily make existing rendering codebases differentiable, or to use Slang as the kernel language in a PyTorch-driven machine learning framework via slangtorch. For example, Slang is used in the Slang.D Gaussian Splatting Rasterizer, a unified platform for real-time, inverse, and differentiable rendering which can compile to rendering code for diverse platforms.
Key Links
You can learn more about the Slang Shader Programming Language and about the Khronos Group announcement in the video below.