diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2024-02-08 13:14:37 -0500 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2024-02-15 18:07:03 +0000 |
commit | 0675801f72a930f3f2c1c01475f6f68aede876f2 (patch) | |
tree | 7f967b341b52720f802fe5756fabeeca3b10a64d | |
parent | a77f728e1ad5b75bad2abcaabe21fb003749d4ee (diff) | |
download | mesa3d-0675801f72a930f3f2c1c01475f6f68aede876f2.tar.gz |
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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27534>
(cherry picked from commit 9e2c7314f2867de6f43e2add992590cfb92ccddd)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_io.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index 864a0ab7f1c..17da736709a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -664,7 +664,7 @@ "description": "nir/lower_io: fix handling for compact arrays with indirect derefs", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 58d696677fd..54db3ff4121 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)); |