GPU: drop a draw whose table found no dynamic slots; more dynamic slots #134
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!134
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/134/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?
@gmehru on GitHub · 2026-11-24 00:50 UTC · original
gmehru:fix/dynamic-slot-exhaustion→main· +15 −2 · 2 files · 1 commits · closed without mergingProblem
With indirect execution on (
35b054e), the world ends on a host GPU page fault at a low address within a minute:In both runs where I saw it, this warning came about one second earlier:
The world's frames bind thousands of tables that hold constant buffers, each made afresh in the dynamic slots, and the 65,536 slots of a view heap run out. When
HostHeap::dynamicreturnsNone,State::tablesskips the table but the draw still runs.bindthen gives the shader the title's own table offset, so it indexes the title's slots for that table, which hold whatever was mirrored there and not what the shader expects.Change
draw.rs: a draw, mesh dispatch, dispatch or indirect execution whose bind could not make a table is dropped instead of executed. It is counted with the other dropped draws.descriptor/host.rs: dynamic slots per view heap go from 2^16 to 2^19, so the world's frames fit and those draws are not dropped in practice.Testing
One machine: Windows 11, AMD RX 9070, diagnostics build with
VICTORY_D3D12_DEBUG=1andVICTORY_D3D12_DRED=1.35b054e35b054e+ this changeNot tested in the game on current
main: there the change applies cleanly andcargo build --profile diag -p victory --features diagnosticssucceeds. Thevictory-gpudescriptor tests pass on35b054ewith the change. Onmainat9aef3d9thevictory-gputest target did not compile for me (mod testsis defined twice inhost.rs), which this change does not touch.Notes for review
DYNAMIChas a cost on a host that caps view heaps at 1,000,000 views: fewer slots mirror the title's (475,712 instead of 934,464), so more tables go through the dynamic slots there. I have no NVIDIA card to measure it. Dropping the draw is the part that fixes the fault; the size is yours to set.🤖 Generated with Claude Code
@DaviTostes on GitHub · 2026-11-24 00:53 UTC · original
The test build does not compile, so nothing in this PR can be exercised yet:
The library itself builds (
cargo xwin build -p victory-gpuis fine); onlycargo test/--workspacefails, on every platform. It looks like the new test module was appended after main gained one inhost.rs(the adapter tests); the new tests need to live in the existingmod tests.Once that is fixed I can run the GPU suite under Wine + vkd3d-proton as with the other PRs.
No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
@DaviTostes on GitHub · 2026-11-24 01:05 UTC · original
Re-checked the new head
6d8d197(after the force-push from7831e92): still the same E0428, unchanged:So the test target still does not compile and the GPU suite cannot run. Moving the new tests into the existing
mod testsis the blocker.No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
@Sunkiller-qc on GitHub · 2026-11-24 01:05 UTC · original
Raising
DYNAMICto1 << 19(crates/victory-gpu/src/descriptor/host.rs:65) also changes the capped path athost.rs:94: on NVIDIA, where the view heap is capped atPORTABLE_VIEWS, the title keeps1_000_000 - 524_288 = 475_712slots instead of934_464today. A title heap that fit before then loses about half of its slots on the cards from #11/#16.#135 makes the same change but keeps
DYNAMIC_CAPPED = 1 << 16for the capped heap, and it also drops the draw when no dynamic slots are left. The two conflict, so it may be simpler to continue in #135, or to add a capped value here.Static review, not built or run.
@gmehru on GitHub · 2026-11-24 02:01 UTC · original
Closing this in favour of #135, which makes the same two changes, keeps the smaller reserve when the host caps the view heap (the NVIDIA concern raised above), and also defers releasing replaced host resources.
On the test build: the
E0428reported above came frommain, not from this PR, which adds no tests.mod testswas defined twice insrc/host.rsat9aef3d9, as the description says, and #129 has since fixed it. Onmainatd2a4baewith this change applied,cargo test -p victory-gpupasses (43 passed, 1 ignored).Runs on
mainatd2a4bae, in case they help with #135. One machine: Windows 11, AMD RX 9070, diagnostics build withVICTORY_D3D12_DEBUG=1andVICTORY_D3D12_DRED=1.d2a4baeno free dynamic descriptor slots: a table is not maded2a4bae+ this PRd2a4bae+ this PR + released host textures kept 4 more frames (a local experiment, the same idea as the deferral in #135)DispatchMeshA second run of the last build, which skipped the intro and reached a heavier scene, ended the same way after one submission took 4.0 s. In both, the GPU had been taking 60 to 70 ms per frame until that submission, so it looks like one mesh dispatch running away rather than a slow frame. That is the failure left on this machine once the slots and the freed textures are dealt with.
No game data used. AI-assisted.
@miniongk on GitHub · 2026-11-24 02:09 UTC · original
Tested head
6d8d197rebased ontod2a4baeon Windows 11 26300, RTX 5080, driver 621.24, local 1.0.2.1 copy. Theno free dynamic descriptor slotswarning no longer appeared, but the world still removed the host device withDXGI_ERROR_DEVICE_HUNGduring a mesh/indirect submission. This patch is not sufficient for #97 on NVIDIA. Menus and first-boot rendering remained stable. AI-assisted (Kimi Code).Pull request closed