fix(victory-gpu): bind zero fallback for missing root CBVs/SRVs and drop draws missing stride tables #458
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/458"
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?
Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-26T23:45:02Z.
Summary
Fixes three cases in
draw::State::bindwhere a root descriptor declared in the compiled D3D12 root signature could be left unbound (uninitialized afterSet*RootSignature, or retaining a previous draw's stale GPU virtual address), causing undefined behavior / GPU page faults (DXGI_ERROR_DEVICE_REMOVED) on NVIDIA:SLOT_STRIDES&SLOT_TABLE_STRIDESwithout a bound view heap (draw.rs): previously logged once andcontinued, letting the draw/dispatch record with the stride table root SRV unbound. Now returnsfalseto drop the draw, matchingSLOT_MEMORY.draw.rs): whentabled == false(always true for root CBVs, and for root SRVs underVICTORY_ROOT_SRV_DIRECT=1), an unset root slot previouslycontinued without binding anything. Now binds a persistent 64 KiB zero-filled fallback buffer (Host::zero_root_gpu()), matching console null-CBV zero reads without leaving a D3D12 root descriptor uninitialized.draw.rs): whenroot_view(...)returnsNone(e.g.address == 0or unmapped memory), bindsHost::zero_root_gpu()(skippingUSER_VIEW_BIASsubtraction on the fallback address) instead ofcontinueing with an unbound slot, or drops the draw if the fallback buffer is unavailable.Verification
draw::missing_root_views_tests::bind_drops_missing_stride_tables_and_binds_zero_fallback_for_root_cbv(emits a minimal SM 6.6 compute DXIL viavictory_shader, no externaldxc.exerequired):cargo +stable-x86_64-pc-windows-gnu test --lib -p victory-gpu missing_root_views_tests -- --nocapture --test-threads=1-> 1 passed, 0 failed.Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T12:24:08Z.
Review: draw.rs around lines 1863 and 1892 bind a zero buffer for a missing root CBV/SRV with no log, which breaks the no-silent-fallback rule. Please add a once! warning on that path.
Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-27T12:40:56Z.
Added
once!warnings on both zero-fallback root CBV/SRV bind paths (unset slot and missing host buffer, plus when the fallback buffer itself is unavailable). Re-verifieddraw::missing_root_views_testslocally (1 passed, 0 failed).Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T19:43:40Z.
Main just took 23 PRs at once (#545), and this now conflicts in
third_party/victory/crates/victory-gpu/src/draw.rs. Could you rebase on current main, keep both sides, rerundraw::missing_root_views_testsand force-push? Theonce!warnings you added settle the earlier point.Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-27T21:06:03Z.
Rebased on current
mainkeeping bothdescriptor_cache_identity_testsandmissing_root_views_testsindraw.rs, re-verifieddraw::missing_root_views_tests+draw::descriptor_cache_identity_tests+xtask policy, and force-pushed — ready to merge!Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-28T00:15:18Z.
Main just took #563 (the VIctory copy moved to Vice-Tay
4f15f09e) and #564 (memory stack), and this PR now conflicts inthird_party/victory/crates/victory-gpu/src/host.rs. Please rebase on current main, rerun the tests for the files you touch, and force-push.Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-28T08:15:39Z.
Rebased onto
main(132da61), resolving the struct-field conflict inthird_party/victory/crates/victory-gpu/src/host.rswhile keepingtexture_readbacksandzero_roottogether.Verified locally:
cargo test -p victory-gpu draw::missing_root_views_tests: 1 passed, 0 failedcargo run -p xtask -- policy:asset policy: 377 files okImported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-30T00:56:59Z.
Closing since the upstream project has been discontinued. Thanks for everything!
Pull request closed