diff --git a/SDL/SDLVulkanGraphicsContext.cpp b/SDL/SDLVulkanGraphicsContext.cpp index f58ae422dd..11d7495265 100644 --- a/SDL/SDLVulkanGraphicsContext.cpp +++ b/SDL/SDLVulkanGraphicsContext.cpp @@ -69,7 +69,15 @@ bool SDLVulkanGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, in vulkan_ = nullptr; return false; } - vulkan_->ChooseDevice(vulkan_->GetBestPhysicalDevice()); + + int deviceNum = vulkan_->GetPhysicalDeviceByName(g_Config.sVulkanDevice); + if (deviceNum < 0) { + deviceNum = vulkan_->GetBestPhysicalDevice(); + if (!g_Config.sVulkanDevice.empty()) + g_Config.sVulkanDevice = vulkan_->GetPhysicalDeviceProperties(deviceNum).properties.deviceName; + } + + vulkan_->ChooseDevice(deviceNum); if (vulkan_->CreateDevice() != VK_SUCCESS) { *error_message = vulkan_->InitError(); delete vulkan_;