r/GraphicsProgramming • u/corysama • Dec 16 '25
Article No Graphics API — Sebastian Aaltonen
https://www.sebastianaaltonen.com/blog/no-graphics-api
254
Upvotes
r/GraphicsProgramming • u/corysama • Dec 16 '25
View all comments
Show parent comment
23
u/Jonny_H Dec 17 '25 edited Dec 17 '25
GPUs don't really have the concept of a "stack" available for each thread of execution, and registers are allocated in advance while also having significant performance advantages to using fewer - so often pretty expensive workarounds have to be made if you want to call "any" function. That is still true on the latest hardware.
So the PSO is often the "natural" solid block the compiler can actually reason about every possible code path as a single unit.
Most shader shared library-style implementations effectively just inline the whole block rather than having some shared code block that is called (and all the "calling convention"-style stuff this implies) due to this, which limits the advantages and can cause "unexpected" costs - like recompiling the entire shader if some of that "shared" code changes.