GPU: reject unknown shader model feature requests #2947

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 01:16 UTC · original
andrewpozdnakov7-jpg:codex2/shader-model-query → main · +21 −0 · 1 files · 1 commits · open

CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL) was treating any integer as a version and returning success. D3D12 applications use E_INVALIDARG on an unknown request to try an older model. This change rejects undefined model requests before writing the result. Requests for the defined models 5.1 and 6.0 through 6.10 report up to the guest's SM 6.6 ceiling. Microsoft D3D12 contract, DirectX-Headers enum at 61c7718.

Validation

  • Native Windows FL 11_0 WARP with inbox D3D12 and with app-local Agility 1.620.2 both return E_INVALIDARG and retain the input for the seven invalid values in the test. The app-local runtime accepts a 6.10 request and reports its supported 6.9.

  • The same VIctory device-vtable fixture on main at 63bcca43 reports S_OK for the zero/no-model request. The updated result is E_INVALIDARG with the original field value for all seven invalid requests. All 12 defined requests get the expected model at or below SM 6.6.

  • Nine device tests and the full app-local WARP GPU diagnostics suite passed (247 passed, one ignored). Strict GPU Clippy in both feature configurations and the asset policy passed.

AI-assisted. Verification used synthetic inputs on software WARP.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 01:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2947) `andrewpozdnakov7-jpg:codex2/shader-model-query` → `main` · +21 −0 · 1 files · 1 commits · open CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL) was treating any integer as a version and returning success. D3D12 applications use E_INVALIDARG on an unknown request to try an older model. This change rejects undefined model requests before writing the result. Requests for the defined models 5.1 and 6.0 through 6.10 report up to the guest's SM 6.6 ceiling. [Microsoft D3D12 contract](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_shader_model), [DirectX-Headers enum at 61c7718](https://github.com/microsoft/DirectX-Headers/blob/61c7718954ec73dbdd43c723240fe1a0452a3724/include/directx/d3d12.h#L2863-L2880). **Validation** - Native Windows FL 11_0 WARP with inbox D3D12 and with app-local Agility 1.620.2 both return E_INVALIDARG and retain the input for the seven invalid values in the test. The app-local runtime accepts a 6.10 request and reports its supported 6.9. - The same VIctory device-vtable fixture on main at 63bcca43 reports S_OK for the zero/no-model request. The updated result is E_INVALIDARG with the original field value for all seven invalid requests. All 12 defined requests get the expected model at or below SM 6.6. - Nine device tests and the full app-local WARP GPU diagnostics suite passed (247 passed, one ignored). Strict GPU Clippy in both feature configurations and the asset policy passed. AI-assisted. Verification used synthetic inputs on software WARP.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:18:15 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:31 UTC · original

Code review and RTX 5090 + WARP verification at head 1735e200d1a3 on main (63bcca43c6a0):

  • Code review (crates/victory-gpu/src/device.rs:329-339):
    • Preserves null-pointer and size != 4 E_INVALIDARG checks, rejects undefined shader-model values outside 0x51 | 0x60..=0x6a with E_INVALIDARG without mutating *q, and clamps valid requests to (*q).min(0x66) (S_OK), matching native D3D12 CheckFeatureSupport(SHADER_MODEL).
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-gpu --tests -- -D warnings: 0 warnings
    • victory-gpu -- device::tests: 9/9 passed on both RTX 5090 and WARP.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/2947#issuecomment-7179865386) Code review and RTX 5090 + WARP verification at head `1735e200d1a3` on `main` (`63bcca43c6a0`): - **Code review (`crates/victory-gpu/src/device.rs:329-339`)**: - Preserves null-pointer and `size != 4` `E_INVALIDARG` checks, rejects undefined shader-model values outside `0x51 | 0x60..=0x6a` with `E_INVALIDARG` without mutating `*q`, and clamps valid requests to `(*q).min(0x66)` (`S_OK`), matching native D3D12 `CheckFeatureSupport(SHADER_MODEL)`. - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-gpu --tests -- -D warnings`: 0 warnings - `victory-gpu -- device::tests`: **9/9 passed** on both RTX 5090 and WARP. LGTM.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 04:29 UTC · original

Automated triage for the maintainers.

Needs work. check_feature_support for SHADER_MODEL (victory-gpu/src/device.rs) would return E_INVALIDARG for values other than 5.1 and 6.0 through 6.10. The evidence is the desktop runtime on WARP, but this device stands in for the console's runtime, and nothing shows the title or its upscaler sends an undefined value. Please show that the title can send such a request, or give a reference for how the console runtime answers; otherwise this guards a case that does not occur and adds a hard upper bound (0x6a) nothing needs.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 04:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/2947#issuecomment-7182635178) <!-- victory-triage v1 head=1735e200d1a36a9657b6dec677a5d1cc42d1e113 verdict=needs-work at=2026-11-26T04:29:00Z --> Automated triage for the maintainers. **Needs work.** `check_feature_support` for SHADER_MODEL (`victory-gpu/src/device.rs`) would return E_INVALIDARG for values other than 5.1 and 6.0 through 6.10. The evidence is the desktop runtime on WARP, but this device stands in for the console's runtime, and nothing shows the title or its upscaler sends an undefined value. Please show that the title can send such a request, or give a reference for how the console runtime answers; otherwise this guards a case that does not occur and adds a hard upper bound (0x6a) nothing needs. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
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/2947/head:github-bot/gh-2947'
git switch 'github-bot/gh-2947'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2947'
git switch 'github-bot/gh-2947'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2947'
git switch 'github-bot/gh-2947'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2947'
git switch 'main'
git merge --squash 'github-bot/gh-2947'
git switch 'main'
git merge --ff-only 'github-bot/gh-2947'
git switch 'main'
git merge 'github-bot/gh-2947'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2947
No description provided.