From 841267c0830c114bf0c8d8dada5701f20cf71d80 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 13 Feb 2016 12:22:06 -0800 Subject: [PATCH] d3d9: Allow software rendering selection in UI. --- UI/EmuScreen.cpp | 5 ++++- UI/GameSettingsScreen.cpp | 7 +------ Windows/MainWindowMenu.cpp | 2 -- Windows/main.cpp | 7 ++----- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index d8fc228688..b55a2b7c99 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -98,10 +98,13 @@ void EmuScreen::bootGame(const std::string &filename) { CoreParameter coreParam; coreParam.cpuCore = g_Config.bJit ? CPU_JIT : CPU_INTERPRETER; - coreParam.gpuCore = g_Config.bSoftwareRendering ? GPU_SOFTWARE : GPU_GLES; + coreParam.gpuCore = GPU_GLES; if (GetGPUBackend() == GPUBackend::DIRECT3D9) { coreParam.gpuCore = GPU_DIRECTX9; } + if (g_Config.bSoftwareRendering) { + coreParam.gpuCore = GPU_SOFTWARE; + } // Preserve the existing graphics context. coreParam.graphicsContext = PSP_CoreParameter().graphicsContext; coreParam.enableSound = g_Config.bEnableSound; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index fb586e4591..67b32f95f7 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -329,7 +329,7 @@ void GameSettingsScreen::CreateViews() { CheckBox *softwareGPU = graphicsSettings->Add(new CheckBox(&g_Config.bSoftwareRendering, gr->T("Software Rendering", "Software Rendering (experimental)"))); softwareGPU->OnClick.Handle(this, &GameSettingsScreen::OnSoftwareRendering); - if (PSP_IsInited() || g_Config.iGPUBackend != GPU_BACKEND_OPENGL) + if (PSP_IsInited()) softwareGPU->SetEnabled(false); // Audio @@ -876,11 +876,6 @@ void GameSettingsScreen::CallbackRenderingBackend(bool yes) { // If the user ends up deciding not to restart, set the config back to the current backend // so it doesn't get switched by accident. if (yes) { - if (g_Config.iGPUBackend == (int)GPUBackend::DIRECT3D9) { - // TODO: Remove once software renderer supports D3D9. - g_Config.bSoftwareRendering = false; - } - g_Config.bRestartRequired = true; PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0); } else { diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index bfb1059e9b..c232c1325c 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -691,8 +691,6 @@ namespace MainWindow { case ID_OPTIONS_DIRECT3D9: g_Config.iGPUBackend = GPU_BACKEND_DIRECT3D9; - // TODO: Remove once software renderer supports D3D9. - g_Config.bSoftwareRendering = false; g_Config.bRestartRequired = true; PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0); break; diff --git a/Windows/main.cpp b/Windows/main.cpp index b68b3377f0..12e28bc5a6 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -472,13 +472,10 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin if (restOfOption == L"directx9") { g_Config.iGPUBackend = GPU_BACKEND_DIRECT3D9; g_Config.bSoftwareRendering = false; - } - else if (restOfOption == L"gles") { + } else if (restOfOption == L"gles") { g_Config.iGPUBackend = GPU_BACKEND_OPENGL; g_Config.bSoftwareRendering = false; - } - - else if (restOfOption == L"software") { + } else if (restOfOption == L"software") { g_Config.iGPUBackend = GPU_BACKEND_OPENGL; g_Config.bSoftwareRendering = true; }