https://medium.com/@jasonbooth_86226/branching-on-a-gpu-18bfc83694f2
@TomF it’s… more complicated. Especially if you consider compute path instead of render.
This is another good post about IFs and branching by @BartWronski
@nemo @TomF @BartWronski I do love people explaining how ‘it’s more complicated than that’ TO THE MAN WHO WRITES THE ASSEMBLY LANGUAGE THAT SHADERS RUN ON.
Also Tom, don’t say you ‘discovered’ this post when you asked him to write in the first place because you didn’t want to:)
@jakesimpson @nemo @BartWronski As Jake points out, I am a GPU architect and one of my specialities is the bit that controls divergent branching :-)
Bart's post is also excellent. It's a very important point that:
-If you write an "if", the compiler can convert that to a select/step
-If you write a select/step, the compiler can't always convert it back to an "if"
Always be nice to your GPU compiler!