GPU: fresh descriptor tables take only their used range (port of upstream #1349) #218
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!218
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/218/head"
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?
@m335671 on GitHub · 2026-11-24 22:39 UTC · original
m335671:port/trim-fresh-tables→main· +77 −19 · 1 files · 1 commits · closed without mergingSummary
A fresh descriptor table took dynamic slots for entries
0..=last used. A draw that reads entries 120..=123 of a table therefore held 124 slots. On a capped NVIDIA view heap (2^18 dynamic slots), heavy scenes asked for more than the pool holds:The indirect draws behind those tables were then dropped (
indirect kind 0/2: prepare failed, about 190 + 120–285 per frame) until the scene got lighter. In the prologue that shows as floors and walls disappearing a few minutes in.This ports the table trimming of upstream Marvisak/VIctory#1349 (wrothgaril). The 2^18 reservation part of that PR is already in this fork. The port is adapted to this fork's picked indices (
selected).Changes
crates/victory-gpu/src/draw.rs:fresh_table_range: a fresh table spans from its first used entry or picked index to its last, instead of from entry 0.base = first - start), so entrykstill lies atbase + kand the translated shaders'(user_data + offset) >> 5lands on the slots taken.startis clamped to the mirrored count, sobasestays whole.start..endis made, and the title-slot bookkeeping (texture_slot_tabled,mirror) covers only that range.fresh_tables_take_their_used_range: used entries, picked indices on either side, no entry, and the clamp.trimmed_tables_index_the_slots_they_take: on a real host heap, entries 120 and 123 land onfirstandfirst + 3, and the next table starts atfirst + 4(returns early without a GPU).Verification
2119b0e.cargo clippy --workspace --all-targets --locked -- -D warningsand with--all-features: 0 warnings.cargo test --workspace --locked: 498 passed, 0 failed, 7 ignored (both new tests included).cargo xtask policy: 169 files ok.VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024, warm pipeline library, diagnostics builds; counts only):dynamic slots: … refused(sum of samples)no free dynamic descriptor slotsindirect … prepare failed90228a7+ #77 + #51 + #81):An earlier run without the change (on
1684989+ #77) had the room's walls at first, before the pool ran out. So walls are missing much more often without it, not always.I could not compare one fixed frame:
VICTORY_CAPTURE_FRAMESframe numbers fall at different moments from run to run, because loading time varies.Not tested / caveats
a table entry without a viewand no new warning in these runs.AI use: Claude Code (Claude Opus 5.5) found the starvation in the diagnostics logs, ported and adapted the change, wrote the tests, ran the checks and the title on my machine, and wrote this description.
🤖 Generated with Claude Code
A fresh table took dynamic slots for entries 0..=last used, so a draw that reads entries 120..=123 held 124 slots. In heavy scenes on a capped NVIDIA view heap (2^18 dynamic slots) the frame then asked for more than the pool holds, tables were refused ("no free dynamic descriptor slots"), and the indirect draws behind them were dropped until the scene got lighter. A fresh table now takes from its first used entry or picked index to its last, and its virtual slot 0 is moved back by that start, so entry k still lies at base + k. The start is clamped to the mirrored count so base stays whole. After upstream VIctory PR #1349 by wrothgaril, adapted to this fork's picked indices. Co-Authored-By: Claude Opus 5.5 <[email protected]>@m335671 on GitHub · 2026-11-25 06:59 UTC · original
Rebased onto
main8dd30ab(nowfa5ec43). The only conflict was the end ofdraw.rs, wheremainaddeddepth_bounds(#82) at the same place as this PR's helper and tests. Both are kept. The loop over the table keepstitle + kfor the picked-index texture slots added ina803c87, withkinstart..end.cargo test -p victory-gpu --release: 133 passed, 0 failed, 3 ignored (the two tests of this PR included).cargo clippy -p victory-gpu: no new warning.A data point against the need for it: one run of
8dd30abwithout this PR (RTX 4070, diagnostics build, ~7 minutes to the first gameplay room) had0 refuseddynamic slots (11,277 tables asked per sample), and the walls were there. Before, the refusals started some minutes into a run, so a run this short does not show whethermainstill needs the trim. I'll post a longer run when I have one.AI use: Claude Code (Claude Opus 5.5) did the rebase and ran the tests and the run on my machine, and wrote this comment.
@m335671 on GitHub · 2026-11-25 10:19 UTC · original
A/B on
main8dd30ab, RTX 4070, diagnostics build, the first gameplay room, 20 minutes each: without this PR, 207 samples and 0 refused dynamic slots. With it, 216 samples and 0 refused. The walls were there in both, at 1.8 against 1.9 fps. The overflow this PR fixed on2119b0eno longer happens onmainhere, so I'm closing it. If refusals come back in a heavier scene, it can be reopened.AI use: Claude Code (Claude Opus 5.5) ran the A/B on my machine and wrote this comment.
Pull request closed