zink: fix non-db bindless texture buffers

the db members are only populated in db mode

fixes Dawn of War 3 crash on launch

Fixes: 99ba529fee ("zink: implement descriptor buffer handling of bindless texture")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22566>
(cherry picked from commit 96a0b1e988)
This commit is contained in:
Mike Blumenkrantz 2023-04-18 17:08:40 -04:00 committed by Eric Engestrom
parent 7830c29f6e
commit c3f69d784e
2 changed files with 2 additions and 2 deletions

View file

@ -1165,7 +1165,7 @@
"description": "zink: fix non-db bindless texture buffers",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "99ba529feed6f9917a44458a38acaf0b3d6d261d"
},

View file

@ -54,7 +54,7 @@ static inline struct zink_resource *
zink_descriptor_surface_resource(struct zink_descriptor_surface *ds)
{
return ds->is_buffer ?
zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB ? (struct zink_resource*)ds->bufferview->pres : zink_resource(ds->db.pres) :
zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB ? zink_resource(ds->db.pres) : zink_resource(ds->bufferview->pres) :
(struct zink_resource*)ds->surface->base.texture;
}