ClangFormat: apply to source, most of intern
[blender.git] / intern / cycles / kernel / kernels / cpu / kernel_cpu.h
1 /*
2  * Copyright 2011-2013 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
17 /* Templated common declaration part of all CPU kernels. */
18
19 void KERNEL_FUNCTION_FULL_NAME(path_trace)(
20     KernelGlobals *kg, float *buffer, int sample, int x, int y, int offset, int stride);
21
22 void KERNEL_FUNCTION_FULL_NAME(convert_to_byte)(KernelGlobals *kg,
23                                                 uchar4 *rgba,
24                                                 float *buffer,
25                                                 float sample_scale,
26                                                 int x,
27                                                 int y,
28                                                 int offset,
29                                                 int stride);
30
31 void KERNEL_FUNCTION_FULL_NAME(convert_to_half_float)(KernelGlobals *kg,
32                                                       uchar4 *rgba,
33                                                       float *buffer,
34                                                       float sample_scale,
35                                                       int x,
36                                                       int y,
37                                                       int offset,
38                                                       int stride);
39
40 void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
41                                        uint4 *input,
42                                        float4 *output,
43                                        int type,
44                                        int filter,
45                                        int i,
46                                        int offset,
47                                        int sample);
48
49 /* Split kernels */
50
51 void KERNEL_FUNCTION_FULL_NAME(data_init)(KernelGlobals *kg,
52                                           ccl_constant KernelData *data,
53                                           ccl_global void *split_data_buffer,
54                                           int num_elements,
55                                           ccl_global char *ray_state,
56                                           int start_sample,
57                                           int end_sample,
58                                           int sx,
59                                           int sy,
60                                           int sw,
61                                           int sh,
62                                           int offset,
63                                           int stride,
64                                           ccl_global int *Queue_index,
65                                           int queuesize,
66                                           ccl_global char *use_queues_flag,
67                                           ccl_global unsigned int *work_pool_wgs,
68                                           unsigned int num_samples,
69                                           ccl_global float *buffer);
70
71 #define DECLARE_SPLIT_KERNEL_FUNCTION(name) \
72   void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals * kg, KernelData * data);
73
74 DECLARE_SPLIT_KERNEL_FUNCTION(path_init)
75 DECLARE_SPLIT_KERNEL_FUNCTION(scene_intersect)
76 DECLARE_SPLIT_KERNEL_FUNCTION(lamp_emission)
77 DECLARE_SPLIT_KERNEL_FUNCTION(do_volume)
78 DECLARE_SPLIT_KERNEL_FUNCTION(queue_enqueue)
79 DECLARE_SPLIT_KERNEL_FUNCTION(indirect_background)
80 DECLARE_SPLIT_KERNEL_FUNCTION(shader_setup)
81 DECLARE_SPLIT_KERNEL_FUNCTION(shader_sort)
82 DECLARE_SPLIT_KERNEL_FUNCTION(shader_eval)
83 DECLARE_SPLIT_KERNEL_FUNCTION(holdout_emission_blurring_pathtermination_ao)
84 DECLARE_SPLIT_KERNEL_FUNCTION(subsurface_scatter)
85 DECLARE_SPLIT_KERNEL_FUNCTION(direct_lighting)
86 DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked_ao)
87 DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked_dl)
88 DECLARE_SPLIT_KERNEL_FUNCTION(enqueue_inactive)
89 DECLARE_SPLIT_KERNEL_FUNCTION(next_iteration_setup)
90 DECLARE_SPLIT_KERNEL_FUNCTION(indirect_subsurface)
91 DECLARE_SPLIT_KERNEL_FUNCTION(buffer_update)
92
93 #undef KERNEL_ARCH