Cycles: Fix handling of barriers

This commit is contained in:
Mai Lavelle 2017-03-16 02:16:02 -04:00
parent b27e224276
commit 60a344b43d
3 changed files with 6 additions and 11 deletions

View File

@ -32,11 +32,6 @@
# define ccl_addr_space
#endif
#if defined(__SPLIT_KERNEL__) && !defined(__COMPUTE_DEVICE_GPU__)
/* TODO(mai): need to investigate how this effects the kernel, as cpu kernel crashes without this right now */
#define __COMPUTE_DEVICE_GPU__
#endif
CCL_NAMESPACE_BEGIN
/* constants */

View File

@ -38,11 +38,11 @@ ccl_device void kernel_shader_eval(KernelGlobals *kg,
kernel_split_params.queue_size,
0);
if(ray_index == QUEUE_EMPTY_SLOT) {
return;
char enqueue_flag = 0;
if((ray_index != QUEUE_EMPTY_SLOT) && IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) {
enqueue_flag = 1;
}
char enqueue_flag = (IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) ? 1 : 0;
enqueue_ray_index_local(ray_index,
QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS,
enqueue_flag,
@ -52,7 +52,7 @@ ccl_device void kernel_shader_eval(KernelGlobals *kg,
kernel_split_params.queue_index);
/* Continue on with shader evaluation. */
if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) {
if((ray_index != QUEUE_EMPTY_SLOT) && IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) {
Intersection isect = kernel_split_state.isect[ray_index];
ccl_global uint *rng = &kernel_split_state.rng[ray_index];
ccl_global PathState *state = &kernel_split_state.path_state[ray_index];

View File

@ -46,12 +46,12 @@ ccl_device void kernel_subsurface_scatter(KernelGlobals *kg,
}
#endif
char enqueue_flag = 0;
#ifndef __COMPUTE_DEVICE_GPU__
if(ray_index != QUEUE_EMPTY_SLOT) {
#endif
char enqueue_flag = 0;
ccl_global char *ray_state = kernel_split_state.ray_state;
ccl_global PathState *state = &kernel_split_state.path_state[ray_index];
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];