GPU: reject unknown shader model feature requests #2945
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2947"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T01:16:14Z.
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
63bcca43reports 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.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T02:04:45Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64:cargo test -p victory-gpu --lib device::tests: 9 passed, 0 failed (including newshader_model_query_rejects_unknown_requests_without_writingverifyingE_INVALIDARGwithout mutating the output for unknown values and clamping known SM 5.1 / 6.0–6.10 to 6.6).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:31:57Z.
Code review and RTX 5090 + WARP verification at head
1735e200d1a3onmain(63bcca43c6a0):crates/victory-gpu/src/device.rs:329-339):size != 4E_INVALIDARGchecks, rejects undefined shader-model values outside0x51 | 0x60..=0x6awithE_INVALIDARGwithout mutating*q, and clamps valid requests to(*q).min(0x66)(S_OK), matching native D3D12CheckFeatureSupport(SHADER_MODEL).VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy --locked -p victory-gpu --tests -- -D warnings: 0 warningsvictory-gpu -- device::tests: 9/9 passed on both RTX 5090 and WARP.LGTM.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:19:06Z.
Review: COMMENTED
Verified: CheckFeatureSupport(SHADER_MODEL) is supposed to E_INVALIDARG non-enum input before the clamp — accepting 0x51 and 0x60..=0x6a covers SM 5.1 through 6.10, and the validation now happens before the min(0x66) so unknown inputs keep their value untouched. The test pins both halves (reject-without-write, accept-and-clamp) — non-tautological.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T04:29:06Z.
Automated triage for the maintainers.
Needs work.
check_feature_supportfor 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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.