Practice free →
Home › In a fragment shader, BRANCHING on a uniform vs …

In a fragment shader, BRANCHING on a uniform vs a varying / per-fragment value differs because of which property?

AUniform branch is coherent in a warp + varying diverges
BVarying branches are zero-cost on modern GPUs nowadays
CBoth produce identical assembly always on a GPU device
DUniform branches are always slower than varying branches
Answer & Solution
Correct answer: A. Uniform branch is coherent in a warp + varying diverges
LearnOpenGL + NVIDIA programming guide: GPU executes SIMT warps; varying branches force serialisation of paths. Uniform branches are coherent → cheap.
Solve this in the app — Practice practice & 24k+ MCQs →
Related questions