GPU: reject non-software WARP adapters under Proton #41

Merged
LaunchDoesntCode merged 1 commit from upstream-pr/41 into main 2026-11-24 00:43:07 +00:00
LaunchDoesntCode commented 2026-11-23 23:39:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LaunchDoesntCode on 2026-11-23T23:39:20Z.


Summary

VICTORY_D3D12_WARP=1 is intended to keep diagnostics on a software adapter. Under Proton/DXVK, EnumWarpAdapter can instead return the first adapter with no software flag. Creating a device on it would silently use the host GPU while VIctory reports WARP.

  • Check DXGI_ADAPTER_FLAG_SOFTWARE before D3D12CreateDevice; refuse the adapter and log its vendor/flags when the flag is absent.
  • Return an HRESULT without Error::new, whose WinRT error-message path calls Wine's unimplemented RoOriginateErrorW.
  • Add a focused Windows DXGI test that checks the same adapter boundary without creating a D3D12 device or reading title data.

Validation

  • Diagnostics Windows MSVC cross-build (--profile diag --features diagnostics with xwin SDK and lld-link): passed.
  • Targeted Windows DXGI test under Proton 10 with lavapipe: 1 passed. DXVK logged WARP not supported, returning first hardware adapter; the returned descriptor had vendor 0x10005, flags 0x0, and the guard rejected it without a Wine abort.
  • cargo xtask policy: passed (148 files).
  • git diff --check: passed.

This verifies adapter selection, not title rendering. The test uses only DXGI and synthetic code.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6571146949 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/41). Originally posted by [LaunchDoesntCode](https://github.com/LaunchDoesntCode) on 2026-11-23T23:39:20Z. --- ## Summary `VICTORY_D3D12_WARP=1` is intended to keep diagnostics on a software adapter. Under Proton/DXVK, `EnumWarpAdapter` can instead return the first adapter with no software flag. Creating a device on it would silently use the host GPU while VIctory reports WARP. - Check `DXGI_ADAPTER_FLAG_SOFTWARE` before `D3D12CreateDevice`; refuse the adapter and log its vendor/flags when the flag is absent. - Return an HRESULT without `Error::new`, whose WinRT error-message path calls Wine's unimplemented `RoOriginateErrorW`. - Add a focused Windows DXGI test that checks the same adapter boundary without creating a D3D12 device or reading title data. ## Validation - Diagnostics Windows MSVC cross-build (`--profile diag --features diagnostics` with xwin SDK and `lld-link`): passed. - Targeted Windows DXGI test under Proton 10 with lavapipe: 1 passed. DXVK logged `WARP not supported, returning first hardware adapter`; the returned descriptor had vendor `0x10005`, flags `0x0`, and the guard rejected it without a Wine abort. - `cargo xtask policy`: passed (148 files). - `git diff --check`: passed. This verifies adapter selection, not title rendering. The test uses only DXGI and synthetic code.
upstream-sync closed this pull request 2026-11-24 06:51:03 +00:00
raffclar commented 2026-11-24 06:54:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-23T23:50:40Z.


Looks good! Tested and checked

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117424219 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/41#issuecomment-7117424219). Originally posted by [raffclar](https://github.com/raffclar) on 2026-11-23T23:50:40Z. --- Looks good! Tested and checked
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!41
No description provided.