[Bf-blender-cvs] [58a2b10] master: Cycles: Initialize portal variable directly, so we can avoid the one NULL check.

Thomas Dinges noreply at git.blender.org
Mon Apr 27 23:14:10 CEST 2015


Commit: 58a2b10a65872b2e4a3654a54a83e6f94bf4e229
Author: Thomas Dinges
Date:   Mon Apr 27 23:12:53 2015 +0200
Branches: master
https://developer.blender.org/rB58a2b10a65872b2e4a3654a54a83e6f94bf4e229

Cycles: Initialize portal variable directly, so we can avoid the one NULL check.

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

M	intern/cycles/kernel/kernel_light.h

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

diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index d1b8db2..704fb49 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -256,8 +256,6 @@ ccl_device float background_portal_pdf(KernelGlobals *kg,
                                        bool *is_possible)
 {
 	float portal_pdf = 0.0f;
-	if(is_possible)
-		*is_possible = false;
 
 	for(int p = 0; p < kernel_data.integrator.num_portals; p++) {
 		if(p == ignore_portal)
@@ -437,7 +435,7 @@ ccl_device float background_light_pdf(KernelGlobals *kg, float3 P, float3 direct
 	float portal_sampling_pdf = kernel_data.integrator.portal_pdf;
 
 	if(portal_sampling_pdf > 0.0f) {
-		bool is_possible;
+		bool is_possible = false;
 		float portal_pdf = background_portal_pdf(kg, P, direction, -1, &is_possible);
 		if(portal_pdf == 0.0f) {
 			if(portal_sampling_pdf == 1.0f) {




More information about the Bf-blender-cvs mailing list