diff --git a/Core/Config.cpp b/Core/Config.cpp index 04a7b488e..69ec5d6ba 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -507,9 +507,9 @@ static ConfigSetting graphicsSettings[] = { ConfigSetting("CardboardYShift", &g_Config.iCardboardXShift, 0, true, true), ConfigSetting("ShowFPSCounter", &g_Config.iShowFPSCounter, 0, true, true), ReportedConfigSetting("GraphicsBackend", &g_Config.iGPUBackend, &DefaultGPUBackend), - ConfigSetting("VulkanDevice", &g_Config.VulkanDevice, "", true, false), + ConfigSetting("VulkanDevice", &g_Config.sVulkanDevice, "", true, false), #ifdef _WIN32 - ConfigSetting("D3D11Device", &g_Config.D3D11Device, "", true, false), + ConfigSetting("D3D11Device", &g_Config.sD3D11Device, "", true, false), #endif ReportedConfigSetting("RenderingMode", &g_Config.iRenderingMode, &DefaultRenderingMode, true, true), ConfigSetting("SoftwareRenderer", &g_Config.bSoftwareRendering, false, true, true), diff --git a/Core/Config.h b/Core/Config.h index 24f963ede..05b5f62c9 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -155,9 +155,9 @@ public: int iGPUBackend; // We have separate device parameters for each backend so it doesn't get erased if you switch backends. // If not set, will use the "best" device. - std::string VulkanDevice; + std::string sVulkanDevice; #ifdef _WIN32 - std::string D3D11Device; + std::string sD3D11Device; #endif bool bSoftwareRendering; bool bHardwareTransform; // only used in the GLES backend diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index f41d8b4fd..cced4b40f 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -203,15 +203,16 @@ void GameSettingsScreen::CreateViews() { } #endif Draw::DrawContext *draw = screenManager()->getDrawContext(); + + // Backends that don't allow a device choice will only expose one device. if (draw->GetDeviceList().size() > 1) { - // Some backends don't support switching so no point in showing multiple devices. std::string *deviceNameSetting = nullptr; if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { - deviceNameSetting = &g_Config.VulkanDevice; + deviceNameSetting = &g_Config.sVulkanDevice; } #ifdef _WIN32 if (g_Config.iGPUBackend == (int)GPUBackend::DIRECT3D11) { - deviceNameSetting = &g_Config.D3D11Device; + deviceNameSetting = &g_Config.sD3D11Device; } #endif if (deviceNameSetting) { diff --git a/Windows/GPU/D3D11Context.cpp b/Windows/GPU/D3D11Context.cpp index 447046458..7e6b74827 100644 --- a/Windows/GPU/D3D11Context.cpp +++ b/Windows/GPU/D3D11Context.cpp @@ -115,7 +115,7 @@ bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { pAdapter->GetDesc(&desc); std::string str = ConvertWStringToUTF8(desc.Description); adapterNames.push_back(str); - if (str == g_Config.D3D11Device) { + if (str == g_Config.sD3D11Device) { chosenAdapter = i; } } diff --git a/Windows/GPU/WindowsVulkanContext.cpp b/Windows/GPU/WindowsVulkanContext.cpp index 3ec3d0820..e82b5bc92 100644 --- a/Windows/GPU/WindowsVulkanContext.cpp +++ b/Windows/GPU/WindowsVulkanContext.cpp @@ -109,10 +109,10 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m g_Vulkan = nullptr; return false; } - int deviceNum = g_Vulkan->GetPhysicalDeviceByName(g_Config.VulkanDevice); + int deviceNum = g_Vulkan->GetPhysicalDeviceByName(g_Config.sVulkanDevice); if (deviceNum < 0) { deviceNum = g_Vulkan->GetBestPhysicalDevice(); - g_Config.VulkanDevice = g_Vulkan->GetPhysicalDeviceProperties(deviceNum).deviceName; + g_Config.sVulkanDevice = g_Vulkan->GetPhysicalDeviceProperties(deviceNum).deviceName; } g_Vulkan->ChooseDevice(deviceNum); if (g_Vulkan->EnableDeviceExtension(VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME)) {