Repository navigation
GPU: bind a sampler heap of our own when the title binds none - #1778
Conversation
VIctory V2: community PRs, merged and testedOpen PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: Unofficial community fork of Marvisak/VIctory, GPL-3.0. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (70564ae, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-gpu— all 77 passing tests (includinga_list_without_a_sampler_heap_gets_ours) pass on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(0 new failures; the 2HEAP_VIEWSfailures reproduce identically on untouchedorigin/main70564aeon RTX 5090)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok
Clean fallback sampler heap binding when a title command list binds none. Looks good.
AI-assisted (Gemini 4 Neon).
|
A data point for this one: on an RTX 3050 6 GB Laptop (driver 32.0.16.2124), Not tested: this PR's own commit ( AI use: Claude Code (Claude Opus 5.5) ran the build and wrote this; the results are from the runs described. |
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Bind a sampler heap of our own when the title binds none: avoids the null-heap D3D12 validation error. Small, defensive.
|
That matches my own numbers on the other card, and it is why the pull request is about the rule rather than the removal Your data point is the second independent confirmation of the same thing, and it agrees with what I measured here: on this machine's integrated AMD a run of What the layer does say on my machine once 599 is out of the way is id 1419 twice, and then the device goes again — which is the case this pull request fixes. The chain and the per-build table are in #1754 (comment):
So: yes, 1419 is worth fixing on its own, and this pull request does exactly that and nothing more — it does not claim to fix #1754 alone, and I have said so in the body and in that comment. If #1763 is what gets your card past the frame, that is the one that should go first, and this one after it for the lists that set a directly-indexed sampler signature with no sampler heap bound. One correction to my own earlier report, since you mention the commit: the branch now carries Written with an AI assistant. |
1fae1cc to
2b17cc5
Compare
Every root signature we make declares SAMPLER_HEAP_DIRECTLY_INDEXED, and a list must have a sampler heap bound before such a signature is set (the debug layer's id 1419, and NVIDIA removes the device with INVALID_CALL for it: Marvisak#1754). bind_heaps only ever bound the heaps the title bound, plus our view-heap fallback for the case the title binds none, so a compute list that reads views and no samplers -- the list in that report -- set the signature with no sampler heap bound at all. There is now a sampler heap of ours, made on first use with a point sampler in slot 0, bound whenever the title binds no sampler heap; the decision is a small function with a test, so which heaps a list must have can be read without a device.
2b17cc5 to
ba67548
Compare
|
Automated triage for the maintainers. Merge candidate. Every host root signature sets Nit: the new CI: Generated by Claude Code |
Port of uwutaube/VIctory 217229460, a port of Marvisak/VIctory#1778 by fiestorra. Every root signature this runtime builds declares both directly-indexed heap flags unconditionally, and D3D12 requires a heap of each kind to be bound before such a signature is set. The debug layer states it as id 1419, and NVIDIA removes the device with DXGI_ERROR_INVALID_CALL for it (upstream #1754). What we bound was only ever the title's heaps, so a list that binds a view heap and no sampler heap — a compute list that reads views — set the signature with no sampler heap bound at all. A sampler heap of ours is now made on first use, with a point sampler in slot 0 so an indexed read returns something defined rather than whatever the memory held, and bound whenever the title binds no sampler heap, before the signature is set. The choice is a named function (`wants_our_samplers`) so it is tested without a device. `VICTORY_SAMPLER_HEAP=0` leaves it as it was. Co-authored-by: uwutaube <81832919+uwutaube@users.noreply.github.com> Co-authored-by: Ivan <65175643+fiestorra@users.noreply.github.com>
host_state_lost marked host_heaps [usize::MAX; 2], but a list that binds no heaps and reads title memory wants [MEMORY_HEAP, SAMPLERS_OURS] — the same pair. After a cut or an external record, bind_heaps found them equal and bound nothing; the next directly-indexing root signature ran with no heaps, the device removal Marvisak#1778 was written to prevent. None now marks the lost state: it equals no pair wanted can make, so the next bind_heaps binds again. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Marvisak#1778 made the sampler heap we bind when the title binds none SAMPLERS_OURS = usize::MAX. Our view heap for title memory, MEMORY_HEAP (memory::OURS), is usize::MAX too, and host_state_lost marks the host list's heaps unknown with [usize::MAX; 2]. A draw or dispatch that wants both of ours (the title binds no heap, its shaders use title memory or root views) then wants exactly that marker, so bind_heaps found nothing to change: after a cut at a Wait32/64BitValueX the new host list starts with no heaps and none were set before the root signature, which indexes both directly (SetDescriptorHeaps must come first: the debug layer's 1419, INVALID_CALL on NVIDIA); after external::record the heaps of the other recorder stayed bound. Before Marvisak#1778 such a list wanted [usize::MAX, 0]. SAMPLERS_OURS is now usize::MAX - 1, which neither a title heap nor the marker takes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every root signature we make indexes both heaps directly (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED), and the SM 6.6 spec has SetDescriptorHeaps pass "the corresponding heaps" before such a signature is set. Marvisak#1778 made bind_heaps bind a sampler heap of ours when the title binds none, but the view half still bound ours only when the shaders read title memory or root views: a list with no view heap whose shaders read only constants set the signature with no view heap bound (State::wanted([0, 0], false) == [0, SAMPLERS_OURS]). Such a list now gets our view heap (crate::memory::heap) as well, which root views and the write-mark table already use when the title binds none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…GAP + card_before runs, merge_under_writes prepass + batched dirty, reaper reset, WHY_READ diag, fallback_samplers Marvisak#1778, alias Marvisak#1241, VICTORY_STAGING_POOL
A sampler heap of our own for the lists that have none: the id 1419 error in #1754
Every root signature this runtime builds declares both directly-indexed heap flags, unconditionally (
crates/victory-gpu/src/pipeline/host.rs):D3D12 requires a heap of each kind to be bound before such a signature is set. The debug layer states it as id 1419, and NVIDIA removes the device with
DXGI_ERROR_INVALID_CALLfor it — which is the removal described in #1754.What we bound was only ever the title's heaps, plus a view-heap fallback of our own (
MEMORY_HEAP) for the case the title binds no views:So a list that binds a view heap and no sampler heap — a compute list that reads views, exactly the one that report caught — set the signature with no sampler heap bound at all.
The change
descriptor::fallback_samplers).bind_heapsbinds it whenever the title binds no sampler heap, before the signature is set, and logsthe title binds no sampler heap: binding oursat debug when that happens (once per heap change).Verification
draw::tests::a_list_without_a_sampler_heap_gets_ours: title binds both → nothing of ours; views only → our sampler heap; neither → ours of both kinds; a title sampler heap stays whatever the views are.cargo test -p victory-gpu --locked→ 78 passed, 1 ignored.cargo clippy --workspace --all-targets --locked -- -D warningsand with--all-features→ clean.rustfmt --check:draw.rs59 hunks,descriptor/host.rs33,descriptor.rs35 — the same counts asmain, so the lines added here are formatted and the pre-existing ones are untouched.cargo test --workspace --locked: one failure,modules::display::tests::sdr_and_display_deferrals, whichmainhas too in a headless session (the display stack answersE_NOT_SUPPORTED); fixed by GPU: adapter choice and logging, presenter backoff, a texture-description ladder, and a display-deferral test a headless session can pass #1630, unrelated.What this does not do, and what I could not test
Whoever can run it: with the debug layer on, the run should no longer show id 1419, and
VICTORY_LOG=victory_gpu=debugwill showthe title binds no sampler heap: binding oursat the point the list would have broken the rule.No game data is involved: code, descriptor types and a sentinel value only.
Written with an AI assistant.