News for hackers. Stuff that matters.
Re:Don't "optimize" conditional moves in shaders with mix()+... by danybittel on Monday February 10, 2025 @12:09AM (#42997143)
f or g may have side effects too. Like writing to memory. Now a conditional has a different meaning.

You could also have some fun stuff, where f and g return a boolean, because thanks to short circuit evaluation && || are actually also conditionals in disguise.

Re:Don't "optimize" conditional moves in shaders with mix()+... by account42 on Monday February 10, 2025 @04:38AM (#42998577)
Side effects will be masked, the GPU is still executing exactly the same code for the entire workgroup.