1d7101578174007320f3156b0a38c5e96372a1de
[blender-staging.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)(KernelGlobals *kg,
20                                            float *buffer,
21                                            unsigned int *rng_state,
22                                            int sample,
23                                            int x, int y,
24                                            int offset,
25                                            int stride);
26
27 void KERNEL_FUNCTION_FULL_NAME(convert_to_byte)(KernelGlobals *kg,
28                                                 uchar4 *rgba,
29                                                 float *buffer,
30                                                 float sample_scale,
31                                                 int x, int y,
32                                                 int offset, int stride);
33
34 void KERNEL_FUNCTION_FULL_NAME(convert_to_half_float)(KernelGlobals *kg,
35                                                       uchar4 *rgba,
36                                                       float *buffer,
37                                                       float sample_scale,
38                                                       int x, int y,
39                                                       int offset,
40                                                       int stride);
41
42 void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
43                                        uint4 *input,
44                                        float4 *output,
45                                        float *output_luma,
46                                        int type,
47                                        int filter,
48                                        int i,
49                                        int offset,
50                                        int sample);
51
52 /* Split kernels */
53
54 void KERNEL_FUNCTION_FULL_NAME(data_init)(
55         KernelGlobals *kg,
56         ccl_constant KernelData *data,
57         ccl_global void *split_data_buffer,
58         int num_elements,
59         ccl_global char *ray_state,
60         ccl_global uint *rng_state,
61         int start_sample,
62         int end_sample,
63         int sx, int sy, int sw, int sh, int offset, 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(scene_intersect)
75 DECLARE_SPLIT_KERNEL_FUNCTION(lamp_emission)
76 DECLARE_SPLIT_KERNEL_FUNCTION(queue_enqueue)
77 DECLARE_SPLIT_KERNEL_FUNCTION(background_buffer_update)
78 DECLARE_SPLIT_KERNEL_FUNCTION(shader_eval)
79 DECLARE_SPLIT_KERNEL_FUNCTION(holdout_emission_blurring_pathtermination_ao)
80 DECLARE_SPLIT_KERNEL_FUNCTION(direct_lighting)
81 DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked)
82 DECLARE_SPLIT_KERNEL_FUNCTION(next_iteration_setup)
83 DECLARE_SPLIT_KERNEL_FUNCTION(sum_all_radiance)
84
85 void KERNEL_FUNCTION_FULL_NAME(register_functions)(void(*reg)(const char* name, void* func));
86
87 #undef KERNEL_ARCH