GPU: fall back to memory view heap for VIEW_STRIDES when no title heap is bound #3186
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!3186
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3186"
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?
@reeledMarek on GitHub · 2026-11-26 11:28 UTC · original
reeledMarek:fix/gpu-view-strides-memory-heap→main· +49 −11 · 1 files · 1 commits · openSummary
crates/victory-gpu/src/draw.rs,State::bindalready falls back tocrate::memory::heap()whenself.heaps[0] == 0forp.marksandState::root_view, and binds it viabind_heapswhenmemory_heapis true.VIEW_STRIDESonly checked(self.heaps[0] != 0).then(...), dropping draws/dispatches with"view strides without a view heap"even whencrate::memory::heap()(which allocates its ownstridestable) is bound as the active view heap.State::active_view_heap()(matchingp.marksandroot_view), used it for bothp.marksandVIEW_STRIDES, and includedVIEW_STRIDESstages inmemory_heapso the fallback view heap is bound before setting the root signature.Testing
view_strides_falls_back_to_memory_heap_when_no_title_heap_is_boundincrates/victory-gpu/src/draw.rs.cargo test -p xtask --lockedpasses.@oni-swr on GitHub · 2026-11-26 11:42 UTC · original
WARP verification of #3186 at
1aff290e6442899538cc522a317c96195712ad8d(software adapter only, no physical GPU; claimed in #1633).Environment: Windows 11 Pro 10.0.26200; WARP
D3D10Warp.dll10.0.26100.9818; Windows SDK 10.0.26100.0dxil.dll1.8.2502.11 /dxc.exe1.8.2502.11 (VICTORY_DXILset to it); rustc viarust-toolchain.toml(1.98.1);VICTORY_D3D12_WARP=1;CARGO_TARGET_DIRoutside the repo.Commands (head and merge-base
63bcca43, which is currentmain):cargo test -p victory-gpu --lib --locked -j 4 -- --test-threads=1cargo test -p victory-gpu --lib --locked -j 4 view_strides_falls_back -- --test-threads=163bcca43)1aff290e)draw::tests::view_strides_falls_back_to_memory_heap_when_no_title_heap_is_boundpasses on head. The test returns early whenmemory::heap()isNone, so I checked that on WARP it does not: with that early return temporarily turned into a panic, the test still passed. Theactive_view_heap()andstrides().is_some()assertions therefore run on the software adapter.Revert check (limited): I reverted only the two call-site changes (the
VIEW_STRIDESlookup in the dispatch path and thehas_view_stridesterm in thememory_heapcondition) and kept the test. The test still passes. It exerciseshas_view_strides,State::wantedandactive_view_heap, not the two call sites, so it would not catch a regression of either one. A test through the dispatch path would be needed for that. This is a coverage note, not a failure of the PR.Defects: none found. When
heaps[0] == 0the newactive_view_heap()returns the same heap as the previousp.marksmatch (memory::heap()); with a bound title heap it returns that heap's host side as before. Thememory_heapcondition now also binds the fallback heap for stages that only useVIEW_STRIDES, so the lookup can no longer hit an unbound heap in that case.AI use: Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5). No game files, dumps, shader names or hashes were used.
@Dukestar69 on GitHub · 2026-11-26 12:08 UTC · original · approved these changes
Verified on RTX 5090 & WARP against
origin/main(63bcca4):cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 21/21 passed on RTX 5090 and WARP (includingview_strides_falls_back_to_memory_heap_when_no_title_heap_is_bound).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly falls back to the memory view heap for
VIEW_STRIDESwhen no title heap is bound.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@steven-seagull27 on GitHub · 2026-11-26 12:08 UTC · original
I checked the dispatch-path coverage gap on native Windows at
1aff290e. A synthetic GFX10 compute shader reads a raw buffer by element index, which makes the translator emitVIEW_STRIDES. One command list uses the same descriptor indices in two heaps with different input data. Each dispatch goes throughState::bind.Both adapters reproduced this twice in fresh processes. The title outputs were
0x1101…0x1120, the fallback output was0x2201…0x2220, and all 24 guard words survived each run.The regression catches both call-site changes independently on both adapters. Reverting just the stride-table lookup left the fallback output at
0xcafebeefin all 32 lanes, while both title dispatches still matched 32/32. Reverting just the heap-selection predicate, or using parent63bcca43, made the D3D12 debug layer flag the missing CBV/SRV/UAV heap when setting the directly indexed root signature. The test stops before submitting that list.The test-only commit is based directly on this PR head. Commit · applyable patch
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.