Code refactor: remove unnecessary RNG offset in branched path code.

This is only needed for SSS which bounces to a different shading point.
This commit is contained in:
Brecht Van Lommel 2018-02-08 13:58:02 +01:00
parent 8c8e53c12d
commit 28e2bc90dd
3 changed files with 2 additions and 2 deletions

View File

@ -372,6 +372,7 @@ ccl_device void kernel_branched_path_subsurface_scatter(KernelGlobals *kg,
PathState hit_state = *state;
path_state_branch(&hit_state, j, num_samples);
hit_state.rng_offset += PRNG_BOUNCE_NUM;
#ifdef __VOLUME__
if(need_update_volume_stack) {

View File

@ -231,8 +231,6 @@ ccl_device_inline void path_state_branch(ccl_addr_space PathState *state,
int branch,
int num_branches)
{
state->rng_offset += PRNG_BOUNCE_NUM;
if(num_branches > 1) {
/* Path is splitting into a branch, adjust so that each branch
* still gets a unique sample from the same sequence. */

View File

@ -117,6 +117,7 @@ ccl_device_noinline bool kernel_split_branched_path_subsurface_indirect_light_it
*hit_state = branched_state->path_state;
path_state_branch(hit_state, j, num_samples);
hit_state->rng_offset += PRNG_BOUNCE_NUM;
#ifdef __VOLUME__
if(need_update_volume_stack) {