GPU: say once when the host adapter lacks shader model 6.6 #527

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

@⁠rustnoob-dev on GitHub · 2026-11-27 09:29 UTC · original
rustnoob-dev:gpu-fallback-warning → a-publier · +39 −4 · 2 files · 1 commits · open

What

When the host D3D12 device is made, check its shader model once and log an error if it is below 6.6.

Why

create_preferred_device() picks a high-performance adapter that runs shader model 6.6. When no adapter runs it, it falls back to DXGI's default device without checking it. The adapter named by VICTORY_D3D12_ADAPTER is not checked either. On such a device every translated pipeline is refused later, one at a time, and the log never says that the GPU itself is the reason.

This adds one line at startup that names the adapter and its shader model, for example:

ERROR adapter="<adapter name>" shader_model=6.5 the host adapter does not run shader model 6.6, ...

The run is not stopped, so WARP and CI paths behave as before. It complements #285 (victory doctor): the check also happens on every run, not only when someone runs the doctor.

Changes

  • victory-gpu/src/host.rs: shader model check after the device is created, next to the existing #168 runtime check; a small shader_model_text() helper with a unit test.
  • victory-shader/src/emit/host.rs: shader_model() made pub so the runtime reuses it instead of duplicating the query.

Testing

  • cargo check -p victory-gpu and cargo clippy -p victory-gpu -p victory-shader --all-targets -- -D warnings pass.
  • I could not link the tests locally (no MSVC Build Tools on this machine), so the new unit test has not been run here; CI should run it.
**@⁠rustnoob-dev** on GitHub · 2026-11-27 09:29 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/527) `rustnoob-dev:gpu-fallback-warning` → `a-publier` · +39 −4 · 2 files · 1 commits · open ## What When the host D3D12 device is made, check its shader model once and log an error if it is below 6.6. ## Why `create_preferred_device()` picks a high-performance adapter that runs shader model 6.6. When no adapter runs it, it falls back to DXGI's default device without checking it. The adapter named by `VICTORY_D3D12_ADAPTER` is not checked either. On such a device every translated pipeline is refused later, one at a time, and the log never says that the GPU itself is the reason. This adds one line at startup that names the adapter and its shader model, for example: ``` ERROR adapter="<adapter name>" shader_model=6.5 the host adapter does not run shader model 6.6, ... ``` The run is not stopped, so WARP and CI paths behave as before. It complements #285 (`victory doctor`): the check also happens on every run, not only when someone runs the doctor. ## Changes - `victory-gpu/src/host.rs`: shader model check after the device is created, next to the existing #168 runtime check; a small `shader_model_text()` helper with a unit test. - `victory-shader/src/emit/host.rs`: `shader_model()` made `pub` so the runtime reuses it instead of duplicating the query. ## Testing - `cargo check -p victory-gpu` and `cargo clippy -p victory-gpu -p victory-shader --all-targets -- -D warnings` pass. - I could not link the tests locally (no MSVC Build Tools on this machine), so the new unit test has not been run here; CI should run it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:41:00 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 11:40 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 b39714b: victory-gpu 397 passed, 0 failed, 34 ignored; victory-shader 303 passed, 0 failed, 4 ignored.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-27 11:40 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/527#issuecomment-7217341149) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `b39714b`: `victory-gpu` 397 passed, 0 failed, 34 ignored; `victory-shader` 303 passed, 0 failed, 4 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/527/head:github-bot/gh-527'
git switch 'github-bot/gh-527'

Merge

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