diff options
Diffstat (limited to 'source/blender/compositor')
8 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt index 9c539e2dd1c..4bcdd4d9e34 100644 --- a/source/blender/compositor/CMakeLists.txt +++ b/source/blender/compositor/CMakeLists.txt @@ -39,7 +39,7 @@ set(INC ../nodes/intern ../render/extern/include ../render/intern/include - ../../../intern/opencl + ../../../extern/clew/include ../../../intern/guardedalloc ) @@ -540,4 +540,6 @@ list(APPEND INC data_to_c(${CMAKE_CURRENT_SOURCE_DIR}/operations/COM_OpenCLKernels.cl ${CMAKE_CURRENT_BINARY_DIR}/operations/COM_OpenCLKernels.cl.h SRC) +add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS) + blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/compositor/SConscript b/source/blender/compositor/SConscript index 073b100e156..eab40873f64 100644 --- a/source/blender/compositor/SConscript +++ b/source/blender/compositor/SConscript @@ -26,7 +26,7 @@ # ***** END GPL LICENSE BLOCK ***** Import ('env') -defs = ['GLEW_STATIC'] +defs = ['GLEW_STATIC', 'CL_USE_DEPRECATED_OPENCL_1_1_APIS'] sources_intern = env.Glob('intern/*.cpp') sources_nodes = env.Glob('nodes/*.cpp') @@ -37,7 +37,7 @@ incs = [ 'intern', 'nodes', 'operations', - '#/intern/opencl', + '#/extern/clew/include', '../blenkernel', '../blenlib', '../imbuf', diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index b2b8f03c476..d9c16615fb6 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -38,7 +38,7 @@ extern "C" { #include "COM_MemoryProxy.h" #include "COM_SocketReader.h" -#include "OCL_opencl.h" +#include "clew.h" using std::list; using std::min; diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cpp b/source/blender/compositor/intern/COM_OpenCLDevice.cpp index 2cfc10cff29..c5b663d2aef 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.cpp +++ b/source/blender/compositor/intern/COM_OpenCLDevice.cpp @@ -103,7 +103,7 @@ void OpenCLDevice::COM_clAttachMemoryBufferOffsetToKernelParameter(cl_kernel ker if (offsetIndex != -1) { cl_int error; rcti *rect = memoryBuffer->getRect(); - cl_int2 offset = {rect->xmin, rect->ymin}; + cl_int2 offset = {{rect->xmin, rect->ymin}}; error = clSetKernelArg(kernel, offsetIndex, sizeof(cl_int2), &offset); if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } @@ -114,7 +114,7 @@ void OpenCLDevice::COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offse { if (offsetIndex != -1) { cl_int error; - cl_int2 offset = {(cl_int)operation->getWidth(), (cl_int)operation->getHeight()}; + cl_int2 offset = {{(cl_int)operation->getWidth(), (cl_int)operation->getHeight()}}; error = clSetKernelArg(kernel, offsetIndex, sizeof(cl_int2), &offset); if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } @@ -154,7 +154,7 @@ void OpenCLDevice::COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemo bool breaked = false; for (offsety = 0; offsety < height && (!breaked); offsety += localSize) { - offset[1] = offsety; + offset.y = offsety; if (offsety + localSize < height) { size[1] = localSize; } @@ -169,7 +169,7 @@ void OpenCLDevice::COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemo else { size[0] = width - offsetx; } - offset[0] = offsetx; + offset.x = offsetx; error = clSetKernelArg(kernel, offsetIndex, sizeof(cl_int2), &offset); if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h index 50cc6f25f70..94df2f2b44c 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.h +++ b/source/blender/compositor/intern/COM_OpenCLDevice.h @@ -26,7 +26,7 @@ class OpenCLDevice; #define _COM_OpenCLDevice_h #include "COM_Device.h" -#include "OCL_opencl.h" +#include "clew.h" #include "COM_WorkScheduler.h" #include "COM_ReadBufferOperation.h" diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index d60f9cb7f10..e1016731c7f 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -28,7 +28,7 @@ #include "COM_CPUDevice.h" #include "COM_OpenCLDevice.h" #include "COM_OpenCLKernels.cl.h" -#include "OCL_opencl.h" +#include "clew.h" #include "COM_WriteBufferOperation.h" #include "MEM_guardedalloc.h" @@ -274,7 +274,7 @@ bool WorkScheduler::hasGPUDevices() #endif } -static void clContextError(const char *errinfo, const void *private_info, size_t cb, void *user_data) +static void CL_CALLBACK clContextError(const char *errinfo, const void *private_info, size_t cb, void *user_data) { printf("OPENCL error: %s\n", errinfo); } @@ -326,7 +326,7 @@ void WorkScheduler::initialize(bool use_opencl, int num_cpu_threads) g_context = NULL; g_program = NULL; - if (!OCL_init()) /* this will check for errors and skip if already initialized */ + if (clewInit() != CLEW_SUCCESS) /* this will check for errors and skip if already initialized */ return; if (clCreateContextFromType) { diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp index 99655c67a3f..ec9ef6c7e68 100644 --- a/source/blender/compositor/intern/COM_compositor.cpp +++ b/source/blender/compositor/intern/COM_compositor.cpp @@ -32,7 +32,7 @@ extern "C" { #include "COM_compositor.h" #include "COM_ExecutionSystem.h" #include "COM_WorkScheduler.h" -#include "OCL_opencl.h" +#include "clew.h" #include "COM_MovieDistortionOperation.h" static ThreadMutex s_compositorMutex; diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp index 0cea2a7183f..67f52934b13 100644 --- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp @@ -109,8 +109,8 @@ void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device, cl_kernel directionalBlurKernel = device->COM_clCreateKernel("directionalBlurKernel", NULL); cl_int iterations = pow(2.0f, this->m_data->iter); - cl_float2 ltxy = {this->m_tx, this->m_ty}; - cl_float2 centerpix = {this->m_center_x_pix, this->m_center_y_pix}; + cl_float2 ltxy = {{this->m_tx, this->m_ty}}; + cl_float2 centerpix = {{this->m_center_x_pix, this->m_center_y_pix}}; cl_float lsc = this->m_sc; cl_float lrot = this->m_rot; |