fix(victory-gpu): bind zero fallback for missing root CBVs/SRVs and drop draws missing stride tables #458

Open
github-bot wants to merge 1 commit from github-bot/gh-458 into main AGit
Owner

@⁠Lewandox on GitHub · 2026-11-26 23:45 UTC · original
Lewandox:fix/victory-gpu-bind-missing-root-views → main · +201 −27 · 3 files · 1 commits · open

Summary

Fixes three cases in draw::State::bind where a root descriptor declared in the compiled D3D12 root signature could be left unbound (uninitialized after Set*RootSignature, or retaining a previous draw's stale GPU virtual address), causing undefined behavior / GPU page faults (DXGI_ERROR_DEVICE_REMOVED) on NVIDIA:

  1. SLOT_STRIDES & SLOT_TABLE_STRIDES without a bound view heap (draw.rs): previously logged once and continued, letting the draw/dispatch record with the stride table root SRV unbound. Now returns false to drop the draw, matching SLOT_MEMORY.
  2. Unset root CBVs / direct root SRVs (draw.rs): when tabled == false (always true for root CBVs, and for root SRVs under VICTORY_ROOT_SRV_DIRECT=1), an unset root slot previously continued 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.
  3. Null / unmapped root CBVs & direct root SRVs (draw.rs): when root_view(...) returns None (e.g. address == 0 or unmapped memory), binds Host::zero_root_gpu() (skipping USER_VIEW_BIAS subtraction on the fallback address) instead of continueing with an unbound slot, or drops the draw if the fallback buffer is unavailable.

Verification

  • Added 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 via victory_shader, no external dxc.exe required):
    • cargo +stable-x86_64-pc-windows-gnu test --lib -p victory-gpu missing_root_views_tests -- --nocapture --test-threads=1 -> 1 passed, 0 failed.
**@⁠Lewandox** on GitHub · 2026-11-26 23:45 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/458) `Lewandox:fix/victory-gpu-bind-missing-root-views` → `main` · +201 −27 · 3 files · 1 commits · open ## Summary Fixes three cases in `draw::State::bind` where a root descriptor declared in the compiled D3D12 root signature could be left unbound (uninitialized after `Set*RootSignature`, or retaining a previous draw's stale GPU virtual address), causing undefined behavior / GPU page faults (`DXGI_ERROR_DEVICE_REMOVED`) on NVIDIA: 1. **`SLOT_STRIDES` & `SLOT_TABLE_STRIDES` without a bound view heap** (`draw.rs`): previously logged once and `continue`d, letting the draw/dispatch record with the stride table root SRV unbound. Now returns `false` to drop the draw, matching `SLOT_MEMORY`. 2. **Unset root CBVs / direct root SRVs** (`draw.rs`): when `tabled == false` (always true for root CBVs, and for root SRVs under `VICTORY_ROOT_SRV_DIRECT=1`), an unset root slot previously `continue`d 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. 3. **Null / unmapped root CBVs & direct root SRVs** (`draw.rs`): when `root_view(...)` returns `None` (e.g. `address == 0` or unmapped memory), binds `Host::zero_root_gpu()` (skipping `USER_VIEW_BIAS` subtraction on the fallback address) instead of `continue`ing with an unbound slot, or drops the draw if the fallback buffer is unavailable. ## Verification - Added `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 via `victory_shader`, no external `dxc.exe` required): - `cargo +stable-x86_64-pc-windows-gnu test --lib -p victory-gpu missing_root_views_tests -- --nocapture --test-threads=1` -> **1 passed, 0 failed**.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:35:19 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/458/head:github-bot/gh-458'
git switch 'github-bot/gh-458'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-458'
git switch 'github-bot/gh-458'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-458'
git switch 'github-bot/gh-458'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-458'
git switch 'main'
git merge --squash 'github-bot/gh-458'
git switch 'main'
git merge --ff-only 'github-bot/gh-458'
git switch 'main'
git merge 'github-bot/gh-458'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.