3 ms·
Slang is a language largely derived from HLSL. It's a solid leap in capability with more powerful features like generics. Largely as a language it brings shader
by MindSpunk 2y ago
Slang is a language largely derived from HLSL. It's a solid leap in capability with more powerful features like generics. Largely as a language it brings shader languages out of the stone ages of plain procedural C and adds tools to help make writing composable shader code less awful.
Slang the compiler is also very cool because it can directly target multiple different languages. Slang can compile to (among other things) HLSL, GLSL, SPIR-V, MSL and WGSL directly. The next closest game in town is DXC which compiles HLSL to DXIL or SPIR-V, with most game engines using a soup of SPIRV-Cross and other translators to convert the SPIR-V to other languages like MSL.
It's shaping up to be a solid choice for a single-source shader pipeline. Especially if you care about being portable to MSL as the current 'state of the art' for turning HLSL into MSL is a fragile chain of several tools.
- flohofwoe 2y ago> Largely as a language it brings shader languages out of the stone ages of plain procedural C It's not the first to do so though, Metal's shading language is C++14 with some restrictions and some enhancements (which IMHO is overkill though, except for the ability to stamp out different specializations from the same template code).