From e2d899231019ecb9e93af77cb0d57acd6fbb10c2 Mon Sep 17 00:00:00 2001 From: Hamish Date: Thu, 12 Sep 2019 00:59:33 +0000 Subject: [PATCH] GSdx: Enable OpenCL on Linux (#3099) --- build.sh | 2 ++ cmake/BuildParameters.cmake | 2 +- plugins/GSdx/CMakeLists.txt | 2 +- plugins/GSdx/GSdx.cpp | 4 +--- plugins/GSdx/res/tfx.cl | 6 ------ 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index 2f5b454ea3..e1bc256475 100755 --- a/build.sh +++ b/build.sh @@ -219,6 +219,7 @@ for ARG in "$@"; do --no-cross-multilib ) useCross=0; ;; --coverity ) CoverityBuild=1; cleanBuild=1; ;; --vtune ) flags="$flags -DUSE_VTUNE=TRUE" ;; + --opencl ) flags="$flags -DOPENCL_API=TRUE" ;; -D* ) flags="$flags $ARG" ;; *) @@ -239,6 +240,7 @@ for ARG in "$@"; do echo "--glsl : Replace CG backend of ZZogl by GLSL" echo "--egl : Replace GLX by EGL (ZZogl/GSdx plugins)" echo "--cross-multilib: Build a 32bit PCSX2 on a 64bit machine using multilib." + echo "--opencl : Enable experimental OpenCL support" echo echo "** Distribution Compatibilities **" echo "--sdl12 : Build with SDL1.2 (requires if wx is linked against SDL1.2)" diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 53f43bc2a6..235bdb8e59 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -35,7 +35,7 @@ option(USE_VTUNE "Plug VTUNE to profile GSdx JIT.") #------------------------------------------------------------------------------- option(GLSL_API "Replace ZZogl CG backend by GLSL (experimental option)") option(EGL_API "Use EGL on ZZogl/GSdx (experimental/developer option)") -option(OPENCL_API "Add OpenCL suppport on GSdx") +option(OPENCL_API "Add OpenCL support on GSdx") option(REBUILD_SHADER "Rebuild GLSL/CG shader (developer option)") option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option)") option(GSDX_LEGACY "Build a GSdx legacy plugin compatible with GL3.3") diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 9f3ca3c261..f5d135b33b 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -48,7 +48,7 @@ if(EGL_API AND EGL_FOUND) endif() -if(OPENCL_API) +if(OPENCL_FOUND) set(GSdxFinalFlags ${GSdxFinalFlags} -DENABLE_OPENCL) endif() diff --git a/plugins/GSdx/GSdx.cpp b/plugins/GSdx/GSdx.cpp index 434e7be355..67bdae2108 100644 --- a/plugins/GSdx/GSdx.cpp +++ b/plugins/GSdx/GSdx.cpp @@ -353,9 +353,6 @@ void GSdxApp::Init() // D3D Blending option m_default_configuration["accurate_blending_unit_d3d11"] = "1"; - // OpenCL device. Windows only for now. - m_default_configuration["ocldev"] = ""; - // PSX option. Not supported on linux. m_default_configuration["dithering"] = "1"; m_default_configuration["ModeRefreshRate"] = "0"; @@ -397,6 +394,7 @@ void GSdxApp::Init() m_default_configuration["ModeHeight"] = "480"; m_default_configuration["ModeWidth"] = "640"; m_default_configuration["NTSC_Saturation"] = "1"; + m_default_configuration["ocldev"] = ""; #ifdef _WIN32 m_default_configuration["osd_fontname"] = "C:\\Windows\\Fonts\\tahoma.ttf"; #else diff --git a/plugins/GSdx/res/tfx.cl b/plugins/GSdx/res/tfx.cl index 91bebeed11..0d461bba75 100644 --- a/plugins/GSdx/res/tfx.cl +++ b/plugins/GSdx/res/tfx.cl @@ -1,9 +1,3 @@ -#if defined(CL_VERSION_2_0) - -#error hello - -#endif - #if defined(CL_VERSION_1_1) || defined(CL_VERSION_1_2) // make safe to include in resource file to enforce dependency #ifdef cl_amd_printf