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.
This commit is contained in:
2017-08-19 04:11:25 +02:00
parent 1cc4033df8
commit cfa8b762e2
28 changed files with 192 additions and 271 deletions

View File

@@ -60,14 +60,14 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
ccl_global float *buffer = kernel_split_params.buffer;
buffer += (kernel_split_params.offset + pixel_x + pixel_y * kernel_split_params.stride) * kernel_data.film.pass_stride;
RNG rng = kernel_split_state.rng[ray_index];
uint rng_hash;
/* Initialize random numbers and ray. */
kernel_path_trace_setup(kg,
rng_state,
my_sample,
pixel_x, pixel_y,
&rng,
&rng_hash,
&kernel_split_state.ray[ray_index]);
if(kernel_split_state.ray[ray_index].t != 0.0f) {
@@ -79,7 +79,7 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
path_state_init(kg,
&kernel_split_state.sd_DL_shadow[ray_index],
&kernel_split_state.path_state[ray_index],
&rng,
rng_hash,
my_sample,
&kernel_split_state.ray[ray_index]);
#ifdef __SUBSURFACE__
@@ -93,7 +93,6 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
kernel_write_pass_float4(buffer, my_sample, L_rad);
ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE);
}
kernel_split_state.rng[ray_index] = rng;
}
CCL_NAMESPACE_END