diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-09 14:55:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-09 14:56:37 +0300 |
commit | fd94d2d80fc4b1da6095987e2bef6ec5b42eda8d (patch) | |
tree | 3f3fdfa2f67545876d28584a9acf8be4d09e8a56 /source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp | |
parent | a1549bc47a2e5c94f3ccf5d618d6a7f86165043a (diff) |
T37832: OpenCL compositing bug in defocus node
The issue seems to be caused by the integer overflow. It's actually
still needed to investigate why exactly buffer contained such a huge
value, but the patch is still legit and seems to be solving the issue
just nicely.
Diffstat (limited to 'source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index 4809efd7436..6e4caeef613 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -200,8 +200,8 @@ void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device, const float max_dim = max(m_width, m_height); cl_float scalar = this->m_do_size_scale ? (max_dim / 100.0f) : 1.0f; - maxBlur = (cl_int)sizeMemoryBuffer->getMaximumValue() * scalar; - maxBlur = min(maxBlur, this->m_maxBlur); + maxBlur = (cl_int)min_ff(sizeMemoryBuffer->getMaximumValue() * scalar, + (float)this->m_maxBlur); device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 1, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBokehProgram); |