Closed cgutman closed 4 months ago
Thanks for digging up all this information, will take a look today/tomorrow
I realize we really should have added a VVL regression test when acting the DRM change before, but back then I didn't have enough knowledge of DRM Format Modifier or a Mesa build to test with
@cgutman sorry for the delay
spent some time on this and I think the issue might be that Mesa and Spec don't match up, the spec VU is
tiling must be VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT if and only if the pNext chain includes VkPhysicalDeviceImageDrmFormatModifierInfoEXT
but not that if tiling is DRM_FORMAT_MODIFIER, a pNext struct must be there
also it seems the fix was already patched in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/7318/files
closing as I'm still convinced https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/7318 fixed this, happy to reopen and confirmed it did not (but I can't reproduce this issue with ToT)
Environment:
Describe the Issue
The new validation introduced in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/7199 regressed the UB fix made in ce2c6eff3457a331efd64da800c5ac393285cf40 and reintroduced the crashes in reported in #5649 and #5687 (though now it's now crashing during
vkBindImageMemory()
rather thanvkCreateImage()
). AFAICT, this regression was first released in v1.3.275 and persists today in v1.3.280.This happens because Mesa assumes that the pNext chain passed to
vkGetPhysicalDeviceImageFormatProperties2()
always includes includesVkPhysicalDeviceImageDrmFormatModifierInfoEXT
, which is a specification requirement perVUID-VkPhysicalDeviceImageFormatInfo2-tiling-02249
. The relevant Mesa code is here: https://gitlab.freedesktop.org/mesa/mesa/-/blob/24.0/src/intel/vulkan/anv_formats.c?ref_type=heads#L1239-1243Expected behavior
Per
VUID-VkPhysicalDeviceImageFormatInfo2-tiling-02249
:Valid Usage ID
Violation of
VUID-VkPhysicalDeviceImageFormatInfo2-tiling-02249
(unreported since the violation is in the validation layer itself)Additional context
GDB output
```sh hread 18 "QThread" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffbaa006c0 (LWP 16233)] anv_get_image_format_properties (physical_device=physical_device@entry=0x7fff78e44740, info=info@entry=0x7fffba9fe040, pImageFormatProperties=pImageFormatProperties@entry=0x7fffba9fe080, pYcbcrImageFormatProperties=0x0, from_wsi=false) at ../src/intel/vulkan/anv_formats.c:1243 Downloading source file /usr/src/debug/mesa-24.0.4-1.fc40.x86_64/redhat-linux-build/../src/intel/vulkan/anv_formats.c 1243 isl_mod_info = isl_drm_modifier_get_info(vk_mod_info->drmFormatModifier); (gdb) info locals vk_mod_info = 0x0 format_feature_flags =