Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_shader_eval.h
| Show All 39 Lines | |||||
| * at entry, | * at entry, | ||||
| * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and RAY_REGENERATED rays | * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and RAY_REGENERATED rays | ||||
| * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be empty. | * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be empty. | ||||
| * at exit, | * at exit, | ||||
| * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and RAY_REGENERATED rays | * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and RAY_REGENERATED rays | ||||
| * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_TO_REGENERATE rays | * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_TO_REGENERATE rays | ||||
| */ | */ | ||||
| ccl_device void kernel_shader_eval(KernelGlobals *kg) | ccl_device void kernel_shader_eval(KernelGlobals *kg, | ||||
| ccl_local_param unsigned int *local_queue_atomics) | |||||
| { | { | ||||
| /* Enqeueue RAY_TO_REGENERATE rays into QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */ | /* Enqeueue RAY_TO_REGENERATE rays into QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */ | ||||
| ccl_local unsigned int local_queue_atomics; | |||||
| if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { | if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { | ||||
| local_queue_atomics = 0; | *local_queue_atomics = 0; | ||||
| } | } | ||||
| ccl_barrier(CCL_LOCAL_MEM_FENCE); | ccl_barrier(CCL_LOCAL_MEM_FENCE); | ||||
| int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); | int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); | ||||
| ray_index = get_ray_index(kg, ray_index, | ray_index = get_ray_index(kg, ray_index, | ||||
| QUEUE_ACTIVE_AND_REGENERATED_RAYS, | QUEUE_ACTIVE_AND_REGENERATED_RAYS, | ||||
| kernel_split_state.queue_data, | kernel_split_state.queue_data, | ||||
| kernel_split_params.queue_size, | kernel_split_params.queue_size, | ||||
| 0); | 0); | ||||
| if(ray_index == QUEUE_EMPTY_SLOT) { | if(ray_index == QUEUE_EMPTY_SLOT) { | ||||
| return; | return; | ||||
| } | } | ||||
| char enqueue_flag = (IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) ? 1 : 0; | char enqueue_flag = (IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) ? 1 : 0; | ||||
| enqueue_ray_index_local(ray_index, | enqueue_ray_index_local(ray_index, | ||||
| QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, | QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, | ||||
| enqueue_flag, | enqueue_flag, | ||||
| kernel_split_params.queue_size, | kernel_split_params.queue_size, | ||||
| &local_queue_atomics, | local_queue_atomics, | ||||
| kernel_split_state.queue_data, | kernel_split_state.queue_data, | ||||
| kernel_split_params.queue_index); | kernel_split_params.queue_index); | ||||
| /* Continue on with shader evaluation. */ | /* Continue on with shader evaluation. */ | ||||
| if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) { | if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) { | ||||
| Intersection *isect = &kernel_split_state.isect[ray_index]; | Intersection *isect = &kernel_split_state.isect[ray_index]; | ||||
| ccl_global uint *rng = &kernel_split_state.rng[ray_index]; | ccl_global uint *rng = &kernel_split_state.rng[ray_index]; | ||||
| ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; | ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; | ||||
| Show All 13 Lines | |||||