Cycles: Avoid segment NULL check, we access it before this function already.

This commit is contained in:
Thomas Dinges 2014-08-14 15:52:19 +02:00
parent b42b0554ea
commit 6e5d188d17

@ -139,7 +139,6 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
float3 tp = throughput;
/* sample position on volume segment */
if(segment) {
float rphase = path_branched_rng_1D_for_decision(kg, rng, state, j, num_samples, PRNG_PHASE);
float rscatter = path_branched_rng_1D_for_decision(kg, rng, state, j, num_samples, PRNG_SCATTER_DISTANCE);
@ -151,7 +150,6 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
/* todo: split up light_sample so we don't have to call it again with new position */
light_select(kg, i, light_u, light_v, sd->P, &ls);
}
if(ls.pdf == 0.0f)
continue;
@ -192,7 +190,6 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
float3 tp = throughput;
/* sample position on volume segment */
if(segment) {
float rphase = path_branched_rng_1D_for_decision(kg, rng, state, j, num_samples, PRNG_PHASE);
float rscatter = path_branched_rng_1D_for_decision(kg, rng, state, j, num_samples, PRNG_SCATTER_DISTANCE);
@ -204,7 +201,6 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
/* todo: split up light_sample so we don't have to call it again with new position */
light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls);
}
if(ls.pdf == 0.0f)
continue;
@ -233,7 +229,6 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
float3 tp = throughput;
/* sample position on volume segment */
if(segment) {
float rphase = path_state_rng_1D_for_decision(kg, rng, state, PRNG_PHASE);
float rscatter = path_state_rng_1D_for_decision(kg, rng, state, PRNG_SCATTER_DISTANCE);
@ -245,7 +240,6 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
/* todo: split up light_sample so we don't have to call it again with new position */
light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls);
}
if(ls.pdf == 0.0f)
return;