Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_buffer_update.h
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | ccl_device void kernel_buffer_update(KernelGlobals *kg, | ||||
| char enqueue_flag = 0; | char enqueue_flag = 0; | ||||
| ray_index = get_ray_index(kg, | ray_index = get_ray_index(kg, | ||||
| ray_index, | ray_index, | ||||
| QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, | QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, | ||||
| kernel_split_state.queue_data, | kernel_split_state.queue_data, | ||||
| kernel_split_params.queue_size, | kernel_split_params.queue_size, | ||||
| 1); | 1); | ||||
| #ifdef __COMPUTE_DEVICE_GPU__ | |||||
| /* If we are executing on a GPU device, we exit all threads that are not | |||||
| * required. | |||||
| * | |||||
| * If we are executing on a CPU device, then we need to keep all threads | |||||
| * active since we have barrier() calls later in the kernel. CPU devices, | |||||
| * expect all threads to execute barrier statement. | |||||
| */ | |||||
| if (ray_index == QUEUE_EMPTY_SLOT) { | |||||
| return; | |||||
| } | |||||
| #endif | |||||
| #ifndef __COMPUTE_DEVICE_GPU__ | |||||
| if (ray_index != QUEUE_EMPTY_SLOT) { | if (ray_index != QUEUE_EMPTY_SLOT) { | ||||
| #endif | |||||
| ccl_global char *ray_state = kernel_split_state.ray_state; | ccl_global char *ray_state = kernel_split_state.ray_state; | ||||
| ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; | ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; | ||||
| PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; | PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; | ||||
| ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; | ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; | ||||
| ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; | ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; | ||||
| bool ray_was_updated = false; | bool ray_was_updated = false; | ||||
| if (IS_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER)) { | if (IS_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER)) { | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | #endif | ||||
| ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); | ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); | ||||
| enqueue_flag = 1; | enqueue_flag = 1; | ||||
| } | } | ||||
| else { | else { | ||||
| ASSIGN_RAY_STATE(ray_state, ray_index, RAY_TO_REGENERATE); | ASSIGN_RAY_STATE(ray_state, ray_index, RAY_TO_REGENERATE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| #ifndef __COMPUTE_DEVICE_GPU__ | |||||
| } | } | ||||
| #endif | |||||
| /* Enqueue RAY_REGENERATED rays into QUEUE_ACTIVE_AND_REGENERATED_RAYS; | /* Enqueue RAY_REGENERATED rays into QUEUE_ACTIVE_AND_REGENERATED_RAYS; | ||||
| * These rays will be made active during next SceneIntersectkernel. | * These rays will be made active during next SceneIntersectkernel. | ||||
| */ | */ | ||||
| enqueue_ray_index_local(ray_index, | enqueue_ray_index_local(ray_index, | ||||
| QUEUE_ACTIVE_AND_REGENERATED_RAYS, | QUEUE_ACTIVE_AND_REGENERATED_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); | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||