diff --git a/.pick_status.json b/.pick_status.json index 18de5953882..1c5bea6a44b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2104,7 +2104,7 @@ "description": "zink: force host-visible allocations for MAP_COHERENT resources", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 0c692cff6e9..14f4e34351b 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -1181,6 +1181,10 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t mai.pNext = NULL; mai.allocationSize = reqs.size; enum zink_heap heap = zink_heap_from_domain_flags(flags, aflags); + if (templ->flags & PIPE_RESOURCE_FLAG_MAP_COHERENT) { + if (!(vk_domain_from_heap(heap) & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) + heap = zink_heap_from_domain_flags(flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, aflags); + } VkMemoryDedicatedAllocateInfo ded_alloc_info = { .sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,