diff --git a/base/VulkanSwapChain.hpp b/base/VulkanSwapChain.hpp index 9f9f80c4..e2e953ab 100644 --- a/base/VulkanSwapChain.hpp +++ b/base/VulkanSwapChain.hpp @@ -391,13 +391,16 @@ public: swapchainCI.clipped = VK_TRUE; swapchainCI.compositeAlpha = compositeAlpha; - // Set additional usage flag for blitting from the swapchain images if supported - VkFormatProperties formatProps; - vkGetPhysicalDeviceFormatProperties(physicalDevice, colorFormat, &formatProps); - if ((formatProps.optimalTilingFeatures & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR) || (formatProps.optimalTilingFeatures & VK_FORMAT_FEATURE_BLIT_SRC_BIT)) { + // Enable transfer source on swap chain images if supported + if (surfCaps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { swapchainCI.imageUsage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT; } + // Enable transfer destination on swap chain images if supported + if (surfCaps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { + swapchainCI.imageUsage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; + } + VK_CHECK_RESULT(fpCreateSwapchainKHR(device, &swapchainCI, nullptr, &swapChain)); // If an existing swap chain is re-created, destroy the old swap chain