diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2017-03-16 09:16:02 +0300 |
---|---|---|
committer | Mai Lavelle <mai.lavelle@gmail.com> | 2017-03-17 08:54:04 +0300 |
commit | 60a344b43d19524d5c97c6c19efd5c628b5bbbe1 (patch) | |
tree | b6a8c19ebdf7da4075f4d0c3e55e5a1b9abfbb1b /intern/cycles/kernel | |
parent | b27e2242768ca39bd832e95a385d3e4ad802059e (diff) |
Cycles: Fix handling of barriers
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 5 | ||||
-rw-r--r-- | intern/cycles/kernel/split/kernel_shader_eval.h | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/split/kernel_subsurface_scatter.h | 4 |
3 files changed, 6 insertions, 11 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index b6b891627bf..245832ae163 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -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 */ diff --git a/intern/cycles/kernel/split/kernel_shader_eval.h b/intern/cycles/kernel/split/kernel_shader_eval.h index fc966b77b2c..b739f86338c 100644 --- a/intern/cycles/kernel/split/kernel_shader_eval.h +++ b/intern/cycles/kernel/split/kernel_shader_eval.h @@ -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]; diff --git a/intern/cycles/kernel/split/kernel_subsurface_scatter.h b/intern/cycles/kernel/split/kernel_subsurface_scatter.h index 709a296c9a0..4eaa7f56332 100644 --- a/intern/cycles/kernel/split/kernel_subsurface_scatter.h +++ b/intern/cycles/kernel/split/kernel_subsurface_scatter.h @@ -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]; |