logoalt Hacker News

grg0 • yesterday at 11:42 PM • 3 replies • view on HN

As far as I know, desktop graphics APIs/drivers don't allow you to straight up load shaders in assembly; they have you go through IL and they compile that down to the GPU's ISA. You would have to bypass the user-mode driver at the very least. TIL that consoles do allow this and it makes sense; why waste time compiling the shaders at runtime when you already know what the target hardware is.


Replies

dolmen • today at 11:15 AM

> TIL that consoles do allow this and it makes sense; why waste time compiling the shaders at runtime when you already know what the target hardware is.

I guess that's one of the tricks the Steam Deck does: shaders compiled once and cached on the Steam servers for distribution in the assets instead of being compiled on the user's machine.

➕ show 1 reply
monocasa • today at 10:14 AM

There's a shader binary extension that's supposed to be for compute shaders and pipeline state objects previously compile on that system/driver that is possible to reuse with a little elbow grease.

ladberg • today at 1:58 AM

This would be surprising because it's the primary method of running compute workloads on GPU!

➕ show 1 reply