Repository navigation
Conversation
…-adapter # Conflicts: # README.md # crates/victory-gpu/src/host.rs
|
Tested
No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent). |
…-adapter # Conflicts: # crates/victory-gpu/src/host.rs
|
Tested on native Windows with two hardware adapters, the case this PR is for: each selection picks the right adapter. Machine. RTX 5080 (driver 610.88) and the AMD Radeon iGPU of a Ryzen 7 9800X3D (driver 32.0.21042.62), plus WARP. Windows 11 Pro 26200, Rust 1.98.1, debug. Head
AI use: Claude Code (Claude Opus 5.5) wrote the local print test, ran it and drafted this comment. |
|
Tested on a hybrid laptop: Intel Iris Xe + RTX 3070 Ti Laptop (NVIDIA driver 610.88), Windows 11 build 26300.
Note: the branch no longer merges cleanly into |
Summary
On dual-GPU Windows systems (such as Optimus / hybrid laptops with an integrated GPU at DXGI adapter 0 and a discrete GPU at adapter 1),
D3D12CreateDevice(None, ...)defaults to adapter 0 (the integrated GPU, which may have limited VRAM or lack Mesh Shaders).This change updates both
victory-gpu(crates/victory-gpu/src/host.rs) andvictory-shader(crates/victory-shader/src/emit/host.rs) to:IDXGIFactory6::EnumAdapterByGpuPreference(..., DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)(falling back toIDXGIFactory1::EnumAdapters1/D3D12CreateDevice(None, ...)), skipping software adapters by default so discrete GPUs are chosen automatically.VICTORY_ADAPTER=<substring>(case-insensitive match againstDXGI_ADAPTER_DESC1::Description) so multi-GPU users and testers can explicitly target a specific adapter (failing cleanly withDXGI_ERROR_NOT_FOUNDrather than silently falling back when no adapter matches).victory-gpustartup logs (tracing::info!) to aid GPU bug reports.Verification
Tested on Windows 11 dual-GPU laptop (
DXGI Adapter 0: Intel Iris Xe8086:46a6128 MB,DXGI Adapter 1: NVIDIA GeForce RTX 3070 Ti Laptop GPU10de:24e08017 MB;rustc 1.100.0,x86_64-pc-windows-gnullvm):cargo xtask policy: 150 files ok (zero game data)cargo clippy -p victory-gpu -p victory-shader --all-targets: 0 warnings in modified filescargo test -p victory-gpu -p victory-shader:HIGH_PERFORMANCE-> RTX 3070 Ti): 43 passed (victory-gpu, +4 new unit tests) + 57 passed (victory-shader)VICTORY_ADAPTER=Intel: 43 passed + 57 passedVICTORY_ADAPTER="RTX 3070": 43 passed + 57 passedunknown_adapter_filter_fails_instead_of_falling_back: returnsDXGI_ERROR_NOT_FOUNDAI-assisted.