Which shader language is preferred for SDL3?

I’m new to graphics dev, so still unsure about the shader language to settle on.

HLSL seems supported by Shadercross,

GLSL looks less verbose, maybe because of tutorial I followed.

So what shader language has best readability, less verbosity and is modern for Vulkan, DX12 or Metal use?

What’s with the Slang shader language? Will lack of tutorial hold me back on this?

What is SDL3 community’s favourite?

What’s the SDL lead developer’s point of view?

Does any language have enums instead of numbers for set and binding? So I don’t always have to look for proper number? Or is that something I have to remember?

Think of it like this: it shouldn’t really matter as long as the language of choice can compile to SPIR-V to be used directly or compiled to the appropriate target format with Shadercross. If you are writing HLSL then you can skip the first step and compile directly to the target format.

HLSL have been a dominant shader language for real-time graphics in the industry for a long time. Whenever you see GDC or SIGGRAPH presentation on rendering it tend to be HLSL if it include shader code.

HLSL has also some nice things missing from GLSL. For example an include directive that let you reuse code:

#include <foobar.hlsl>
1 Like

Thank you @dahnielson.

I have moved from GLSL to HLSL and I like it so far.
Inputs and outputs made sense to me, as it looks like a function.

I was thinking how people reuse code in GLSL. I never saw anyone importing any package, which seemed odd. Now I know.

Plus I found a really big tutorial series, by Ben Cloward and Unity tutorials are plenty on YouTube, so HLSL makes perfect sense for a beginner like me.