mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-26 19:54:33 +08:00
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 9e2c7314f2
)
This commit is contained in:
parent
a77f728e1a
commit
0675801f72
@ -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
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user