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

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Oct 13 08:51:36 2023 -0400

zink: enable unsynchronized texture uploads using staging buffers

by not returning busy for non-HIC unsynchronized texture uploads,
the GL frontend will fall through to directly access the unsynchronized
cmdbuf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>

---

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

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index 6a282be0670..25b86fa51f5 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -4918,14 +4918,9 @@ zink_context_is_resource_busy(struct pipe_screen 
*pscreen, struct pipe_resource
 {
    struct zink_screen *screen = zink_screen(pscreen);
    struct zink_resource *res = zink_resource(pres);
-   if (!res->obj->is_buffer && usage & PIPE_MAP_UNSYNCHRONIZED) {
-      if (zink_is_swapchain(res))
-         return true;
-      if (!(res->obj->vkusage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT) &&
-          (!res->linear || !res->obj->host_visible))
-         return true;
-   }
    uint32_t check_usage = 0;
+   if (usage & PIPE_MAP_UNSYNCHRONIZED && (!res->obj->unsync_access || 
zink_is_swapchain(res)))
+      return true;
    if (usage & PIPE_MAP_READ)
       check_usage |= ZINK_RESOURCE_ACCESS_WRITE;
    if (usage & PIPE_MAP_WRITE)

Reply via email to