diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index edbc574be1..f37ef8ebf8 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -104,6 +104,7 @@ set(GSdxSources GSPerfMon.cpp GSRasterizer.cpp GSRenderer.cpp + GSRendererCL.cpp GSRendererHW.cpp GSRendererNull.cpp GSRendererOGL.cpp diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 5d91813659..cb36a03226 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -27,6 +27,7 @@ #include "GSDeviceNull.h" #include "GSDeviceOGL.h" #include "GSRendererOGL.h" +#include "GSRendererCL.h" #ifdef _WINDOWS @@ -37,7 +38,6 @@ #include "GSWndDX.h" #include "GSWndWGL.h" #include "GSRendererCS.h" -#include "GSRendererCL.h" #include "GSSettingsDlg.h" static HRESULT s_hr = E_FAIL; @@ -265,7 +265,9 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1) s_gs = new GSRendererNull(); break; case 14: case 15: case 16: case 17: +#ifdef ENABLE_OPENCL s_gs = new GSRendererCL(); +#endif break; } diff --git a/plugins/GSdx/GSRendererCL.cpp b/plugins/GSdx/GSRendererCL.cpp index 2eb9519e4e..e4b22d63e2 100644 --- a/plugins/GSdx/GSRendererCL.cpp +++ b/plugins/GSdx/GSRendererCL.cpp @@ -22,6 +22,8 @@ #include "stdafx.h" #include "GSRendererCL.h" +#ifdef ENABLE_OPENCL + #define LOG 0 static FILE* s_fp = LOG ? fopen("c:\\temp1\\_.txt", "w") : NULL; @@ -2002,3 +2004,4 @@ cl::Kernel& GSRendererCL::CL::GetTFXKernel(const TFXSelector& sel) return tfx_map[sel]; } +#endif diff --git a/plugins/GSdx/GSRendererCL.h b/plugins/GSdx/GSRendererCL.h index 683b161768..e0afe67a22 100644 --- a/plugins/GSdx/GSRendererCL.h +++ b/plugins/GSdx/GSRendererCL.h @@ -23,6 +23,8 @@ #include "GSRenderer.h" +#ifdef ENABLE_OPENCL + __aligned(struct, 32) GSVertexCL { GSVector4 p, t; @@ -252,3 +254,5 @@ public: GSRendererCL(); virtual ~GSRendererCL(); }; + +#endif diff --git a/plugins/GSdx/GSUtil.cpp b/plugins/GSdx/GSUtil.cpp index 40df3690e4..791aa56f5f 100644 --- a/plugins/GSdx/GSUtil.cpp +++ b/plugins/GSdx/GSUtil.cpp @@ -228,6 +228,7 @@ bool GSUtil::CheckSSE() #define OCL_PROGRAM_VERSION 1 +#ifdef ENABLE_OPENCL void GSUtil::GetDeviceDescs(list& dl) { dl.clear(); @@ -319,6 +320,7 @@ string GSUtil::GetDeviceUniqueName(cl::Device& device) return vendor + " " + name + " " + version + " " + type; } +#endif #ifdef _WINDOWS diff --git a/plugins/GSdx/GSUtil.h b/plugins/GSdx/GSUtil.h index ca90869ed1..5a722cd251 100644 --- a/plugins/GSdx/GSUtil.h +++ b/plugins/GSdx/GSUtil.h @@ -25,7 +25,9 @@ struct OCLDeviceDesc { +#ifdef ENABLE_OPENCL cl::Device device; +#endif string name; int version; string tmppath; @@ -48,8 +50,10 @@ public: static bool CheckSSE(); +#ifdef ENABLE_OPENCL static void GetDeviceDescs(list& dl); static string GetDeviceUniqueName(cl::Device& device); +#endif #ifdef _WINDOWS diff --git a/plugins/GSdx/config.h b/plugins/GSdx/config.h index 3ad4756bc9..323bfaae0e 100644 --- a/plugins/GSdx/config.h +++ b/plugins/GSdx/config.h @@ -45,3 +45,7 @@ // Output stencil to a color buffer //#define ENABLE_OGL_STENCIL_DEBUG + +#ifdef _WINDOWS +#define ENABLE_OPENCL +#endif diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index cef3dcbe72..52e564eee1 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -44,9 +44,6 @@ #include #include "../../common/include/comptr.h" -#define CL_USE_DEPRECATED_OPENCL_1_1_APIS -#define __CL_ENABLE_EXCEPTIONS -#include #define D3DCOLORWRITEENABLE_RGBA (D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_ALPHA) #define D3D11_SHADER_MACRO D3D10_SHADER_MACRO @@ -54,6 +51,15 @@ #endif + +#ifdef ENABLE_OPENCL + +#define CL_USE_DEPRECATED_OPENCL_1_1_APIS +#define __CL_ENABLE_EXCEPTIONS +#include + +#endif + // put these into vc9/common7/ide/usertype.dat to have them highlighted typedef unsigned char uint8;