3 ms·
> if you have a branch in shader code, all cores may compute both branches As imtringued suggests, that's not quite right. In SIMD terms, all lanes of the core
by MaxBarraclough 6y ago
> if you have a branch in shader code, all cores may compute both branches
As imtringued suggests, that's not quite right. In SIMD terms, all lanes of the core will be 'along for the ride' in case of control-flow diverging. The core must run the instructions for both branches, effectively disabling and re-enabling its various lanes as necessary. When disabled, a lane does no work.
What SIMD calls a lane, SIMT calls a work-item or (perhaps more confusingly) a thread. The term 'core' refers to the level at which there is independent control-flow, much like in CPUs.
See https://en.wikipedia.org/wiki/Single_instruction,_multiple_threads https://en.wikipedia.org/wiki/Single_instruction,_multiple_t...