feat(d3d12_x): rank Vulkan devices and let a setting choose the GPU #68
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!68
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/68/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?
@Dark3581 on GitHub · 2026-11-23 02:14 UTC · original
Dark3581:feat/device-selection→main· +89 −6 · 8 files · 1 commits · merged 2026-11-23 02:18 UTCWhat
Vulkan device selection that holds up on machines with more than one Vulkan driver:
DeviceScore(vulkan/VulkanDevice.cpp), a pure function, ranks a native discrete GPU over a native integrated one, then a layered driver, then a virtual or CPU device. Mesa Dozen (Vulkan on D3D12, installed by the OpenCL/OpenGL Compatibility Pack) reports the device type of the GPU underneath it, so it used to tie with the real GPU and win when it enumerated first. It is now recognised byVK_DRIVER_ID_MESA_DOZENfrom the 1.2 properties the selection already reads.DeviceRequirements::preferredDevice: a case-insensitive part of a device name that wins over the ranking. If nothing matches, the ranking applies andPreferenceMissed()reports it, so the device object can log it.DeviceRequirementsFromSettingsfills the preference from thed3d12_x.vulkan_devicesetting (#66), for the device object to call.docs/dev/GAME_TESTING.mdlists the key; the debt entry forVulkanDeviceis updated.Tested
Windows 10, RTX 3070 Ti (driver 621.14). This machine has a single Vulkan device.
pso_probe device-selection, run by thepipeline_statetest:PreferenceMissed()set.d3d12_x.vulkan_devicethroughANYBOX_SETand reads it back throughDeviceRequirementsFromSettings.ctest: 73 of 73. With MSVC 2022,device-selectionandpipeline_statepass, and every target builds exceptab_gameinput, which needsgameinput.lib, which this machine doesn't have.python tools/check_conventions.pyanddebt_fold.py --check: ok.Not tested on hardware: a machine with several GPUs or with Dozen installed. Only the pure ranking covers those cases.
Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragmentdocs/dev/debt/changes/<branch>.mdVkPhysicalDeviceVulkan12Properties::driverID,VK_DRIVER_ID_MESA_DOZEN)