KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
False negative for VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT in vkGetPhysicalDeviceImageFormatProperties2 with multiple logical devices
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1k
- Forks
- 505
- Avg merge
- 11h 25m
- Merged PRs (30d)
- 229
Description
Describe the Issue
Issue appeared when two logical devices with different extensions enabled were created in single instance:
-
device_extensions saved with layer_data using physical_device is getting overwritten while creating the new logical device.
-
When we are using vkGetPhysicalDeviceImageFormatProperties2, in ValidateRangedEnum() VL checks if specific extensions are enabled, which are based on most recent call to vkCreateDevice()
As far as I understand we should be able to use vkGetPhysicalDeviceImageFormatProperties2 without creating logical device, but currently in VL there is dependency between it and vkCreateDevice().
During call to vkGetPhysicalDeviceImageFormatProperties2, VL checks if image format, flags, type, tiling etc are valid.
With some of the values of this parameters there may be a problem, like for example VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT tiling, as it needs specific extension enabled to be considered correct.
Problem is with check for this value, as VL are taking device_extensions saved with layer_data using physical_device, which is being overwritten every time new logical device is created via vkCreateDevice.
When second logical device is created without VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME enabled, and later we are using vkGetPhysicalDeviceImageFormatProperties2 with VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT VL will flag drm tiling as not proper one.
Similar issues may occur with other parameters, for example some of the VkFormats.
Expected behavior
Treating VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT tiling as proper one in vkGetPhysicalDeviceImageFormatProperties2() call, either in all occurences, or when VkPhysicalDevice supports VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME.
Valid Usage ID
If applicable, please include the validation messages encountered leading up to the issue
Additional context
code or terminal output
- Message: 'Validation Error: [ VUID-VkPhysicalDeviceImageFormatInfo2-tiling-parameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xd529ceec | vkGetPhysicalDeviceImageFormatProperties2KHR: value of pImageFormatInfo->tiling (1000158000) does not fall within the begin..end range of the core VkImageTiling enumeration tokens and is not an extension added token. The Vulkan spec states: tiling must be a valid VkImageTiling value (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-tiling-parameter)'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing vkGetPhysicalDeviceImageFormatProperties2 through ValidateRangedEnum() and the device_extensions state populated during vkCreateDevice(). Check how that state is associated with a physical device when multiple logical devices use different extensions. Done means DRM modifier tiling is accepted correctly without being affected by the most recently created logical device, with coverage for the reported scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100