2 ms·
To a first approximation, as long as spatially-local fragments all take the same branches, you can get good performance from branching on GPU. What matters is w
by pcwalton 8y ago
To a first approximation, as long as spatially-local fragments all take the same branches, you can get good performance from branching on GPU. What matters is whether individual threadgroups ("warps", in NVIDIA speak) have coherent branches. The rasterizer makes an attempt to schedule nearby pixels on the same threadgroup, mostly to improve memory locality, but also to benefit workloads like yours.
In your case, if your scene objects are relatively large and nearby rays all tend to hit the same objects, then per-threadgroup branch divergence can be minimal.