How to get the create info from a given image?

I got some problems when implement the validation rule on the spec:

VUID-VkImageViewCreateInfo-image-01003
If image was not created with VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then viewType must not be VK_IMAGE_VIEW_TYPE_CUBE or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY

In my case, the image I got is returned from a swapchain by using vkGetSwapchainImagesKHR, not created by myself, and I checked the doc and didn’t find a function to query the VkImageCreateFlagBits.

So

  1. Is there a function to do that?
  2. If not, should I ignore checking rules like this (rules depends on information about a give image) in my case?
  1. No, but you could create one for yourself from this table. Wrt the VU, It kinda is a formal problem I reported at KhronosGroup/Vulkan-Docs#473. Though it would be a brittle function wrt future extensions.
  2. Swapchain image currently cannot be a cube, so there is nothing to check really.
1 Like

PS: ad 1: there should be a similar function in VVL already though. IMAGE_STATE.createInfo

Thanks, I came across the quote part in your link before and didn’t get it, I get it for now.