Add a toggle option for OpenCL in Config (in Advanced Settings). Default is off.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5768 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
25aca8cc4a
commit
21fb4cb96c
|
@ -136,6 +136,7 @@ void SConfig::SaveSettings()
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2);
|
ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2);
|
||||||
|
ini.Set("Core", "EnableOpenCL", m_LocalCoreStartupParameter.bEnableOpenCL);
|
||||||
ini.Set("Core", "CPUCore", m_LocalCoreStartupParameter.iCPUCore);
|
ini.Set("Core", "CPUCore", m_LocalCoreStartupParameter.iCPUCore);
|
||||||
ini.Set("Core", "CPUThread", m_LocalCoreStartupParameter.bCPUThread);
|
ini.Set("Core", "CPUThread", m_LocalCoreStartupParameter.bCPUThread);
|
||||||
ini.Set("Core", "DSPThread", m_LocalCoreStartupParameter.bDSPThread);
|
ini.Set("Core", "DSPThread", m_LocalCoreStartupParameter.bDSPThread);
|
||||||
|
@ -260,6 +261,7 @@ void SConfig::LoadSettings()
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, true);
|
ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, true);
|
||||||
|
ini.Get("Core", "EnableOpenCL", &m_LocalCoreStartupParameter.bHLE_BS2, false);
|
||||||
ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1);
|
ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1);
|
||||||
ini.Get("Core", "DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false);
|
ini.Get("Core", "DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false);
|
||||||
ini.Get("Core", "CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true);
|
ini.Get("Core", "CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true);
|
||||||
|
|
|
@ -69,6 +69,7 @@ struct SCoreStartupParameter
|
||||||
bool bSkipIdle;
|
bool bSkipIdle;
|
||||||
bool bNTSC;
|
bool bNTSC;
|
||||||
bool bHLE_BS2;
|
bool bHLE_BS2;
|
||||||
|
bool bEnableOpenCL;
|
||||||
bool bUseFastMem;
|
bool bUseFastMem;
|
||||||
bool bLockThreads;
|
bool bLockThreads;
|
||||||
bool bEnableCheats;
|
bool bEnableCheats;
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "HotkeyDlg.h"
|
#include "HotkeyDlg.h"
|
||||||
|
|
||||||
|
#include "..\..\Common\Src\OpenCL.h"
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <Cocoa/Cocoa.h>
|
#include <Cocoa/Cocoa.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,6 +64,7 @@ EVT_CHOICE(ID_FRAMELIMIT, CConfigMain::CoreSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_FRAMELIMIT_USEFPSFORLIMITING, CConfigMain::CoreSettingsChanged)
|
EVT_CHECKBOX(ID_FRAMELIMIT_USEFPSFORLIMITING, CConfigMain::CoreSettingsChanged)
|
||||||
|
|
||||||
EVT_CHECKBOX(ID_ALWAYS_HLE_BS2, CConfigMain::CoreSettingsChanged)
|
EVT_CHECKBOX(ID_ALWAYS_HLE_BS2, CConfigMain::CoreSettingsChanged)
|
||||||
|
EVT_CHECKBOX(ID_ENABLE_OPENCL, CConfigMain::CoreSettingsChanged)
|
||||||
EVT_RADIOBOX(ID_CPUENGINE, CConfigMain::CoreSettingsChanged)
|
EVT_RADIOBOX(ID_CPUENGINE, CConfigMain::CoreSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_LOCKTHREADS, CConfigMain::CoreSettingsChanged)
|
EVT_CHECKBOX(ID_LOCKTHREADS, CConfigMain::CoreSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_DSPTHREAD, CConfigMain::CoreSettingsChanged)
|
EVT_CHECKBOX(ID_DSPTHREAD, CConfigMain::CoreSettingsChanged)
|
||||||
|
@ -158,6 +161,7 @@ void CConfigMain::UpdateGUI()
|
||||||
EnableCheats->Disable();
|
EnableCheats->Disable();
|
||||||
|
|
||||||
AlwaysHLE_BS2->Disable();
|
AlwaysHLE_BS2->Disable();
|
||||||
|
EnableOpenCL->Disable();
|
||||||
CPUEngine->Disable();
|
CPUEngine->Disable();
|
||||||
LockThreads->Disable();
|
LockThreads->Disable();
|
||||||
DSPThread->Disable();
|
DSPThread->Disable();
|
||||||
|
@ -261,6 +265,7 @@ void CConfigMain::InitializeGUIValues()
|
||||||
|
|
||||||
// General - Advanced
|
// General - Advanced
|
||||||
AlwaysHLE_BS2->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2);
|
AlwaysHLE_BS2->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2);
|
||||||
|
EnableOpenCL->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableOpenCL);
|
||||||
CPUEngine->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore);
|
CPUEngine->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore);
|
||||||
LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads);
|
LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads);
|
||||||
DSPThread->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPThread);
|
DSPThread->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPThread);
|
||||||
|
@ -328,6 +333,7 @@ void CConfigMain::InitializeGUITooltips()
|
||||||
|
|
||||||
// General - Advanced
|
// General - Advanced
|
||||||
DSPThread->SetToolTip(wxT("Run DSPLLE on a dedicated thread (not recommended)."));
|
DSPThread->SetToolTip(wxT("Run DSPLLE on a dedicated thread (not recommended)."));
|
||||||
|
EnableOpenCL->SetToolTip(wxT("Allow videocard to accelerate texture decoding."));
|
||||||
|
|
||||||
|
|
||||||
// Display - Display
|
// Display - Display
|
||||||
|
@ -397,6 +403,10 @@ void CConfigMain::CreateGUIControls()
|
||||||
// Core Settings - Advanced
|
// Core Settings - Advanced
|
||||||
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Advanced Settings"));
|
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Advanced Settings"));
|
||||||
AlwaysHLE_BS2 = new wxCheckBox(GeneralPage, ID_ALWAYS_HLE_BS2, wxT("HLE the IPL (recommended)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
AlwaysHLE_BS2 = new wxCheckBox(GeneralPage, ID_ALWAYS_HLE_BS2, wxT("HLE the IPL (recommended)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
EnableOpenCL = new wxCheckBox(GeneralPage, ID_ENABLE_OPENCL, wxT("Enable OpenCL"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
#if !(defined(HAVE_OPENCL) && HAVE_OPENCL)
|
||||||
|
EnableOpenCL->Enable(false);
|
||||||
|
#endif
|
||||||
CPUEngine = new wxRadioBox(GeneralPage, ID_CPUENGINE, wxT("CPU Emulator Engine"), wxDefaultPosition, wxDefaultSize, arrayStringFor_CPUEngine, 0, wxRA_SPECIFY_ROWS);
|
CPUEngine = new wxRadioBox(GeneralPage, ID_CPUENGINE, wxT("CPU Emulator Engine"), wxDefaultPosition, wxDefaultSize, arrayStringFor_CPUEngine, 0, wxRA_SPECIFY_ROWS);
|
||||||
LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
DSPThread = new wxCheckBox(GeneralPage, ID_DSPTHREAD, wxT("DSPLLE on thread"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
DSPThread = new wxCheckBox(GeneralPage, ID_DSPTHREAD, wxT("DSPLLE on thread"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
@ -412,6 +422,7 @@ void CConfigMain::CreateGUIControls()
|
||||||
sbBasic->Add(sFramelimit, 0, wxALL | wxEXPAND, 5);
|
sbBasic->Add(sFramelimit, 0, wxALL | wxEXPAND, 5);
|
||||||
|
|
||||||
sbAdvanced->Add(AlwaysHLE_BS2, 0, wxALL, 5);
|
sbAdvanced->Add(AlwaysHLE_BS2, 0, wxALL, 5);
|
||||||
|
sbAdvanced->Add(EnableOpenCL, 0, wxALL, 5);
|
||||||
sbAdvanced->Add(CPUEngine, 0, wxALL, 5);
|
sbAdvanced->Add(CPUEngine, 0, wxALL, 5);
|
||||||
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
|
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
|
||||||
sbAdvanced->Add(DSPThread, 0, wxALL, 5);
|
sbAdvanced->Add(DSPThread, 0, wxALL, 5);
|
||||||
|
@ -807,6 +818,9 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
|
||||||
case ID_ALWAYS_HLE_BS2:
|
case ID_ALWAYS_HLE_BS2:
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2 = AlwaysHLE_BS2->IsChecked();
|
SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2 = AlwaysHLE_BS2->IsChecked();
|
||||||
break;
|
break;
|
||||||
|
case ID_ENABLE_OPENCL:
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableOpenCL = EnableOpenCL->IsChecked();
|
||||||
|
break;
|
||||||
case ID_CPUENGINE:
|
case ID_CPUENGINE:
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUEngine->GetSelection();
|
SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUEngine->GetSelection();
|
||||||
if (main_frame->g_pCodeWindow)
|
if (main_frame->g_pCodeWindow)
|
||||||
|
|
|
@ -67,6 +67,7 @@ private:
|
||||||
|
|
||||||
// Advanced
|
// Advanced
|
||||||
wxCheckBox* AlwaysHLE_BS2;
|
wxCheckBox* AlwaysHLE_BS2;
|
||||||
|
wxCheckBox* EnableOpenCL;
|
||||||
wxRadioBox* CPUEngine;
|
wxRadioBox* CPUEngine;
|
||||||
wxCheckBox* DSPThread;
|
wxCheckBox* DSPThread;
|
||||||
wxCheckBox* LockThreads;
|
wxCheckBox* LockThreads;
|
||||||
|
@ -185,6 +186,7 @@ private:
|
||||||
ID_FRAMELIMIT_USEFPSFORLIMITING,
|
ID_FRAMELIMIT_USEFPSFORLIMITING,
|
||||||
|
|
||||||
ID_ALWAYS_HLE_BS2,
|
ID_ALWAYS_HLE_BS2,
|
||||||
|
ID_ENABLE_OPENCL,
|
||||||
ID_CPUENGINE,
|
ID_CPUENGINE,
|
||||||
ID_LOCKTHREADS,
|
ID_LOCKTHREADS,
|
||||||
ID_DSPTHREAD,
|
ID_DSPTHREAD,
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include "OpenCL.h"
|
#include "OpenCL.h"
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||||
#include "OpenCL/OCLTextureDecoder.h"
|
#include "OpenCL/OCLTextureDecoder.h"
|
||||||
|
#include "VideoConfig.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
u8* g_pVideoData = 0;
|
u8* g_pVideoData = 0;
|
||||||
|
@ -385,8 +386,11 @@ void OpcodeDecoder_Init()
|
||||||
g_pVideoData = FAKE_GetFifoStartPtr();
|
g_pVideoData = FAKE_GetFifoStartPtr();
|
||||||
|
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||||
|
if (g_Config.bEnableOpenCL)
|
||||||
|
{
|
||||||
OpenCL::Initialize();
|
OpenCL::Initialize();
|
||||||
TexDecoder_OpenCL_Initialize();
|
TexDecoder_OpenCL_Initialize();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,8 +398,11 @@ void OpcodeDecoder_Init()
|
||||||
void OpcodeDecoder_Shutdown()
|
void OpcodeDecoder_Shutdown()
|
||||||
{
|
{
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||||
|
if (g_Config.bEnableOpenCL)
|
||||||
|
{
|
||||||
TexDecoder_OpenCL_Shutdown();
|
TexDecoder_OpenCL_Shutdown();
|
||||||
OpenCL::Destroy();
|
OpenCL::Destroy();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "OpenCL.h"
|
#include "OpenCL.h"
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||||
#include "OpenCL/OCLTextureDecoder.h"
|
#include "OpenCL/OCLTextureDecoder.h"
|
||||||
|
#include "VideoConfig.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "LookUpTables.h"
|
#include "LookUpTables.h"
|
||||||
|
@ -1269,6 +1270,7 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in
|
||||||
PC_TexFormat retval = PC_TEX_FMT_NONE;
|
PC_TexFormat retval = PC_TEX_FMT_NONE;
|
||||||
|
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||||
|
if (g_Config.bEnableOpenCL)
|
||||||
retval = TexDecoder_Decode_OpenCL(dst, src, width, height, texformat, tlutaddr, tlutfmt, rgbaOnly);
|
retval = TexDecoder_Decode_OpenCL(dst, src, width, height, texformat, tlutaddr, tlutfmt, rgbaOnly);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@ void VideoConfig::Load(const char *ini_file)
|
||||||
bool bTmp;
|
bool bTmp;
|
||||||
iniFile.Get("Interface", "UsePanicHandlers", &bTmp, true);
|
iniFile.Get("Interface", "UsePanicHandlers", &bTmp, true);
|
||||||
SetEnableAlert(bTmp);
|
SetEnableAlert(bTmp);
|
||||||
|
iniFile.Get("Core", "EnableOpenCL", &bEnableOpenCL, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoConfig::GameIniLoad(const char *ini_file)
|
void VideoConfig::GameIniLoad(const char *ini_file)
|
||||||
|
|
|
@ -78,6 +78,9 @@ struct VideoConfig
|
||||||
bool bAutoScale; // Removes annoying borders without using XFB. Doesn't always work perfectly.
|
bool bAutoScale; // Removes annoying borders without using XFB. Doesn't always work perfectly.
|
||||||
bool bUseNativeMips;
|
bool bUseNativeMips;
|
||||||
|
|
||||||
|
// OpenCL
|
||||||
|
bool bEnableOpenCL;
|
||||||
|
|
||||||
// Enhancements
|
// Enhancements
|
||||||
int iMultisampleMode;
|
int iMultisampleMode;
|
||||||
int iEFBScale;
|
int iEFBScale;
|
||||||
|
|
Loading…
Reference in New Issue