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

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Sep  9 20:45:29 2021 -0400

zink: use foreign queue import for dmabufs

this is required to get image data

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>

---

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

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index b187d136d10..31de0c61a5a 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -2368,6 +2368,11 @@ zink_resource_image_barrier(struct zink_context *ctx, 
struct zink_resource *res,
    if (res->obj->needs_zs_evaluate)
       imb.pNext = &res->obj->zs_evaluate;
    res->obj->needs_zs_evaluate = false;
+   if (res->dmabuf_acquire) {
+      imb.srcQueueFamilyIndex = VK_QUEUE_FAMILY_FOREIGN_EXT;
+      imb.dstQueueFamilyIndex = zink_screen(ctx->base.screen)->gfx_queue;
+      res->dmabuf_acquire = false;
+   }
    VKCTX(CmdPipelineBarrier)(
       cmdbuf,
       res->access_stage ? res->access_stage : 
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,

Reply via email to