zink: fix crash in lower_pv_mode_gs_store

src->parent can be null

Fixes: 39770c6503 ("zink: fix store subsitution in `lower_pv_mode_gs_store`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24642>
(cherry picked from commit 04dbb556c2)
This commit is contained in:
Mike Blumenkrantz 2023-08-11 15:16:51 -04:00 committed by Dylan Baker
parent 2febfbce39
commit 8dab73cab2
2 changed files with 4 additions and 2 deletions

View file

@ -6774,7 +6774,7 @@
"description": "zink: fix crash in lower_pv_mode_gs_store",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "39770c6503ac44090decd88698802bb95189bb4d",
"notes": null

View file

@ -428,7 +428,9 @@ lower_pv_mode_gs_ring_index(nir_builder *b,
static nir_deref_instr*
replicate_derefs(nir_builder *b, nir_deref_instr *old, nir_deref_instr *new)
{
nir_deref_instr *parent = nir_src_as_deref(old->parent);
nir_deref_instr *parent = nir_deref_instr_parent(old);
if (!parent)
return new;
switch(old->deref_type) {
case nir_deref_type_var:
return new;