Well @andrewrk it solves so many issues on the CPU-GPU code sharing front but the still missing matrix math and vector swizzle looks really painful.
Really looking forward to this landing.
The work is amazing, having comptime on the GPU really is something !
Btw, is there any example around that touches spec constants ?
I would never direct anybody to GLSL for anything, anymore. Slang is so much better itās ridiculous, at this point.
That doesnāt make me happy, and Iām really looking forward to when Zig is good enough to supplant slang, but thatās the current state of the industry.
IMHO GLSL is still perfectly fine if you need a slim solution, e.g. the combo glslang as frontend and SPIRVCross as backend is much smaller and much easier to integrate and customize than Slang. Also, one major advantage of GLSL is that it hasnāt been infected by the OOP/C++ virus like HLSL or MSL
Iāve been using Zig for my shaders since 0.15.1 (SDF + tile based GUI, mostly compute shaders) and I wouldnāt go back to GLSL.
The largest warts in my pipeline are relying on spirv-opt and (iirc) doing some inline SpirV to get PhysicalStorageBufferAddresses working properly, I need to revisit this.
My GUI was crawling before spirv-opt, but I havenāt tried without it in a while.
Auto-differentiation is the killer feature keeping me on Slang right now. Iām not sure if thatās possible in Zig without custom arithmetic types / operator overloading.
Another thing that you could do here that was pointed out I think a couple weeks was instead of writing it as a.mul(b.add(c)) because it is just syntax sugar you can keep the methods defined the same and write something like:
const res: Thing = .mul(
a,
.add(
b,
c,
),
);
/// OR
const res: Thing = .mul(a, .add(b, c));
Doesnāt solve the not able to use operators problem but I find it much more readable and reminds me of lisp.