nir/glsl: set deref cast mode for blocks during function inlining

More cast fixes this time for UBO and SSBO. Which were missing testing
previously.

Fixes: d681cf96fb ("nir/glsl: set deref cast mode during function inlining")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11587

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31668>
(cherry picked from commit aa7c59e02c)
This commit is contained in:
Timothy Arceri 2024-10-16 10:04:06 +11:00 committed by Eric Engestrom
parent 8ada91f65b
commit bde3e18d65
2 changed files with 5 additions and 1 deletions

View file

@ -34,7 +34,7 @@
"description": "nir/glsl: set deref cast mode for blocks during function inlining",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d681cf96fbf962b67d98ecab1968ed0bb7a04eb0",
"notes": null

View file

@ -67,6 +67,10 @@ fixup_cast_deref_mode(nir_deref_instr *deref)
deref->modes |= nir_var_uniform;
} else if (parent->modes & nir_var_image) {
deref->modes |= nir_var_image;
} else if (parent->modes & nir_var_mem_ubo) {
deref->modes |= nir_var_mem_ubo;
} else if (parent->modes & nir_var_mem_ssbo) {
deref->modes |= nir_var_mem_ssbo;
} else
return;