nir: Fix divergence analysis for tessellation input/outputs
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 5 May 2020 18:03:12 +0000 (11:03 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 24 Jun 2020 03:25:10 +0000 (03:25 +0000)
commit6a5fb31fefbc24a5ad375a26206328e416f4e846
tree9ae2ec3edfefa9f55dd96a0f8899b31139bb18cb
parent8278a46b26a690b58b85454eccc48caf65012671
nir: Fix divergence analysis for tessellation input/outputs

The load_per_vertex_{input,output} intrinsics simply mean that they're
reading an arrayed input/output, which have one element per invocation.
Most accesses to those use gl_InvocationID as the subscript.  However,
it's totally possible to read any element of the array.  For example,
an evaluation shader might read gl_in[2].gl_Position, or a control
shader might read output[0].

For threads processing a single patch, an input/output load is
convergent if and only if both sources (the per-vertex-array subscript
and the offset) are convergent.  For threads processing multiple
patches, we continued to mark them divergent.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5613>
src/compiler/nir/nir_divergence_analysis.c