From fe9b93fc1ccf95def5ac5634bc1bd3e50195faf2 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 15 Jul 2024 14:19:34 +1000 Subject: [PATCH] nir: handle wildcard array deref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here we add handling of wildcard array derefs when attempting to mark an io as partially used rather than hitting an assert. Acked-by: Marek Olšák Part-of: --- src/compiler/nir/nir_gather_info.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 5890bca1090..abd3b454a12 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -235,6 +235,10 @@ get_io_offset(nir_deref_instr *deref, nir_variable *var, bool is_arrayed, assert(glsl_type_is_array(var->type)); return 0; } + + if (deref->deref_type == nir_deref_type_array_wildcard) + return -1; + assert(deref->deref_type == nir_deref_type_array); return nir_src_is_const(deref->arr.index) ? (nir_src_as_uint(deref->arr.index) + var->data.location_frac) / 4u : (unsigned)-1; }