wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Renderdoc shows vulkan validation errors when capturing multiple sequential frames.

Open Elabajaba opened this issue 6 months ago • 2 comments

Description Depth attachments don't seem to always be getting set to the correct layout.

2 API High Miscellaneous 1303270965 Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = Command Buffer 399, name = (wgpu internal) Transit, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 2D Depth Attachment 241, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[1] command buffer VkCommandBuffer Command Buffer 399 expects VkImage 2D Depth Attachment 241 (subresource: aspectMask 0x2 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL.

Repro steps Launch the wgpu shadow example in renderdoc with the vulkan backend. Change the "Capture 1 Sequential Frame(s)" to some higher number (I've been using 5, but the error tends to pop up by the 2nd or 3rd capture), then run the capture. Open the captures and check the bottom left corner to see if it's erroring. image

Expected vs observed behavior Expected: No validation errors, observed: validation errors.

Platform wgpu 0.19 and trunk (tested: e2e9ef55474f32742bfdff3ccbac3b2cda4ebf85)

Windows 11, AMD 6800xt 24.1.1 drivers, Vulkan backend It has also been reproduced by someone else on an nvidia 4080, not sure what drivers.

Elabajaba avatar Jan 27 '24 21:01 Elabajaba

Does this happen without renderdoc attached? If not, this is likely a renderdoc problem. Similarly do we pass with synchronization validation enabled via the vk configurator?

cwfitzgerald avatar Jan 28 '24 01:01 cwfitzgerald

Perhaps related: #5253, which also raises UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout when run against a recent build of Vulkan-ValidationLayers.

jimblandy avatar Feb 14 '24 20:02 jimblandy