GPU: prefer high-performance D3D12 adapter and support VICTORY_ADAPTER #94
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!94
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/94/head"
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?
@lordon1a on GitHub · 2026-11-24 00:26 UTC · original
feat/high-performance-adapter→main· +216 −33 · 3 files · 4 commits · closed without mergingSummary
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.
@DaviTostes on GitHub · 2026-11-24 00:52 UTC · original
Tested
163752cunder Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build withcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.victory_gpu: 44 passed, 3 failed, 1 ignored; the PR adds 5 tests. The 3 failures are the environment-only ones frommain(argument_clamp_builds,a_rejected_blob_gives_an_empty_library, #128'sVirtualQueryupload skip).default_adapter_is_hardware_when_present,warp_adapter_accepts_only_software,unknown_adapter_filter_fails_instead_of_falling_back,adapter_filter_matches_case_insensitivelyandadapter_name_stops_at_nulall pass.texture_checks_per_submissionstays ignored (benchmark).No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
@Lyrnc on GitHub · 2026-11-24 06:18 UTC · original
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
513eb91merged withmaind2a4bae(clean). A local test (not pushed) prints whatpick_hardware_adapterreturns for a few filters.VICTORY_ADAPTERamdradeonNVIDIAgeforce rtx 5080Microsoft Basic Renderno such gpu0x887A0002, no fallbackvictory_gpuadapter tests: all five pass (adapter_filter_matches_case_insensitively,adapter_name_stops_at_nul,default_adapter_is_hardware_when_present,unknown_adapter_filter_fails_instead_of_falling_back,warp_adapter_accepts_only_software).victory-shadertest host follows the variable too: withVICTORY_ADAPTER=amdits device is the Radeon, otherwise the RTX 5080. I used that to run GPU checks on the iGPU's 64-lane waves for #606.AI use: Claude Code (Claude Opus 5.5) wrote the local print test, ran it and drafted this comment.
@Ilokaxt on GitHub · 2026-11-24 12:07 UTC · original
Tested on a hybrid laptop: Intel Iris Xe + RTX 3070 Ti Laptop (NVIDIA driver 610.88), Windows 11 build 26300.
mainthe device is created on the default adapter, which on this laptop is the Iris Xe (adapter 0; checked with aD3D12CreateDevice(None)probe).513eb91) the log readshost D3D12 device ready adapter=NVIDIA GeForce RTX 3070 Ti Laptop GPU vendor=0x10de device=0x24a0 vram_mb=8017, and the menus run at 30 fps.Note: the branch no longer merges cleanly into
mainatffe310e: there is a conflict incrates/victory-gpu/src/host.rs.Pull request closed