launcher: add GPU selection

This commit is contained in:
nmzik
2026-09-07 15:12:35 +04:00
parent b3b3aeef73
commit e4c10de8b6
6 changed files with 58 additions and 3 deletions
@@ -169,7 +169,12 @@ static void VulkanFindPhysicalDevice(vk::Instance instance, vk::SurfaceKHR surfa
EXIT_NOT_IMPLEMENTED(devices.empty());
if (Config::GetGpuIndex() >= 0) {
devices = {devices[Config::GetGpuIndex()]};
if (static_cast<size_t>(Config::GetGpuIndex()) < devices.size()) {
devices = {devices[Config::GetGpuIndex()]};
} else {
LOGF("Vulkan GPU index %d is unavailable; selecting automatically\n",
Config::GetGpuIndex());
}
}
vk::PhysicalDevice best_device = nullptr;