Cycles: Fix NLM denoising kernels zeroing the wrong buffer on OpenCL
authorLukas Stockner <lukas.stockner@freenet.de>
Mon, 8 Oct 2018 22:03:47 +0000 (00:03 +0200)
committerLukas Stockner <lukas.stockner@freenet.de>
Mon, 8 Oct 2018 22:14:29 +0000 (00:14 +0200)
Since my temporary buffer commit (about a month ago), the OpenCL device was zeroing the wrong buffer, leading to
completely wrong filtered feature passes and therefore significantly lower-quality results than CPU and CUDA.

intern/cycles/device/opencl/opencl_base.cpp

index ffd3b7d762521f1c002f2bd55b1ad1124619af0d..1e73d37d7a4462c9f2b4c83c72a8cb4011b11087 100644 (file)
@@ -761,7 +761,7 @@ bool OpenCLDeviceBase::denoising_non_local_means(device_ptr image_ptr,
        cl_mem variance_mem = CL_MEM_PTR(variance_ptr);
        cl_mem out_mem = CL_MEM_PTR(out_ptr);
 
-       mem_zero_kernel(*difference, sizeof(float)*pass_stride);
+       mem_zero_kernel(*weightAccum, sizeof(float)*pass_stride);
        mem_zero_kernel(out_ptr, sizeof(float)*pass_stride);
 
        cl_kernel ckNLMCalcDifference = denoising_program(ustring("filter_nlm_calc_difference"));