Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GPUs suck at things like e.g. data driven branches. What looks like one shader at a high level ends up creating many separate compiled blobs, because you really want some of the parameters baked in at compile time to avoid the performance tanking, and this means you need to compile a version of the shader for every combination of values those parameters can take.


Uniform branches are free pretty much

The main issue is that gpr allocation is static and worse case. So on the majority of hardware you hose your occupancy.


Sometimes it pays off to have an ubershader with all the options though https://dolphin-emu.org/blog/2017/07/30/ubershaders/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: