compiler/nir: add a divergence analysis option for non-uniform workgroup id
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 29 Apr 2021 09:10:32 +0000 (11:10 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 4 May 2021 15:53:23 +0000 (15:53 +0000)
commitaebb47b7d1da799e2b0df14314a8e729c73dca0a
treea24b5ce2d17c552da16cdcb1e28a65b207a2b1ea
parentcaf9fb1a10e238070657e12544c04ae82b5d5aae
compiler/nir: add a divergence analysis option for non-uniform workgroup id

The V3D hardware allows us to pack multiple workgroups together to avoid
wasting execution lanes in shader cores.

For example, if we dispatch 16 workgroups with a local size of 1 element, we
can pack all 16 workgroups in a single 16-wide dispatch where each lane
executes a different workgroup, instead of 16 1-wide dispatches.

When we do this, we don't have a uniform workgroup id any more.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10541>
src/compiler/nir/nir.h
src/compiler/nir/nir_divergence_analysis.c