nir/opt_varyings: fix getting deref variables for sysvals

This might fix array system values. Noticed by luck.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32424>
This commit is contained in:
Marek Olšák 2024-12-01 03:01:36 -05:00 committed by Marge Bot
parent dcc679ab3a
commit f0c4e71d58

View file

@ -1053,7 +1053,7 @@ is_sysval(nir_instr *instr, gl_system_value sysval)
nir_instr_as_deref(intr->src[0].ssa->parent_instr);
return nir_deref_mode_is_one_of(deref, nir_var_system_value) &&
deref->var->data.location == sysval;
nir_deref_instr_get_variable(deref)->data.location == sysval;
}
}