kk: Fix crash in PositiveShaderImageAccess.UndefImage

Clean sample instructions that have an undef texture as a source

Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39858>
This commit is contained in:
Aitor Camacho 2026-02-09 18:56:15 +09:00 committed by Marge Bot
parent 384ce6d8d3
commit 05cca7eb36

View file

@ -1969,6 +1969,11 @@ msl_preprocess_nir(struct nir_shader *nir)
* generate discards. */
NIR_PASS(_, nir, nir_lower_system_values);
/* nir_lower_vars_to_ssa may remove instructions due to undef values such as
* store from an undef image sample. Fixes VVL test
* PositiveShaderImageAccess.UndefImage */
NIR_PASS(_, nir, nir_opt_dce);
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
nir_input_attachment_options input_attachment_options = {};
NIR_PASS(_, nir, nir_lower_input_attachments, &input_attachment_options);