Hacker News new | past | comments | ask | show | jobs | submit login

does anyone understand how this fits in with the weird mess of SPIR-V/WGSL/Vulkan/GSL/HSL?

is this supposed to take the place as the officially blessed frontend language for SPIR-V? or is this just another standard attempting to replace the other standards (insert XKCD)?




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.


> 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).


https://github.com/shader-slang/slang

It's kind of both. It can generate High level shaders as well as SPIRV, according to the doc.

I interpret this announcement as more about the governance of the open source project than brand new anything. The project has been around for years and there are even some SIGGRAPH papers in this thing.


Yeah the news here is that Khronos is finally throwing their weight behind something modern as the "default" Vulkan shader language, as GLSL has been stagnant for years.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: