From 9e2c7314f2867de6f43e2add992590cfb92ccddd Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 8 Feb 2024 13:14:37 -0500 Subject: [PATCH] nir/lower_io: fix handling for compact arrays with indirect derefs this logic relies on constant indexing for compact arrays, but this is frequently not the case for compact array builtins (e.g., gl_TessLevelOuter). the usual strategy of lowering to temps isn't viable in TCS, which means io lowering has to be able to handle indirect access to these builtins without crashing cc: mesa-stable Reviewed-by: Dave Airlie Part-of: --- src/compiler/nir/nir_lower_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 2f388abae80..d7ec7d0113e 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -216,7 +216,7 @@ get_io_offset(nir_builder *b, nir_deref_instr *deref, p++; } - if (path.path[0]->var->data.compact) { + if (path.path[0]->var->data.compact && nir_src_is_const((*p)->arr.index)) { assert((*p)->deref_type == nir_deref_type_array); assert(glsl_type_is_scalar((*p)->type));