Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_next_iteration_setup.h
| Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | if(IS_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_DL) || | ||||
| float3 _throughput = kernel_split_state.throughput[ray_index]; | float3 _throughput = kernel_split_state.throughput[ray_index]; | ||||
| if(IS_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_AO)) { | if(IS_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_AO)) { | ||||
| float3 shadow = kernel_split_state.ao_light_ray[ray_index].P; | float3 shadow = kernel_split_state.ao_light_ray[ray_index].P; | ||||
| // TODO(mai): investigate correctness here | // TODO(mai): investigate correctness here | ||||
| char update_path_radiance = (char)kernel_split_state.ao_light_ray[ray_index].t; | char update_path_radiance = (char)kernel_split_state.ao_light_ray[ray_index].t; | ||||
| if(update_path_radiance) { | if(update_path_radiance) { | ||||
| path_radiance_accum_ao(L, | path_radiance_accum_ao(L, | ||||
| state, | |||||
| _throughput, | _throughput, | ||||
| kernel_split_state.ao_alpha[ray_index], | kernel_split_state.ao_alpha[ray_index], | ||||
| kernel_split_state.ao_bsdf[ray_index], | kernel_split_state.ao_bsdf[ray_index], | ||||
| shadow, | shadow); | ||||
| state->bounce); | |||||
| } | } | ||||
| else { | else { | ||||
| path_radiance_accum_total_ao(L, _throughput, kernel_split_state.ao_bsdf[ray_index]); | path_radiance_accum_total_ao(L, state, _throughput, | ||||
| kernel_split_state.ao_bsdf[ray_index]); | |||||
| } | } | ||||
| REMOVE_RAY_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_AO); | REMOVE_RAY_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_AO); | ||||
| } | } | ||||
| if(IS_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_DL)) { | if(IS_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_DL)) { | ||||
| float3 shadow = kernel_split_state.light_ray[ray_index].P; | float3 shadow = kernel_split_state.light_ray[ray_index].P; | ||||
| // TODO(mai): investigate correctness here | // TODO(mai): investigate correctness here | ||||
| char update_path_radiance = (char)kernel_split_state.light_ray[ray_index].t; | char update_path_radiance = (char)kernel_split_state.light_ray[ray_index].t; | ||||
| BsdfEval L_light = kernel_split_state.bsdf_eval[ray_index]; | BsdfEval L_light = kernel_split_state.bsdf_eval[ray_index]; | ||||
| if(update_path_radiance) { | if(update_path_radiance) { | ||||
| path_radiance_accum_light(L, | path_radiance_accum_light(L, | ||||
| state, | |||||
| _throughput, | _throughput, | ||||
| &L_light, | &L_light, | ||||
| shadow, | shadow, | ||||
| 1.0f, | 1.0f, | ||||
| state->bounce, | |||||
| kernel_split_state.is_lamp[ray_index]); | kernel_split_state.is_lamp[ray_index]); | ||||
| } | } | ||||
| else { | else { | ||||
| path_radiance_accum_total_light(L, _throughput, &L_light); | path_radiance_accum_total_light(L, state, _throughput, &L_light); | ||||
| } | } | ||||
| REMOVE_RAY_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_DL); | REMOVE_RAY_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_DL); | ||||
| } | } | ||||
| } | } | ||||
| if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { | if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { | ||||
| ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; | ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; | ||||
| ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; | ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; | ||||
| RNG rng = kernel_split_state.rng[ray_index]; | RNG rng = kernel_split_state.rng[ray_index]; | ||||
| state = &kernel_split_state.path_state[ray_index]; | state = &kernel_split_state.path_state[ray_index]; | ||||
| L = &kernel_split_state.path_radiance[ray_index]; | L = &kernel_split_state.path_radiance[ray_index]; | ||||
| ShaderData *sd = &kernel_split_state.sd[ray_index]; | |||||
| /* Compute direct lighting and next bounce. */ | /* Compute direct lighting and next bounce. */ | ||||
| if(!kernel_path_surface_bounce(kg, &rng, &kernel_split_state.sd[ray_index], throughput, state, L, ray)) { | if(!kernel_path_surface_bounce(kg, &rng, sd, throughput, state, L, ray)) { | ||||
| ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); | ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); | ||||
| enqueue_flag = 1; | enqueue_flag = 1; | ||||
| } | } | ||||
| kernel_split_state.rng[ray_index] = rng; | kernel_split_state.rng[ray_index] = rng; | ||||
| } | } | ||||
| #ifndef __COMPUTE_DEVICE_GPU__ | #ifndef __COMPUTE_DEVICE_GPU__ | ||||
| } | } | ||||
| Show All 13 Lines | |||||