protonscr

Guardians of the Galaxy: Missing init barriers

vkd3dclosed
HansKristian-Work/vkd3d-proton#2768 · opened 2025-12-23 by K0bin · updated 2026-01-06 · 4 comments · github
KK0bin 2025-12-23 github

When running Guardians of the Galaxy with validation layers, I get the following validation errors on launch (even before the menu):

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f63202772b0 expects VkImage 0x83d000000083d (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f63202772b0
    [1] VkImage 0x83d000000083d

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f63202772b0 expects VkImage 0x8400000000840 (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f63202772b0
    [1] VkImage 0x8400000000840

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f6320406c30 expects VkImage 0x83d000000083d (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f6320406c30
    [1] VkImage 0x83d000000083d

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f6320243c40 expects VkImage 0x8400000000840 (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f6320243c40
    [1] VkImage 0x8400000000840

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f63202772b0 expects VkImage 0x83d000000083d (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f63202772b0
    [1] VkImage 0x83d000000083d

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f6320406c30 expects VkImage 0x8400000000840 (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f6320406c30
    [1] VkImage 0x8400000000840

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f6320243c40 expects VkImage 0x83d000000083d (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f6320243c40
    [1] VkImage 0x83d000000083d

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f63202772b0 expects VkImage 0x8400000000840 (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f63202772b0
    [1] VkImage 0x8400000000840

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f6320406c30 expects VkImage 0x83d000000083d (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f6320406c30
    [1] VkImage 0x83d000000083d

Validation Error: [ VUID-vkCmdDraw-None-09600 ] | MessageID = 0x46582f7b
(Warning - This VUID has now been reported 10 times, which is the duplicate_message_limit value, this will be the last time reporting it).
vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x7f6320243c40 expects VkImage 0x8400000000840 (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_GENERAL.
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://docs.vulkan.org/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
Objects: 2
    [0] VkCommandBuffer 0x7f6320243c40
    [1] VkImage 0x8400000000840

The interesting thing is they only show up, if d3d12_device_supports_unified_layouts returns false.
I am able to reproduce the issue with 2.14.1, so it's not a regression caused by the KHR_unified_layouts changes. I was also able to narrow it down further: returning true in d3d12_device_supports_unified_layouts but assigning GENERAL as the common layout and the matching flag for every texture regardless as if it was supported already makes the validation errors disappear. So it's not fixed by the changes to the copy code because in that case it should still take the old code paths.

I can't really see how commonLayout = VK_IMAGE_LAYOUT_GENERAL or flags |= VKD3D_RESOURCE_GENERAL_LAYOUT would impact the initialization barrier. If anything there should be more barriers with the non-unified-layout copy code.

I'm opening this more as a reminder than anything else.

KK0bin 2025-12-24 github

This very much appears to be a game bug. The problematic resources are placed resources so force_initial_transition works around it.

I still don't understand why it doesn't happen with the flag VKD3D_RESOURCE_GENERAL_LAYOUT.

Sshelterx 2025-12-24 github

@K0bin Also check out https://github.com/HansKristian-Work/vkd3d-proton/issues/1216 if you haven't already.

KK0bin 2025-12-24 github

@shelterx Yeah my other PR preconfigures vkd3d-Proton so the game works on Nvidia GPU with DLSS out of the box.

HHansKristian-Work maintainer 2026-01-05 github

Those errors point to a game bug where it stays in UAV layout, but uses it as SRV. Don't think it has anything to do with initial transitions.

Launch options

Upstream links