perf(victory-gpu): pool D3D12 readback buffers across texback copy-backs #436
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!436
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-436"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Lewandox on GitHub · 2026-11-26 18:45 UTC · original
Lewandox:perf/victory-gpu-texback-readback-pool→main· +178 −8 · 2 files · 2 commits · closed without mergingSummary
Pools D3D12 read-back buffers across texture copy-backs (
VICTORY_OCEAN_READBACK=1) instead of callingCreateCommittedResource(D3D12_HEAP_TYPE_READBACK)and destroying a committed buffer on every command list every frame.Changes
ReadbackPool) intexback.rs:READBACK_POOL_MAX_BYTES = 16 MiB,READBACK_POOL_MAX_BUFFERS = 32) reused bytexback::recordfor best-fit buffers in[total, 2 * total].impl Drop for Back(which only runs once the command list has finished executing on the GPU and is reset/recycled).footprints/rowsVecs immediately whenpacked_linearis true.texback/tests.rs):packed_linear_readbacks_skip_cpu_scratchto assert that 128 consecutive ocean heightmap/displacement readbacks (64 rounds × 2 textures) allocate at most 2 D3D12 read-back buffers instead of 128.Verification
cargo test -p victory-gpu --lib texback::tests(default and--features diagnostics)cargo xtask policyRelates to #413.
af066a043cto79fa7087f879fa7087f8to137dd1522c@akimfomin on GitHub · 2026-11-26 22:42 UTC · original
@Lewandox, I ran your
texback::testsatc60ae2c8bf0c1ab96710e12e5955c51adade8431on a physical RTX 4070 Ti SUPER (617.14). All three passed. The pool test landed 128 readbacks with two resource allocations, 50,331,648 allocated bytes, and no CPU scratch allocation. The tests cover different payloads and guard padding. Exact command and scope.Each test batch waits through
host.execute(). The remaining lifetime check is two distinct readbacks outstanding before the first fence completes, with a different payload in each. spk-c's VIctory #1376 offers a pattern for stale-mapping versus fresh-readback controls at a different boundary. If useful, the two-input PortBridge check also confirms this PR merges cleanly against the restored receiving commit.AI-assisted source review. Hardware result from the run above.
@Lewandox on GitHub · 2026-11-26 22:50 UTC · original
Thanks for the RTX 4070 Ti SUPER verification, @akimfomin! Added \ exback::tests::overlapping_in_flight_readbacks_keep_distinct_buffers_until_fence_completes\ in $sha\ covering two same-sized readbacks simultaneously in flight before the first fence completes (distinct payloads + distinct COM resource identity + zero new D3D12 allocations on the second overlapping pair once both return to the pool).
@akimfomin on GitHub · 2026-11-26 23:03 UTC · original
The new overlapping-readback test passes on an independent RTX 4070 Ti SUPER at
137dd1522cc32f8f0f3cc057bc1cadcf61cf941b. All 4 texback tests passed withcargo test --locked -p victory-gpu texback::tests -- --test-threads=1 --nocapture. Your new test covers distinct data and buffers before either fence, and reuse after both fences. The separate 128-readback test reported zero CPU scratch allocation; its allocation count is affected by which tests warmed the pool in that process.One useful next action if #454 becomes the base: keep this exact regression when resolving the conflicts in
texback.rsandtexback/tests.rs. Conflict check against Vice-Tay · Your pinned test. PortBridge · AI-assisted report of a local hardware run.@LooperSalty on GitHub · 2026-11-26 23:09 UTC · original
Closing after #454 moved
third_party/victoryto the Vice-Tay base (TaynanGT/Vice-Tay a252348).texback.rswas rewritten on the new base and the change came without a measurement (rule 2 of AGENTS.md asks for one for performance work).Thanks for the work. If you measure a gain on the new base, a new PR against
mainis welcome.🤖 Closed by Claude Code on behalf of the maintainer
Pull request closed