Mesa (main): zink: don't align device-local buffer memory

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 30 13:23:44 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri May  7 16:07:47 2021 -0400

zink: don't align device-local buffer memory

this can't be mapped

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11594>

---

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

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 28c0ddbfb6a..23df8fa99c7 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -493,7 +493,7 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
    VkMemoryType mem_type = screen->info.mem_props.memoryTypes[mai.memoryTypeIndex];
    obj->coherent = mem_type.propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
    obj->host_visible = mem_type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
-   if (templ->target == PIPE_BUFFER && !obj->coherent) {
+   if (templ->target == PIPE_BUFFER && !obj->coherent && obj->host_visible) {
       mai.allocationSize = reqs.size = align(reqs.size, screen->info.props.limits.nonCoherentAtomSize);
    }
 



More information about the mesa-commit mailing list