Blender  V2.93
kernel_enqueue_inactive.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2017 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
20  ccl_local_param unsigned int *local_queue_atomics)
21 {
22 #ifdef __BRANCHED_PATH__
23  /* Enqueue RAY_INACTIVE rays into QUEUE_INACTIVE_RAYS queue. */
24  if (ccl_local_id(0) == 0 && ccl_local_id(1) == 0) {
25  *local_queue_atomics = 0;
26  }
28 
29  int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0);
30 
31  char enqueue_flag = 0;
32  if (IS_STATE(kernel_split_state.ray_state, ray_index, RAY_INACTIVE)) {
33  enqueue_flag = 1;
34  }
35 
36  enqueue_ray_index_local(ray_index,
38  enqueue_flag,
39  kernel_split_params.queue_size,
40  local_queue_atomics,
41  kernel_split_state.queue_data,
42  kernel_split_params.queue_index);
43 #endif /* __BRANCHED_PATH__ */
44 }
45 
#define ccl_global_id(d)
#define ccl_global_size(d)
#define ccl_local_param
#define ccl_device
ccl_device_inline uint ccl_local_id(uint d)
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device void kernel_enqueue_inactive(KernelGlobals *kg, ccl_local_param unsigned int *local_queue_atomics)
ccl_device void enqueue_ray_index_local(int ray_index, int queue_number, char enqueue_flag, int queuesize, ccl_local_param unsigned int *local_queue_atomics, ccl_global int *Queue_data, ccl_global int *Queue_index)
Definition: kernel_queues.h:71
#define kernel_split_params
#define kernel_split_state
#define IS_STATE(ray_state, ray_index, state)
@ RAY_INACTIVE
@ QUEUE_INACTIVE_RAYS
#define CCL_LOCAL_MEM_FENCE
Definition: util_atomic.h:32
#define ccl_barrier(flags)
Definition: util_atomic.h:33