mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ocl: Add a ENABLE_OPENCL option
* Allow to compile GSdx on linux without opencl yet.
This commit is contained in:
parent
b9b02cf749
commit
76f719e5d0
|
@ -104,6 +104,7 @@ set(GSdxSources
|
|||
GSPerfMon.cpp
|
||||
GSRasterizer.cpp
|
||||
GSRenderer.cpp
|
||||
GSRendererCL.cpp
|
||||
GSRendererHW.cpp
|
||||
GSRendererNull.cpp
|
||||
GSRendererOGL.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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -228,6 +228,7 @@ bool GSUtil::CheckSSE()
|
|||
|
||||
#define OCL_PROGRAM_VERSION 1
|
||||
|
||||
#ifdef ENABLE_OPENCL
|
||||
void GSUtil::GetDeviceDescs(list<OCLDeviceDesc>& dl)
|
||||
{
|
||||
dl.clear();
|
||||
|
@ -319,6 +320,7 @@ string GSUtil::GetDeviceUniqueName(cl::Device& device)
|
|||
|
||||
return vendor + " " + name + " " + version + " " + type;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
|
|
|
@ -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<OCLDeviceDesc>& dl);
|
||||
static string GetDeviceUniqueName(cl::Device& device);
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
|
|
|
@ -45,3 +45,7 @@
|
|||
|
||||
// Output stencil to a color buffer
|
||||
//#define ENABLE_OGL_STENCIL_DEBUG
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define ENABLE_OPENCL
|
||||
#endif
|
||||
|
|
|
@ -44,9 +44,6 @@
|
|||
#include <comutil.h>
|
||||
#include "../../common/include/comptr.h"
|
||||
|
||||
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
|
||||
#define __CL_ENABLE_EXCEPTIONS
|
||||
#include <CL/cl.hpp>
|
||||
|
||||
#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 <CL/cl.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
// put these into vc9/common7/ide/usertype.dat to have them highlighted
|
||||
|
||||
typedef unsigned char uint8;
|
||||
|
|
Loading…
Reference in New Issue