News for hackers. Stuff that matters.
Re:Don't "optimize" conditional moves in shaders with mix()+... by vanderZwan on Monday February 10, 2025 @03:29AM (#42998056)
Does this also apply for shaders? And is it even useful given the enormous variation in hardware capabilities out there. My impression was that it's all JIT compiled unless you know which hardware you're targeting, e.g. Valve precompiling highly optimized shaders for the Steam Deck

(I'm not a grapics programmer, mind you, so please correct any misunderstandings on my end)

Re:Don't "optimize" conditional moves in shaders with mix()+... by swiftcoder on Monday February 10, 2025 @04:25AM (#42998453)
It's all JIT'd based on the specific driver/GPU, but the intermediate assembly language is sufficient to inspect things like branches and loop unrolling.
Re:Don't "optimize" conditional moves in shaders with mix()+... by grg0 on Monday February 10, 2025 @10:22PM (#43008573)
Not really. DXIL in particular will still have branches and not care much about unrolling. You need to look at the assembly that is generated. And yes, that depends on the target hardware and compiler/driver.
Re:Don't "optimize" conditional moves in shaders with mix()+... by account42 on Monday February 10, 2025 @04:32AM (#42998525)
You will have to check for the different GPUs you are targetting. But GPU vendors don't start from scratch for each hardware generation so you will often see similar results.