KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
Validation seems to be ignoring VK_KHR_image_format_list and VK_KHR_maintenance2
- Dominant language
- C++
- Stars
- 1k
- Forks
- 504
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 224
Description
**Describe the Issue**
Trying to create an ETC2_RGB_UNORM image with RG32_UINT as the uncompressed format using VK_KHR_image_format_list.
```
static VkFormat bpp64[] =
{
VK_FORMAT_R32G32_UINT,
VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
};
VkImageFormatListCreateInfoKHR formatList = { VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR };
formatList.pViewFormats = bpp64;
formatList.viewFormatCount = 3;
VkImageCreateInfo createInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
createInfo.pNext = &formatList;
createInfo.flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR;
createInfo.usage = VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
createInfo.format = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
```
Validation errors:
> [ VUID_Undefined ] Object: VK_NULL_HANDLE (Type = 0) \| vkCreateImage(): Format VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK is not supported for this combination of parameters.
> [ VUID-VkImageViewCreateInfo-usage-02275 ] Object: 0x9522 (Type = 10) | vkCreateImageView(): pCreateInfo->format VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT. The Vulkan spec states: If usage contains VK_IMAGE_USAGE_STORAGE_BIT, then the image view's format features must contain VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-usage-02275)
VK_KHR_maintenance2 states
> Allow creating images with usage flags that may not be supported for the base image’s format, but are supported for image views of the image that have a different but compatible format.
RG32_UINT is compatible with ETC2_RGB_UNORM (both are 64-bit) and supports VK_IMAGE_USAGE_STORAGE_BIT. Should the error get triggered in this case or am I missing something?
**Valid Usage ID**
There should be no validation error
**Environment:**
- OS: Android 13
- GPU: Mali-G78
- SDK or header version if building from repo: 1.3.224.1 SDK release
- Options enabled (synchronization, best practices, etc.):
**Additional context**
Contributor guide
Research direction
Start by reproducing vkCreateImage and vkCreateImageView with the reported VK_KHR_image_format_list and VK_KHR_maintenance2 parameters on the stated Vulkan environment. Compare the validation results with the relevant format-feature and compatible-format rules; the issue is done when the valid configuration no longer produces these errors, or the expected validation behavior is clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100