diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-08-19 05:11:25 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-08-19 19:14:16 +0300 |
commit | cfa8b762e20dce2e59aff5dffed872a9e3631f3c (patch) | |
tree | 60af71217099a654f1ced2de0c6a730fbd9b0fdc /intern/cycles/kernel/kernel_path_subsurface.h | |
parent | 1cc4033df8d7fdd87bc1be14e265ab77f0713e54 (diff) |
Code cleanup: move rng into path state.
Also pass by value and don't write back now that it is just a hash for seeding
and no longer an LCG state. Together this makes CUDA a tiny bit faster in my
tests, but mainly simplifies code.
Diffstat (limited to 'intern/cycles/kernel/kernel_path_subsurface.h')
-rw-r--r-- | intern/cycles/kernel/kernel_path_subsurface.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/intern/cycles/kernel/kernel_path_subsurface.h b/intern/cycles/kernel/kernel_path_subsurface.h index 10b568ac3dd..5fce5ed59d2 100644 --- a/intern/cycles/kernel/kernel_path_subsurface.h +++ b/intern/cycles/kernel/kernel_path_subsurface.h @@ -28,7 +28,6 @@ bool kernel_path_subsurface_scatter( ShaderData *emission_sd, PathRadiance *L, ccl_addr_space PathState *state, - RNG *rng, ccl_addr_space Ray *ray, ccl_addr_space float3 *throughput, ccl_addr_space SubsurfaceIndirectRays *ss_indirect) @@ -47,11 +46,11 @@ bool kernel_path_subsurface_scatter( */ kernel_assert(!ss_indirect->tracing); - uint lcg_state = lcg_state_init(rng, state->rng_offset, state->sample, 0x68bc21eb); + uint lcg_state = lcg_state_init(state, 0x68bc21eb); SubsurfaceIntersection ss_isect; float bssrdf_u, bssrdf_v; - path_state_rng_2D(kg, rng, state, PRNG_BSDF_U, &bssrdf_u, &bssrdf_v); + path_state_rng_2D(kg, state, PRNG_BSDF_U, &bssrdf_u, &bssrdf_v); int num_hits = subsurface_scatter_multi_intersect(kg, &ss_isect, sd, @@ -94,10 +93,9 @@ bool kernel_path_subsurface_scatter( hit_L->direct_throughput = L->direct_throughput; path_radiance_copy_indirect(hit_L, L); - kernel_path_surface_connect_light(kg, rng, sd, emission_sd, *hit_tp, state, hit_L); + kernel_path_surface_connect_light(kg, sd, emission_sd, *hit_tp, state, hit_L); if(kernel_path_surface_bounce(kg, - rng, sd, hit_tp, hit_state, |