Skip to content

replay / virtual swapchain: Fix two VVL issues#3066

Merged
fabian-lunarg merged 3 commits into
LunarG:devfrom
fabian-lunarg:fabian_swapchain_vvl_issues
Jul 9, 2026
Merged

replay / virtual swapchain: Fix two VVL issues#3066
fabian-lunarg merged 3 commits into
LunarG:devfrom
fabian-lunarg:fabian_swapchain_vvl_issues

Conversation

@fabian-lunarg

Copy link
Copy Markdown
Contributor

when replaying a capture using VVL via the --validate option I'm seeing issues that are not present
in the captured application.

per swapchain-image (3x in my case)

[gfxrecon] ERROR - DEBUG MESSENGER: Frame #1: UNASSIGNED-non-acquired-swapchain-image-used: vkQueueSubmit(): pSubmits[0] performs a layout transition on presentable VkImage 0x18b000000018b, but the image has not been acquired from VkSwapchainKHR 0x18a000000018a (either never or since the last present operation).
The Vulkan spec states: Use of a presentable image must occur only after the image is returned by vkAcquireNextImageKHR, and before it is released by vkQueuePresentKHR. This includes transitioning the image layout and rendering commands (https://docs.vulkan.org/refpages/latest/refpages/source/VkSwapchainKHR.html#_description)

and in addition for trimmed captures, also multiple times:

[gfxrecon] ERROR - DEBUG MESSENGER: Frame #1: VUID-vkCmdDraw-None-09600: vkQueueSubmit2(): pSubmits[0] command buffer VkCommandBuffer 0x2faaef20 expects VkImage 0x1950000000195 (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
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://vulkan.lunarg.com/doc/view/1.4.350.0/linux/antora/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)

both errors are coming from our virtual swapchain and are fixed in this PR.

@fabian-lunarg fabian-lunarg self-assigned this Jul 6, 2026
@fabian-lunarg
fabian-lunarg requested a review from a team as a code owner July 6, 2026 11:50
@fabian-lunarg fabian-lunarg added bug Something isn't working approved-to-run-ci Can run CI check on internal LunarG machines labels Jul 6, 2026
@fabian-lunarg
fabian-lunarg force-pushed the fabian_swapchain_vvl_issues branch from 0d6adc3 to 65f4ff1 Compare July 6, 2026 12:10
Comment thread framework/decode/vulkan_virtual_swapchain.cpp Outdated

@panos-lunarg panos-lunarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from a minor comment looks good

- initial transition removed, per-image transition on first acquire
- wait + re-signal acquire semaphore, or wait acquire fence
- gate on acquire success, keep VK_SUBOPTIMAL_KHR
- drop unused deferred_alloc
- fix copy_queue_family_index_ for graphics-queue path
…tate load

- implement ProcessSetSwapchainImageStateCommand (was empty stub)
- transition virtual images UNDEFINED -> captured layout in one injected submit
- skip UNDEFINED entries and unrecognized image IDs
- fixes VUID-vkCmdDraw-None-09600 on first use after trim load
… vulkan_temporary_objects.h/.cpp

- add CreateAndBegin(queue_family_index) overload
- use GetDeviceQueue2-aware queue retrieval, check EndCommandBuffer/QueueSubmit results
- use TemporaryCommandBuffer in ProcessSetSwapchainImageStateCommand
@fabian-lunarg
fabian-lunarg force-pushed the fabian_swapchain_vvl_issues branch from 65f4ff1 to 074cb2f Compare July 7, 2026 16:42
@fabian-lunarg
fabian-lunarg enabled auto-merge July 7, 2026 16:50
Comment thread framework/decode/vulkan_temporary_objects.h
@fabian-lunarg
fabian-lunarg added this pull request to the merge queue Jul 8, 2026
Merged via the queue into LunarG:dev with commit 3b391f0 Jul 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-to-run-ci Can run CI check on internal LunarG machines bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants