"Vulkan validation layer error: vkCreateSwapchainKHR fails due to unsupported usage flags (VK_IMAGE_USAGE_STORAGE_BIT) for VK_FORMAT_B8G8R8A8_SRGB format on NVIDIA RTX 3050 Ti."

Help with vkCreateSwapchainKHR error on RTX 3050 Ti - VK_IMAGE_USAGE_STORAGE_BIT not supported

Hello,
I’m working on a Vulkan application and I get this validation error when creating the swapchain:

Validation error

validation layer: vkCreateSwapchainKHR(): pCreateInfo->imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT.
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.313.2/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
validation layer: vkCreateSwapchainKHR(): pCreateInfo vkGetPhysicalDeviceImageFormatProperties() unexpectedly failed, with following VkImageCreateInfo
format (VK_FORMAT_B8G8R8A8_SRGB)
type (VK_IMAGE_TYPE_2D)
tiling (VK_IMAGE_TILING_OPTIMAL)
usage (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_STORAGE_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
flags (VkImageCreateFlags(0))
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.313.2/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
validation layer: vkCreateSwapchainKHR(): pCreateInfo->imageArrayLayers 1, but Maximum value returned by vkGetPhysicalDeviceImageFormatProperties() is 0 for imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL.
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.313.2/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
validation layer: vkCreateSwapchainKHR(): pCreateInfo->imageExtent (width = 1280, height = 720), which is bigger than max extent (width = 0, height = 0, depth = 0) returned by vkGetPhysicalDeviceImageFormatProperties() for imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL.
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.313.2/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

I suspect the problem is in the usage flags I’m setting for the swapchain images.

My Vulkan setup and relevant code snippets:

Vulkan setup

  • GPU: NVIDIA GeForce RTX 3050 Ti Laptop GPU
  • OS: Windows 11 Pro
  • Compiler: MSVC
  • Vulkan SDK version: 1.4.312.2

How I create the swapchain:

VkImageUsageFlags usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
if (swapChainSupport.capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
    usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
}

// Removed VK_IMAGE_USAGE_STORAGE_BIT because it causes validation errors

VkSwapchainCreateInfoKHR createInfo{};
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
createInfo.surface = *surface;
createInfo.minImageCount = imageCount;
createInfo.imageFormat = surfaceFormat.format;
createInfo.imageColorSpace = surfaceFormat.colorSpace;
createInfo.imageExtent = extent;
createInfo.imageArrayLayers = 1;
createInfo.imageUsage = usage;
...

Error details:

  • The validation layers complain that VK_IMAGE_USAGE_STORAGE_BIT is not supported with VK_FORMAT_B8G8R8A8_SRGB and VK_IMAGE_TILING_OPTIMAL.
  • vkGetPhysicalDeviceImageFormatProperties returns 0 max image array layers and zero max extent for this format with those usage flags.

Question:

  1. Is it normal that VK_IMAGE_USAGE_STORAGE_BIT is unsupported on swapchain images for this format and tiling?
  2. What is the recommended set of usage flags for a swapchain on RTX 3050 Ti?
  3. How can I achieve a usage similar to VK_IMAGE_USAGE_STORAGE_BIT on swapchain images if needed?
  4. Are there known workarounds or best practices for this?

Please let me know if you need help editing or preparing the post further!

If you needed i can share full code createSwapChain function