[Bf-blender-cvs] [8fff6cc2f5] master: Cycles: Fix building of OpenCL kernels

Mai Lavelle noreply at git.blender.org
Tue Mar 21 03:56:42 CET 2017


Commit: 8fff6cc2f56a088c4c9d3112bdb94b85bc9cb498
Author: Mai Lavelle
Date:   Mon Mar 20 22:51:36 2017 -0400
Branches: master
https://developer.blender.org/rB8fff6cc2f56a088c4c9d3112bdb94b85bc9cb498

Cycles: Fix building of OpenCL kernels

Theres no overloading of functions in OpenCL so we can't make use of
`safe_normalize` with `float2`.

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

M	intern/cycles/kernel/closure/bsdf_microfacet_multi.h

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

diff --git a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
index aa4b91eac4..1dd2407803 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
@@ -83,7 +83,7 @@ ccl_device_forceinline float3 mf_sample_vndf(const float3 wi, const float2 alpha
 	const float3 wi_11 = normalize(make_float3(alpha.x*wi.x, alpha.y*wi.y, wi.z));
 	const float2 slope_11 = mf_sampleP22_11(wi_11.z, randU);
 
-	const float2 cossin_phi = safe_normalize(make_float2(wi_11.x, wi_11.y));
+	const float3 cossin_phi = safe_normalize(make_float3(wi_11.x, wi_11.y, 0.0f));
 	const float slope_x = alpha.x*(cossin_phi.x * slope_11.x - cossin_phi.y * slope_11.y);
 	const float slope_y = alpha.y*(cossin_phi.y * slope_11.x + cossin_phi.x * slope_11.y);




More information about the Bf-blender-cvs mailing list