nir_lower_io: propagate the "invariant" flag to outputs

Ultimately this is consumed by nir-to-tgsi and needed by virglrenderer
to correctly declare output variables.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14423>
This commit is contained in:
Gert Wollny 2021-12-14 12:22:48 +01:00 committed by Marge Bot
parent 5bfe292708
commit 6f348d9c99
2 changed files with 3 additions and 1 deletions

View file

@ -1765,7 +1765,8 @@ typedef struct nir_io_semantics {
unsigned medium_precision:1; /* GLSL mediump qualifier */
unsigned per_view:1;
unsigned high_16bits:1; /* whether accessing low or high half of the slot */
unsigned _pad:6;
unsigned invariant:1; /* The variable has the invariant flag set */
unsigned _pad:5;
} nir_io_semantics;
#define NIR_INTRINSIC_MAX_INPUTS 11

View file

@ -450,6 +450,7 @@ emit_store(struct lower_io_state *state, nir_ssa_def *data,
var->data.precision == GLSL_PRECISION_MEDIUM ||
var->data.precision == GLSL_PRECISION_LOW;
semantics.per_view = var->data.per_view;
semantics.invariant = var->data.invariant;
/* NV_mesh_shader: prevent assigning several slots to primitive indices. */
if (b->shader->info.stage == MESA_SHADER_MESH &&