Cycles: Initialize portal variable directly, so we can avoid the one NULL check.
authorThomas Dinges <blender@dingto.org>
Mon, 27 Apr 2015 21:12:53 +0000 (23:12 +0200)
committerThomas Dinges <blender@dingto.org>
Mon, 27 Apr 2015 21:12:53 +0000 (23:12 +0200)
intern/cycles/kernel/kernel_light.h

index d1b8db2c018f3f25122b946046c021d61579a6ac..704fb49efc9ebad70965cc6a3750553713cdd0ae 100644 (file)
@@ -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) {