dump-resources: execute each target draw once by resuming render passes - #3289
Merged
fabian-lunarg merged 14 commits intoSep 30, 2026
Merged
fabian-lunarg merged 14 commits into
fabian-lunarg merged 14 commits into
Conversation
fabian-lunarg
force-pushed
the
fabian_vdr_fix_secondary_accumulation
branch
from
September 22, 2026 09:34
f4bad7d to
eba1a76
Compare
panos-lunarg
requested changes
Sep 23, 2026
fabian-lunarg
force-pushed
the
fabian_vdr_fix_secondary_accumulation
branch
from
September 23, 2026 10:11
0d3f86b to
3e4c0ba
Compare
fabian-lunarg
force-pushed
the
fabian_vdr_fix_secondary_accumulation
branch
7 times, most recently
from
September 29, 2026 15:22
4610994 to
881ee17
Compare
panos-lunarg
left a comment
Contributor
There was a problem hiding this comment.
My comments have been addressed
panos-lunarg
approved these changes
Sep 30, 2026
- add DrawCallsDumpingContext::GetWorkCommandBuffers and a chaining_ flag, false for now - classify generated vkCmd* into state (vkCmdBind/Set/Push, minus events, checkpoints and INTEL performance markers) and work. -> state keeps the active range, work uses the new accessor - route draws, dispatches, trace rays, copies, blits, acceleration structure ops and vkCmdExecuteCommands without a secondary dumping context through the work accessor - stop recording query commands into draw-call clones. dispatch/trace-rays clone keeps them - drop ForEachDrawCallCommandBuffer, now obsolete
- record work commands into the current clone only and resume its render pass with LOAD - build a LOAD variant of each render pass clone, initialLayout taken from the original finalLayout - begin, next-subpass and end go to the clones whose window overlaps the pass - copy VkRenderingInfo with LOAD and STORE ops for a resumed dynamic-rendering instance - widen the revert barrier to the attachment read access and stages - override vkCmdEndRendering2KHR, vkCmdSetRenderingAttachmentLocations and vkCmdSetRenderingInputAttachmentIndices - chain only single-subpass primaries without secondaries
- decide chaining once for a primary and all its secondaries, after the clone counts are final - give a chaining secondary a tail clone for the work after its last target draw, closed at vkEndCommandBuffer - execute each secondary window into one primary clone, then the tail into the window that follows - drop the accumulator and the fan-out into the later primary clones - run a secondary without a dumping context in the current window only - treat an empty render pass range as a secondary that inherits the primary's pass
- key the LOAD render pass clones by the subpass a window resumes in and the one its target draw is in - load only the attachments a subpass up to the resume subpass uses, so a later clear still happens - take the resume subpass from the window's lower bound at begin time - chain multi-subpass render passes, rejecting only a malformed block range
- require a RenderPass index range to hold more than one entry - drop chaining_, IsChaining, IsChainable and every non-chaining branch - rename SetChaining to AppendTailClones, the one thing it still did
- give every context a tail clone for work after its last target draw - submit tail clones after windows, containing original signal semaphores - stop submitting original for a command buffer that dumps draws, transfer included - record queries into draw-call clones, now the only execution - resume a render pass in its last subpass for tail clone - record transfer dump snapshots into the clone taking work, not the original - signal potential application fences with empty submissions - trim/adjust comments
- replace GetWorkCommandBuffers with GetWorkCommandBuffer, return clone-CB - drop 'one-iteration loops' at callers, generator and generated code - stop dropping AS builds and copies while the first window records - add GFXRECON_ASSERT for slot index in GetCloneWindow
- pick last subpass for any window reaching past the render pass, not only tail-clones
…ubpasses - require a render pass range to hold subpass count + 1 entries - replace warning and its dead fallback with a fatal error naming both counts - NOTE: contains a tempory ref to test-suite repo (depends on a suite-PR) # Conflicts: # test_suite.ref # Conflicts: # test_suite.ref # Conflicts: # test_suite.ref
- explcitly include <ranges> for std::views::values - remove unused 'cmd_buf_idx' counters
- address replacer records an instance-address patch into dump clones that receive an AS-build - original command buffer is no longer submitted while dumpingi -> address-replace never ran and TLAS build faulted under -m rebind - dumper exposes clones taking a work command
- treat debug label and marker commands as state, as on dev - regenerate dump-resources code - bump test-suite ref (NOTE: still tmp commit until suite-PR merges)
- route reset, begin/end, timestamps, result copies and property writes through ForEachStateCommandBuffer - generator: fan out conditional rendering begin/end like state -> no clone ends a query or conditional block it did not begin
fabian-lunarg
force-pushed
the
fabian_vdr_fix_secondary_accumulation
branch
from
September 30, 2026 10:02
881ee17 to
ffc5bc2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR addresses the problem surfacing in #3013 :
vkCmdBeginRenderPassup to that draw, then submits it standalone.
-> for a pass with M target draws (i.e. draws to be dumped) that is O(M²) draws, independent of secondaries.
OverrideCmdExecuteCommandsnests it: the accumulator appends each secondary's full set (of already-cumulative clones)-> peak submission is O(S * M^2). e.g. (S=25 secondaries, M=1000 draws):
~12.5M draw re-executions in one submission, against ~25K when the targets are primary draws.
-> those very large submissions are suspected to trigger the
VK_ERROR_DEVICE_LOSTdetailed in VDR: VK_ERROR_DEVICE_LOST when dumping draws from secondary command buffers #3013.-> it explains why the failure scales with dump volume and why chunking the dump can avoid device-loss.
proposed solution:
-> a clone executes exactly the work in its window, plus the state needed to do so.
-> resumes the render pass it did not begin with
LOAD_OP_LOAD.-> each draw runs once, and each submission is one window.
also fixes #3258 :
-> confirmed with a constructed repro-case/capture: current dev reproduces the issue
-> fixed in this PR by construction. each draw is executed only once.
testing:
-> ci-suite reference got bumped