diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-08 17:03:09 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-08 17:03:09 +0400 |
commit | 45aeee6a34e71060e672fba2ea6713e8f04659d0 (patch) | |
tree | cef1574660793bcb07850ef1d765053673838cb8 /source/blender/compositor/operations/COM_DilateErodeOperation.cpp | |
parent | 4bc818d240566e18a073efaaf8924960522a6260 (diff) |
Multi device OpenCL did not work.
case was that cached kernels were used by both devices in separate
threads.
removed the cached kernels.
Diffstat (limited to 'source/blender/compositor/operations/COM_DilateErodeOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_DilateErodeOperation.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp index 338a3a0b59b..a9b40f8a6ac 100644 --- a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp +++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp @@ -234,15 +234,13 @@ bool DilateDistanceOperation::determineDependingAreaOfInterest(rcti *input, Read return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } -static cl_kernel dilateKernel = 0; void DilateDistanceOperation::executeOpenCL(OpenCLDevice* device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) { - if (!dilateKernel) { - dilateKernel = device->COM_clCreateKernel("dilateKernel", NULL); - } + cl_kernel dilateKernel = device->COM_clCreateKernel("dilateKernel", NULL); + cl_int distanceSquared = this->m_distance * this->m_distance; cl_int scope = this->m_scope; @@ -293,15 +291,13 @@ void ErodeDistanceOperation::executePixel(float *color, int x, int y, MemoryBuff color[0] = value; } -static cl_kernel erodeKernel = 0; void ErodeDistanceOperation::executeOpenCL(OpenCLDevice* device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) { - if (!erodeKernel) { - erodeKernel = device->COM_clCreateKernel("erodeKernel", NULL); - } + cl_kernel erodeKernel = device->COM_clCreateKernel("erodeKernel", NULL); + cl_int distanceSquared = this->m_distance * this->m_distance; cl_int scope = this->m_scope; |