victory-gpu: verify typed UAV format support in descriptor fits #554

Open
github-bot wants to merge 2 commits from github-bot/gh-554 into a-publier AGit
Owner

@⁠SalmanBarkat on GitHub · 2026-11-27 11:16 UTC · original
SalmanBarkat:fix/typed-uav-format-support → a-publier · +136 −8 · 1 files · 2 commits · open

Summary

  • Check D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW via ID3D12Device::CheckFeatureSupport (D3D12_FEATURE_FORMAT_SUPPORT) in fits() for unordered access views, cached per DXGI format in supports_typed_uav.
  • Cover all effective format paths when unordered is true (view == 0 -> own, target_format(view) == own stand-ins, typed own, and typeless-cast view) so unsupported typed UAV formats log once and fall back to a null descriptor before calling CreateUnorderedAccessView.
  • Add unsupported_typed_uav_format_is_rejected unit test in crates/victory-gpu/src/descriptor/host.rs.

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::host::tests::unsupported_typed_uav_format_is_rejected -- --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:16 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/554) `SalmanBarkat:fix/typed-uav-format-support` → `a-publier` · +136 −8 · 1 files · 2 commits · open ## Summary - Check `D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW` via `ID3D12Device::CheckFeatureSupport` (`D3D12_FEATURE_FORMAT_SUPPORT`) in `fits()` for unordered access views, cached per DXGI format in `supports_typed_uav`. - Cover all effective format paths when `unordered` is true (`view == 0` -> `own`, `target_format(view) == own` stand-ins, typed `own`, and typeless-cast `view`) so unsupported typed UAV formats log once and fall back to a null descriptor before calling `CreateUnorderedAccessView`. - Add `unsupported_typed_uav_format_is_rejected` unit test in `crates/victory-gpu/src/descriptor/host.rs`. ## 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::host::tests::unsupported_typed_uav_format_is_rejected -- --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:19:53 +00:00
Author
Owner

@⁠lvndrpup on GitHub · 2026-11-27 14:15 UTC · original · reviewed

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

I called fits(texture, view, true) on the card for 4×4 textures made with ALLOW_UNORDERED_ACCESS. Where fits allowed the view, I created it and read GetDeviceRemovedReason. The debug layer isn't installed here, so the removed reason is all I can see.

texture → view (DXGI format) base 4eb6cfd head e57d565
R8G8B8A8_TYPELESS (27) → R8G8B8A8_TYPELESS allowed; creating it removes the device (0x887A0001, DXGI_ERROR_INVALID_CALL) refused
B8G8R8X8_TYPELESS (92) → B8G8R8X8_UNORM (88) allowed; creating it removes the device (0x887A0001) refused
11 others: R8G8B8A8_TYPELESS → _UNORM and → _UNORM_SRGB (made _UNORM); B8G8R8A8_TYPELESS → _UNORM; and R8G8B8A8_UNORM, B8G8R8A8_UNORM, R32G32B32A32_FLOAT, R16G16B16A16_FLOAT, R10G10B10A2_UNORM, R11G11B10_FLOAT, R32_FLOAT, R8_UNORM each in its own format allowed allowed; all 11 created in one run, and the device is still fine
unsupported_typed_uav_format_is_rejected (its first assertion is the first row, which the base allows) passes; make_tex(92) succeeds on this card, so the B8G8R8X8 part runs too
cargo test -p victory-gpu --lib descriptor:: 47 passed
cargo test -p victory-gpu --lib, one run 397 passed, 1 failed: no_write_is_lost_with_port_7 (watch.rs:5917), the #534 race between tests, which #539 fixes; nothing this PR touches
cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without --all-features clean

So on NVIDIA this prevents two device removals, and none of the other formats I tried is refused.

One thing to fix: supports_typed_uav went in between fits and its doc comment. The fits doc ("Whether the host can make a shader (or unordered access) view of texture …", with its shortcut: line) now documents supports_typed_uav, and fits has none. Moving the new function above that comment fixes it.

It merges cleanly with the 14 other open PRs on descriptor/host.rs that still merge with a-publier.

**@⁠lvndrpup** on GitHub · 2026-11-27 14:15 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/554#pullrequestreview-6089463010) · **reviewed** Tested on an RTX 3060 Ti (Windows 11, debug build), base `4eb6cfd` against head `e57d565`. I called `fits(texture, view, true)` on the card for 4×4 textures made with `ALLOW_UNORDERED_ACCESS`. Where `fits` allowed the view, I created it and read `GetDeviceRemovedReason`. The debug layer isn't installed here, so the removed reason is all I can see. | texture → view (DXGI format) | base `4eb6cfd` | head `e57d565` | |---|---|---| | R8G8B8A8_TYPELESS (27) → R8G8B8A8_TYPELESS | allowed; creating it removes the device (`0x887A0001`, DXGI_ERROR_INVALID_CALL) | refused | | B8G8R8X8_TYPELESS (92) → B8G8R8X8_UNORM (88) | allowed; creating it removes the device (`0x887A0001`) | refused | | 11 others: R8G8B8A8_TYPELESS → _UNORM and → _UNORM_SRGB (made _UNORM); B8G8R8A8_TYPELESS → _UNORM; and R8G8B8A8_UNORM, B8G8R8A8_UNORM, R32G32B32A32_FLOAT, R16G16B16A16_FLOAT, R10G10B10A2_UNORM, R11G11B10_FLOAT, R32_FLOAT, R8_UNORM each in its own format | allowed | allowed; all 11 created in one run, and the device is still fine | | `unsupported_typed_uav_format_is_rejected` | (its first assertion is the first row, which the base allows) | passes; `make_tex(92)` succeeds on this card, so the B8G8R8X8 part runs too | | `cargo test -p victory-gpu --lib descriptor::` | | 47 passed | | `cargo test -p victory-gpu --lib`, one run | | 397 passed, 1 failed: `no_write_is_lost_with_port_7` (`watch.rs:5917`), the #534 race between tests, which #539 fixes; nothing this PR touches | | `cargo clippy -p victory-gpu --all-targets -- -D warnings`, with and without `--all-features` | | clean | So on NVIDIA this prevents two device removals, and none of the other formats I tried is refused. One thing to fix: `supports_typed_uav` went in between `fits` and its doc comment. The `fits` doc ("Whether the host can make a shader (or unordered access) view of `texture` …", with its `shortcut:` line) now documents `supports_typed_uav`, and `fits` has none. Moving the new function above that comment fixes it. It merges cleanly with the 14 other open PRs on `descriptor/host.rs` that still merge with `a-publier`.
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 e57d565: 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/554#issuecomment-7222666662) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `e57d565`: `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/554/head:github-bot/gh-554'
git switch 'github-bot/gh-554'

Merge

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