From bf2ed20eb95a75c828fd0161597838e4d151f46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 19 May 2025 18:35:11 -0400 Subject: [PATCH] nir: remove unused nir_io_semantics::invariant Acked-by: Alyssa on IRC Part-of: --- src/compiler/nir/nir.h | 2 +- src/compiler/nir/nir_lower_io.c | 1 - src/compiler/nir/nir_opt_vectorize_io.c | 4 ---- src/compiler/nir/nir_print.c | 3 --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 7 +------ src/gallium/drivers/r300/compiler/nir_to_rc.c | 7 +------ src/mesa/state_tracker/st_nir_unlower_io_to_vars.c | 1 - 7 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 35e6517604f..9e52710515e 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1940,7 +1940,6 @@ 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 invariant : 1; /* The variable has the invariant flag set */ unsigned high_dvec2 : 1; /* whether accessing the high half of dvec3/dvec4 */ /* CLIP_DISTn, LAYER, VIEWPORT, and TESS_LEVEL_* have up to 3 uses: * - an output consumed by the next stage @@ -1953,6 +1952,7 @@ typedef struct nir_io_semantics { unsigned no_sysval_output : 1; /* whether this system value output has no effect due to current pipeline states */ unsigned interp_explicit_strict : 1; /* preserve original vertex order */ + unsigned _pad : 1; } nir_io_semantics; /* Transform feedback info for 2 outputs. nir_intrinsic_store_output contains diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index c6e4335e76e..2fd827d6afb 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -564,7 +564,6 @@ emit_store(struct lower_io_state *state, nir_def *data, semantics.gs_streams = gs_streams; semantics.medium_precision = is_medium_precision(b->shader, var); semantics.per_view = var->data.per_view; - semantics.invariant = var->data.invariant; nir_intrinsic_set_io_semantics(store, semantics); diff --git a/src/compiler/nir/nir_opt_vectorize_io.c b/src/compiler/nir/nir_opt_vectorize_io.c index 01706d1caec..579804e6406 100644 --- a/src/compiler/nir/nir_opt_vectorize_io.c +++ b/src/compiler/nir/nir_opt_vectorize_io.c @@ -261,8 +261,6 @@ vectorize_store(nir_intrinsic_instr *chan[8], unsigned start, unsigned count, sem.no_sysval_output = 0; if (!nir_intrinsic_io_semantics(chan[i]).no_varying) sem.no_varying = 0; - if (nir_intrinsic_io_semantics(chan[i]).invariant) - sem.invariant = 1; } if (merge_low_high_16_to_32) { @@ -272,8 +270,6 @@ vectorize_store(nir_intrinsic_instr *chan[8], unsigned start, unsigned count, sem.no_sysval_output = 0; if (!nir_intrinsic_io_semantics(chan[4 + i]).no_varying) sem.no_varying = 0; - if (nir_intrinsic_io_semantics(chan[4 + i]).invariant) - sem.invariant = 1; } /* Update the type. */ diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 954d3556860..90c6acfddf1 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -1469,9 +1469,6 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state) if (io.high_16bits) fprintf(fp, " high_16bits"); - if (io.invariant) - fprintf(fp, " invariant"); - if (io.high_dvec2) fprintf(fp, " high_dvec2"); diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index 2703eb0bdae..75fd0504e5d 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -708,11 +708,6 @@ ntt_output_decl(struct ntt_compile *c, nir_intrinsic_instr *instr, uint32_t *fra /* No driver appears to use array_id of outputs. */ unsigned array_id = 0; - /* This bit is lost in the i/o semantics, but it's unused in in-tree - * drivers. - */ - bool invariant = semantics.invariant; - unsigned num_slots = semantics.num_slots; if (semantics.location == VARYING_SLOT_TESS_LEVEL_INNER || semantics.location == VARYING_SLOT_TESS_LEVEL_OUTER) { @@ -729,7 +724,7 @@ ntt_output_decl(struct ntt_compile *c, nir_intrinsic_instr *instr, uint32_t *fra usage_mask, array_id, num_slots, - invariant); + false); } unsigned write_mask; diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index eca33773941..0edb1b8f18a 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -287,13 +287,8 @@ ntr_output_decl(struct ntr_compile *c, nir_intrinsic_instr *instr, uint32_t *fra /* No driver appears to use array_id of outputs. */ unsigned array_id = 0; - /* This bit is lost in the i/o semantics, but it's unused in in-tree - * drivers. - */ - bool invariant = semantics.invariant; - out = ureg_DECL_output_layout(c->ureg, semantic_name, semantic_index, gs_streams, base, - usage_mask, array_id, semantics.num_slots, invariant); + usage_mask, array_id, semantics.num_slots, false); } unsigned write_mask; diff --git a/src/mesa/state_tracker/st_nir_unlower_io_to_vars.c b/src/mesa/state_tracker/st_nir_unlower_io_to_vars.c index 1f318145c71..81292a72770 100644 --- a/src/mesa/state_tracker/st_nir_unlower_io_to_vars.c +++ b/src/mesa/state_tracker/st_nir_unlower_io_to_vars.c @@ -472,7 +472,6 @@ create_vars(nir_builder *b, nir_intrinsic_instr *intr, void *opaque) } /* Some semantics are dependent on the instruction or component. */ - var->data.invariant |= desc.sem.invariant; var->data.stream |= (desc.sem.gs_streams << (desc.component * 2)); if (var->data.stream) var->data.stream |= NIR_STREAM_PACKED;