From e3542b35a8c5980dd4dd43a047ded4a36f89b055 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 13 Jul 2021 15:38:16 +0200 Subject: [PATCH] vulkan: allocate host-visible memory for swapchain images The Vulkan 1.2 specification, section 11.2.12 ("Host Access to Device Memory Objects") say the following: > memory must have been created with a memory type that reports > VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT Since there's no guarantee that there's any memory that is *both* device-local *and* host-visible, let's just use the latter requirement. Fixes: 8af568e4ae7 ("vulkan: implement wsi_win32 backend") Reviewed-by: Jason Ekstrand Part-of: --- src/vulkan/wsi/wsi_common_win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_win32.c b/src/vulkan/wsi/wsi_common_win32.c index 1b21914..c62de45 100644 --- a/src/vulkan/wsi/wsi_common_win32.c +++ b/src/vulkan/wsi/wsi_common_win32.c @@ -387,7 +387,7 @@ wsi_create_native_image(const struct wsi_swapchain *chain, .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, .pNext = &memory_dedicated_info, .allocationSize = reqs.size, - .memoryTypeIndex = select_memory_type(wsi, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, + .memoryTypeIndex = select_memory_type(wsi, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, reqs.memoryTypeBits), }; result = wsi->AllocateMemory(chain->device, &memory_info, -- 2.7.4