Branching on a GPU
- Do not fear branching on a GPU, in many cases it’s completely fine
- Know what you are branching on, and what you are branching around.
- Avoid branching on high frequency data and creating divergent pixels
- Branching around textures requires special care
- Visualize the data so you can see exactly what the GPU is doing
- Order your branches from most likely to cull to least likely if possible.
https://medium.com/@jasonbooth_86226/branching-on-a-gpu-18bfc83694f2
#gpu #shader #branching
Post #1615
64