protonscr

Vulkan Validation errors with test_clear_depth_stencil_view

vkd3dclosed
HansKristian-Work/vkd3d-proton#2367 · opened 2025-03-03 by hakzsam · updated 2025-03-06 · 8 comments · github
Hhakzsam 2025-03-03 github
$ VKD3D_TEST_FILTER=test_clear_depth_stencil_view ./build/tests/d3d12
d3d12:676: Driver name: radv, driver info: Mesa 25.1.0-devel (git-99a7dc3fc4).
d3d12: ======== test_clear_depth_stencil_view begin ========
test_clear_depth_stencil_view:50: DSV descriptor handle increment size: 64.
VUID-VkCopyImageInfo2-srcImage-01548(ERROR / SPEC): msgNum: -1018313304 - Validation Error: [ VUID-VkCopyImageInfo2-srcImage-01548 ] Objects: VkCommandBuffer 0x5f788e5c6ec0, VkImage 0x8168780000000092, VkImage 0x8bada20000000098 | MessageID = 0xc34dc5a8
vkCmdCopyImage2(): pCopyImageInfo srcImage format (VK_FORMAT_D32_SFLOAT_S8_UINT) is not size-compatible with dstImage format (VK_FORMAT_R8_UINT). VK_FORMAT_D32_SFLOAT_S8_UINT is a depth/stencil and VK_FORMAT_R8_UINT is color (this is only allowed with a certain set of formats during image copy with VK_KHR_maintenance8).
The Vulkan spec states: If the VkFormat of each of srcImage and dstImage is not a multi-planar format, the VkFormat of each of srcImage and dstImage must be size-compatible (https://docs.vulkan.org/spec/latest/chapters/copies.html#VUID-VkCopyImageInfo2-srcImage-01548)
    Objects: 3
        [0] 0x5f788e5c6ec0, type: 6, name: NULL
        [1] 0x8168780000000092, type: 10, name: NULL
        [2] 0x8bada20000000098, type: 10, name: NULL
VUID-VkCopyImageInfo2-srcSubresource-10212(ERROR / SPEC): msgNum: 283535100 - Validation Error: [ VUID-VkCopyImageInfo2-srcSubresource-10212 ] Objects: VkCommandBuffer 0x5f788e5c6ec0, VkImage 0x8168780000000092, VkImage 0x8bada20000000098 | MessageID = 0x10e666fc
vkCmdCopyImage2(): pCopyImageInfo->pRegions[0].dstSubresource.aspectMask is VK_IMAGE_ASPECT_COLOR_BIT and srcSubresource.aspectMask is (VK_IMAGE_ASPECT_COLOR_BIT), but the src depth/stencil format (VK_FORMAT_D32_SFLOAT_S8_UINT) is not compatible with the dst color format (VK_FORMAT_R8_UINT).
The Vulkan spec states: If srcSubresource.aspectMask is VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT and dstSubresource.aspectMask is VK_IMAGE_ASPECT_COLOR_BIT, then the VkFormat values of srcImage and dstImage must be compatible according to the list of compatible depth-stencil and color formats (https://docs.vulkan.org/spec/latest/chapters/copies.html#VUID-VkCopyImageInfo2-srcSubresource-10212)
    Objects: 3
        [0] 0x5f788e5c6ec0, type: 6, name: NULL
        [1] 0x8168780000000092, type: 10, name: NULL
        [2] 0x8bada20000000098, type: 10, name: NULL
d3d12: ======== test_clear_depth_stencil_view end ==========
d3d12: 100 tests executed (0 failures, 0 successful todo, 0 skipped, 0 todo, 0 bugs).

Tested with VVL (8496ed502).

Ddoitsujin maintainer 2025-03-03 github

Isn't this precisely the case that's supposed to be allowed with maintenance8? VK_FORMAT_D32_SFLOAT_S8_UINT is explicitly listed to be size_compatible with R8_UINT for the stencil aspect.

The second validation message seems a bit bogus too, I verified that we correctly set srcSubresource.aspectMask to STENCIL_BIT.

Zzmike maintainer 2025-03-03 github

This was possibly generated with an antique version of VVL.

Ddoitsujin maintainer 2025-03-03 github

Well it explicitly mentions maintenance8 and I can repro locally (and predictably, disabling maint8 also silences the error since we correctly fall back to the renderpass path), but this smells like a VVL bug specifically with stencil aspects or something.

Hhakzsam 2025-03-03 github

Could definitely be a VVL bug yeah.

Hhakzsam 2025-03-05 github

Have you reported the VVL issue already?

Ddoitsujin maintainer 2025-03-05 github

No, busy working on dxvk things right now.

Hhakzsam 2025-03-06 github

Fixed in VVL.