Mesa (staging/21.1): zink: use cached memory for staging resources

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 24 12:31:35 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: 0f274d1c531333643cbbf52df4667285c1741e83
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f274d1c531333643cbbf52df4667285c1741e83

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Apr 19 18:28:13 2021 -0400

zink: use cached memory for staging resources

I think at one point before staging resource flagging was less reliable
this method made sense, but now it's worse

Fixes: 6ff6d01c377 ("zink: don't use cached mem for staging resources")

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10363>
(cherry picked from commit e34dc0840bf318cdd6524bcb8671ae4b849e4039)

---

 .pick_status.json                        | 2 +-
 src/gallium/drivers/zink/zink_resource.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 203ce7bff5b..927354ae9b0 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -409,7 +409,7 @@
         "description": "zink: use cached memory for staging resources",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "6ff6d01c3777ed2bed7b80029f946425835d918e"
     },
diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 5cf4e812fa8..918a5c5b4af 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -454,7 +454,7 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
    if (templ->flags & PIPE_RESOURCE_FLAG_MAP_COHERENT || templ->usage == PIPE_USAGE_DYNAMIC)
       flags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
    else if (!(flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) &&
-            templ->usage != PIPE_USAGE_STAGING)
+            templ->usage == PIPE_USAGE_STAGING)
       flags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
 
    VkMemoryAllocateInfo mai = {};



More information about the mesa-commit mailing list