gpu: compact empty indirect records in device-local clamp #998
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!998
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-998"
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?
@UnkwnDev on GitHub · 2026-11-25 15:31 UTC · original
UnkwnDev:arc-indirect-compaction-vf→main· +1577 −417 · 2 files · 1 commits · openSummary
Rebased onto
0b0074e, preservingMOST_DRAW(1 << 23) filtering,groupsharedsingle-atomic budget charging and mesh diagnostics, persistentINDIRECT_ARGUMENTscratch state across draws (nodone()barrier), andwindow_check/drvwatch::tripped()indraw.rs.For non-windowed multi-record
ExecuteIndirectcalls (records > 1), empty/zero-cost and budget-zeroed records are compacted out on the GPU inside the device-local scratch buffer in exact submission order, writing the compacted command count into the scratch buffer soExecuteIndirectskips zero-work slots instead of wasting command-processor overhead on thousands of empty records.Changes
crates/victory-gpu/src/indirect.rs:Bounded { buffer, count }returned bybound()when multi-record compaction (records > 1) writes a compacted count offset inside the scratch buffer.compact_single(<= 256 records) and multi-tile hierarchicalgroupsharedprefix scan passes (compact_pass1,scan_tiles,add_offsets,compact_scatter) with no cross-workgroup spin loops.groupsharedsingle-atomic budget charging and mesh diagnostics (charge_group) acrossmain,compact_single, andcompact_pass1, preservingMOST_DRAWandaheadhandling.bound_ahead()uncompacted (in_slot) so cachedWindowdraws continue indexingWindow::scratchdirectly, and keptmake_from()single-entry compatible withCHECK_SOURCEandbench::OLD_SOURCE.indirect_state/indirect_readable) withoutdone().count = 0/ all-empty batches, budget exhaustion,MOST_DRAW, andbound_aheadvsbound.crates/victory-gpu/src/draw.rs:Some(&bounded)andcompacted_counttoExecuteIndirectwhenbound()compacts, while keepingbound_ahead()uncompacted for cached windows.Verification
VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --features diagnostics --lib indirect -- --test-threads=1: 18 passed, 0 failed, 2 ignored (bare_cost,bench).cargo test -p victory-gpu --lib -- --test-threads=1: 175 passed, 0 failed, 5 ignored.cargo test -p xtask --locked: 4 passed, 0 failed.cargo clippy --workspace --all-targets --all-features --locked: 0 warnings in modified code (3 pre-existing warnings indraw.rs:2406,shadow.rs:2675, andindirect.rs:3297from0b0074e).AI-assisted implementation and testing.
@UwUCammie on GitHub · 2026-11-25 16:59 UTC · original
Tested on RX 7900 XT (CachyOS Linux, Wine 11.22 + vkd3d-proton + RADV) stacked with #997 across multiple 480–540 s gameplay runs (to frame 4600,
VICTORY_RELAY=2+VICTORY_INDIRECT_WINDOW=1). No visual glitches, 0 device removals, and GPU time for all title lists is down around ~48 ms/frame.@UnkwnDev on GitHub · 2026-11-25 17:17 UTC · original
@UwUCammie Thanks for the extended multi-pass verification with the stacked compaction and coalescing branches on RADV/Wine. Great to see the combination running cleanly with 0 device removals.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.