Module: Mesa
Branch: main
Commit: 96a0b1e9880cee88905fe45451404e0d3120f382
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=96a0b1e9880cee88905fe45451404e0d3120f382

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Apr 18 17:08:40 2023 -0400

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: 99ba529feed ("zink: implement descriptor buffer handling of bindless 
texture")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22566>

---

 src/gallium/drivers/zink/zink_context.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_context.h 
b/src/gallium/drivers/zink/zink_context.h
index df48e2d4a02..c75879e0f5d 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -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;
 }
 

Reply via email to