victory-gpu: clear descriptor slot on CreateConstantBufferView null desc #562

Open
github-bot wants to merge 1 commit from github-bot/gh-562 into a-publier AGit
Owner

@⁠SalmanBarkat on GitHub · 2026-11-27 11:30 UTC · original
SalmanBarkat:fix/create-cbv-null-desc → a-publier · +22 −4 · 1 files · 1 commits · open

Summary

  • Record View::Constant(0, 0) in create_cbv() (crates/victory-gpu/src/descriptor.rs) when desc is null instead of skipping record() and leaving the previous view in the descriptor slot.
  • Host mirroring handles View::Constant(0, 0) as a null constant buffer view.
  • Add null_cbv_clears_a_stale_view unit test verifying both a prior CBV and a prior SRV are cleared on a null create_cbv.

Verification

  • cargo clippy --workspace --all-targets --locked -- -D warnings (passed)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (passed)
  • cargo test --locked -p victory-gpu descriptor::tests::null_cbv_clears_a_stale_view -- --exact --nocapture (1 passed, 0 failed)
  • cargo test --locked -p victory-gpu --lib -- --test-threads=1 (397 passed, 0 failed, 34 ignored)
  • cargo test --locked -p victory-gpu --all-features --lib -- --test-threads=1 (446 passed, 0 failed, 34 ignored)
  • cargo test -p xtask --locked (9 passed, 0 failed)
**@⁠SalmanBarkat** on GitHub · 2026-11-27 11:30 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/562) `SalmanBarkat:fix/create-cbv-null-desc` → `a-publier` · +22 −4 · 1 files · 1 commits · open ## Summary - Record `View::Constant(0, 0)` in `create_cbv()` (`crates/victory-gpu/src/descriptor.rs`) when `desc` is null instead of skipping `record()` and leaving the previous view in the descriptor slot. - Host mirroring handles `View::Constant(0, 0)` as a null constant buffer view. - Add `null_cbv_clears_a_stale_view` unit test verifying both a prior CBV and a prior SRV are cleared on a null `create_cbv`. ## Verification - `cargo clippy --workspace --all-targets --locked -- -D warnings` (passed) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (passed) - `cargo test --locked -p victory-gpu descriptor::tests::null_cbv_clears_a_stale_view -- --exact --nocapture` (1 passed, 0 failed) - `cargo test --locked -p victory-gpu --lib -- --test-threads=1` (397 passed, 0 failed, 34 ignored) - `cargo test --locked -p victory-gpu --all-features --lib -- --test-threads=1` (446 passed, 0 failed, 34 ignored) - `cargo test -p xtask --locked` (9 passed, 0 failed)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 11:31:51 +00:00
Author
Owner

@⁠lvndrpup on GitHub · 2026-11-27 12:54 UTC · original · reviewed

Tested on an RTX 3060 Ti (Windows 11, debug build), base 4eb6cfd against head d12ff1a.

base 4eb6cfd head d12ff1a
null_cbv_clears_a_stale_view, copied onto base fails: after the null create the slot still holds Constant(0x1_0000_1000, 256) passes
cargo test -p victory-gpu --lib descriptor:: 46 passed (without the new test) 47 passed
cargo test -p victory-gpu --lib, one run 396 passed, 1 failed: unchanged_ranges_are_known, the #534 race between tests, which #539 (and #382, #462) fix; nothing this PR touches
cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without --all-features clean

The host side needs no change, as the description says. Outside a table, make_at falls back to null_for when shadow::find(0, 0) finds nothing. In a table (draw.rs:3621), the view becomes a 0-byte constant buffer view over scratch (constant_bytes(0) is 0), and copy_mapped returns early on the 0-byte fill. I didn't draw through either path.

It conflicts with #549 only where both add a test at the end of mod tests; keeping both resolves it. It merges cleanly with the other open PRs on descriptor.rs that still merge with a-publier (#578, #530, #471, #453, #62).

**@⁠lvndrpup** on GitHub · 2026-11-27 12:54 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/562#pullrequestreview-6088445086) · **reviewed** Tested on an RTX 3060 Ti (Windows 11, debug build), base `4eb6cfd` against head `d12ff1a`. | | base `4eb6cfd` | head `d12ff1a` | |---|---|---| | `null_cbv_clears_a_stale_view`, copied onto base | fails: after the null create the slot still holds `Constant(0x1_0000_1000, 256)` | passes | | `cargo test -p victory-gpu --lib descriptor::` | 46 passed (without the new test) | 47 passed | | `cargo test -p victory-gpu --lib`, one run | | 396 passed, 1 failed: `unchanged_ranges_are_known`, the #534 race between tests, which #539 (and #382, #462) fix; nothing this PR touches | | `cargo clippy -p victory-gpu --all-targets -- -D warnings`, with and without `--all-features` | | clean | The host side needs no change, as the description says. Outside a table, `make_at` falls back to `null_for` when `shadow::find(0, 0)` finds nothing. In a table (`draw.rs:3621`), the view becomes a 0-byte constant buffer view over scratch (`constant_bytes(0)` is 0), and `copy_mapped` returns early on the 0-byte fill. I didn't draw through either path. It conflicts with #549 only where both add a test at the end of `mod tests`; keeping both resolves it. It merges cleanly with the other open PRs on `descriptor.rs` that still merge with `a-publier` (#578, #530, #471, #453, #62).
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 15:56 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At d12ff1a: victory-gpu 397 passed, 0 failed, 34 ignored.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 15:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/562#issuecomment-7222663808) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `d12ff1a`: `victory-gpu` 397 passed, 0 failed, 34 ignored. AI-assisted (Claude Code); no game data.
This pull request can be merged automatically.
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/562/head:github-bot/gh-562'
git switch 'github-bot/gh-562'

Merge

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