I am getting validation errors when running vkCreateSwapchainKHR
even though the call in itself returns VK_SUCCESS
.
The errors that I am getting are these
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x1db0b05a108, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | 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.2.176.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x1db0b05a108, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | vkGetPhysicalDeviceImageFormatProperties() unexpectedly failed, when called for vkCreateSwapchainKHR() validation with following params: format: VK_FORMAT_B8G8R8A8_SRGB, imageType: 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: Unhandled VkImageCreateFlagBits. 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.2.176.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x1db0b05a108, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | vkCreateSwapchainKHR() called with a non-supported imageArrayLayers (i.e. 1). 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.2.176.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-017
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x1db0b05a108, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | vkCreateSwapchainKHR() called with imageExtent = (800,600), which is bigger than max extent (0,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.2.176.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
The values like image format, extents look as expected to me in the log message. I also checked my create info struct which looks correct to me. Here is the value as per vs debugger
- | createInfo | {sType=VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR (1000001000) pNext=0x0000000000000000 flags=0 …} | VkSwapchainCreateInfoKHR | |
---|---|---|---|---|
sType | VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR (1000001000) | VkStructureType | ||
pNext | 0x0000000000000000 | const void * | ||
flags | 0 | unsigned int | ||
surface | 0x0683e70000000002 {…} | VkSurfaceKHR_T * | ||
minImageCount | 3 | unsigned int | ||
imageFormat | VK_FORMAT_B8G8R8A8_SRGB (50) | VkFormat | ||
imageColorSpace | VK_COLOR_SPACE_SRGB_NONLINEAR_KHR (0) | VkColorSpaceKHR | ||
+ | imageExtent | {width=800 height=600 } | VkExtent2D | |
imageArrayLayers | 1 | unsigned int | ||
imageUsage | 16 | unsigned int | ||
imageSharingMode | VK_SHARING_MODE_CONCURRENT (1) | VkSharingMode | ||
queueFamilyIndexCount | 2 | unsigned int | ||
+ | pQueueFamilyIndices | 0x000000346cb6ebc8 {0} | const unsigned int * | |
preTransform | VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR (1) | VkSurfaceTransformFlagBitsKHR | ||
compositeAlpha | VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR (1) | VkCompositeAlphaFlagBitsKHR | ||
presentMode | VK_PRESENT_MODE_IMMEDIATE_KHR (0) | VkPresentModeKHR | ||
clipped | 0 | unsigned int | ||
oldSwapchain | 0x0000000000000000 | VkSwapchainKHR_T * |