From 1c78dd0246aec691079c526103af2955f8c0069d Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Tue, 14 Jul 2020 17:24:43 +0100 Subject: [PATCH] c/client: Slightly improve barriers, taken from !360 Transplanted by Jakob, all the hard spec reading done by Ben. --- src/xrt/compositor/client/comp_vk_client.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xrt/compositor/client/comp_vk_client.c b/src/xrt/compositor/client/comp_vk_client.c index 62da4e20c..b2b1f4826 100644 --- a/src/xrt/compositor/client/comp_vk_client.c +++ b/src/xrt/compositor/client/comp_vk_client.c @@ -395,10 +395,10 @@ client_vk_swapchain_create(struct xrt_compositor *xc, .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .srcAccessMask = 0, .dstAccessMask = vk_swapchain_access_flags(info->bits), - .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - .srcQueueFamilyIndex = c->vk.queue_family_index, - .dstQueueFamilyIndex = c->vk.queue_family_index, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = sc->base.images[i], .subresourceRange = subresource_range, }; @@ -408,9 +408,9 @@ client_vk_swapchain_create(struct xrt_compositor *xc, .srcAccessMask = vk_swapchain_access_flags(info->bits), .dstAccessMask = 0, .oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + .newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, .srcQueueFamilyIndex = c->vk.queue_family_index, - .dstQueueFamilyIndex = c->vk.queue_family_index, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL, .image = sc->base.images[i], .subresourceRange = subresource_range, };