Live data from Hacker News

The Slang Shading Language

shader-slang.com

41–50 of 50 posts

Re: The Slang Shading Language

#41

Earlier quoted context omitted.

Nobody is using all these languages at the same time, anyone who targets all these platforms already has some mechanism to turn HLSL or GLSL (or whatever) into what the target platform needs. That's why Slang will have difficulty finding adoption, it's the N+1th solution to a problem that already has been solved N times.

RetroArch uses all of them. HLSL, GLSL, Vulkan, Slang, Cg as well as proprietary shader formats used on consoles, as some platforms only support specific formats, so they often convert between all of them to offer as many shaders as possible across all combinations of platforms. But one of their big contributors also worked on Vulkan and Slang/SPIR-V itself if I recall correctly (and works at ARM on GPU drivers), so…

Retroarch can ingest GLSL, Cg, and its own extension of GLSL it calls "Slang shaders." Cg is deprecated. It uses SPIRV-Cross, the de facto solution to transliterate to other APIs. The "slang" in this article is an entirely different "slang".

The guy who created Retroarch, Themaister, seems to work for Valve now, and continues to work on SPIRV-Cross among other things, making gaming on Linux actually viable.

Re: The Slang Shading Language

#43

Also check out Rust GPU, which has similar features and uses Rust rather than a new language: https://github.com/Rust-GPU/rust-gpu

Don't we already have a shader language with Rust-syntax in WGSL? It also works everywhere, given that WebGPU works wherever Vulkan, Metal & DirectX do...

It's not just syntax, it is semantics as well.

Re: The Slang Shading Language

#46

Earlier quoted context omitted.

It must not last, because any API that is the common denominator between 10 year old mobile SOCs and current year high end desktop GPUs is doomed to do injustice to either platform.

The only way for it to last would be for browsers to compile into some kind of compatibility layer for newer GPU features on older hardware, but that’s probably going to be extremely tough to do in some cases without killing performance on the older platforms, particularly if those features relate to things like synchronization.

Newer mobile GPUs worth a damn pretty much have the same feature set as desktop.

Except texture formats in case of Mali and Exynos w/ RDNA. But QCOM (since quite a while) and Apple (E17+) have a unified set there including BC7 support.

So perhaps split things into profiles, with a more modern profile where the only thing varying is texture format support.

Re: The Slang Shading Language

#47
post #40

Earlier quoted context omitted.

I have known about slang for some time but hadn’t heard about these commercial products. Can you elaborate?

From Vulkanised 2024, https://vulkan.org/user/pages/09.events/vulkanised-2024/vulk... Omniverse, Portal RTX, RTX Remix, Source 2 shading infrastructure,

Thanks!

Re: The Slang Shading Language

#48
post #40

Earlier quoted context omitted.

I have known about slang for some time but hadn’t heard about these commercial products. Can you elaborate?

From Vulkanised 2024, https://vulkan.org/user/pages/09.events/vulkanised-2024/vulk... Omniverse, Portal RTX, RTX Remix, Source 2 shading infrastructure,

His is misleading. Three of these are Nvidia related technologies, and Valve is _planning_ to migrate Source 2'a shader compiler to Slang.

Re: The Slang Shading Language

#49
post #40

Earlier quoted context omitted.

From Vulkanised 2024, https://vulkan.org/user/pages/09.events/vulkanised-2024/vulk... Omniverse, Portal RTX, RTX Remix, Source 2 shading infrastructure,

His is misleading. Three of these are Nvidia related technologies, and Valve is _planning_ to migrate Source 2'a shader compiler to Slang.

Doesn't matter who is the owner of said technologies, they are products, not research stuff without customers.

"Migrated" is past tense, not something yet to be planned.

Re: The Slang Shading Language

#50

Earlier quoted context omitted.

Nobody is using all these languages at the same time, anyone who targets all these platforms already has some mechanism to turn HLSL or GLSL (or whatever) into what the target platform needs. That's why Slang will have difficulty finding adoption, it's the N+1th solution to a problem that already has been solved N times.

> anyone who targets all these platforms already has some mechanism to turn HLSL or GLSL (or whatever) into what the target platform needs Slang provides a standard and open source solution that's better and more featureful than those custom solutions.

For a greenfield project, perhaps that makes it a good choice, but using it to replace established systems needs more arguments than "it's better". Is it really better than a existing, bespoke solution? Keep in mind that the shader language is just one part of targeting a graphics API, you still need a lot of boilerplate surrounding it and Slang doesn't (and probably shouldn't) solve that problem.
Post reply on HN