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

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Feb  9 16:10:56 2023 -0500

zink: unref image buffer descriptors on unbind

Fixes: 7ab5c5d36d2 ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

---

 src/gallium/drivers/zink/zink_context.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index 804ec369136..278e2ef9edf 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1671,6 +1671,8 @@ unbind_shader_image(struct zink_context *ctx, 
gl_shader_stage stage, unsigned sl
       unbind_buffer_descriptor_stage(res, stage);
       unbind_buffer_descriptor_reads(res, stage);
       zink_buffer_view_reference(zink_screen(ctx->base.screen), 
&image_view->buffer_view, NULL);
+      if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB)
+         pipe_resource_reference(&image_view->base.resource, NULL);
    } else {
       unbind_descriptor_stage(res, stage);
       unbind_descriptor_reads(res, stage);

Reply via email to