[Bf-blender-cvs] [b59d85b5a56] master: Cycles: Fixed OpenCL build. sqr(float4) is available on CUDA and CPU, but not on OpenCL.

Stefan Werner noreply at git.blender.org
Mon Jul 30 15:41:56 CEST 2018


Commit: b59d85b5a56c020c7b86b0cca4dc38e4950550f9
Author: Stefan Werner
Date:   Mon Jul 30 15:42:00 2018 +0200
Branches: master
https://developer.blender.org/rBb59d85b5a56c020c7b86b0cca4dc38e4950550f9

Cycles: Fixed OpenCL build. sqr(float4) is available on CUDA and CPU, but not on OpenCL.

===================================================================

M	intern/cycles/kernel/kernel_light.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index b5a777efa78..2a300d3419e 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -75,7 +75,7 @@ ccl_device_inline float area_light_sample(float3 P,
 	/* Compute internal angles (gamma_i). */
 	float4 diff = make_float4(x0, y1, x1, y0) - make_float4(x1, y0, x0, y1);
 	float4 nz = make_float4(y0, x1, y1, x0) * diff;
-	nz = nz / sqrt(sqr(z0 * diff) + sqr(nz));
+	nz = nz / sqrt(z0 * z0 * diff * diff + nz * nz);
 	float g0 = safe_acosf(-nz.x * nz.y);
 	float g1 = safe_acosf(-nz.y * nz.z);
 	float g2 = safe_acosf(-nz.z * nz.w);



More information about the Bf-blender-cvs mailing list