Cycles: Remove few function arguments needed only for the split kernel
[blender.git] / intern / cycles / kernel / kernel.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 #ifndef __KERNEL_H__
18 #define __KERNEL_H__
19
20 /* CPU Kernel Interface */
21
22 #include "util_types.h"
23
24 CCL_NAMESPACE_BEGIN
25
26 #define KERNEL_NAME_JOIN(x, y, z) x ## _ ## y ## _ ## z
27 #define KERNEL_NAME_EVAL(arch, name)  KERNEL_NAME_JOIN(kernel, arch, name)
28 #define KERNEL_FUNCTION_FULL_NAME(name) KERNEL_NAME_EVAL(KERNEL_ARCH, name)
29
30 struct KernelGlobals;
31
32 KernelGlobals *kernel_globals_create();
33 void kernel_globals_free(KernelGlobals *kg);
34
35 void *kernel_osl_memory(KernelGlobals *kg);
36 bool kernel_osl_use(KernelGlobals *kg);
37
38 void kernel_const_copy(KernelGlobals *kg, const char *name, void *host, size_t size);
39 void kernel_tex_copy(KernelGlobals *kg,
40                      const char *name,
41                      device_ptr mem,
42                      size_t width,
43                      size_t height,
44                      size_t depth,
45                      InterpolationType interpolation=INTERPOLATION_LINEAR,
46                      ExtensionType extension = EXTENSION_REPEAT);
47
48 #define KERNEL_ARCH cpu
49 #include "kernels/cpu/kernel_cpu.h"
50
51 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2
52 #  define KERNEL_ARCH cpu_sse2
53 #  include "kernels/cpu/kernel_cpu.h"
54 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */
55
56 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
57 #  define KERNEL_ARCH cpu_sse3
58 #  include "kernels/cpu/kernel_cpu.h"
59 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */
60
61 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41
62 #  define KERNEL_ARCH cpu_sse41
63 #  include "kernels/cpu/kernel_cpu.h"
64 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */
65
66 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX
67 #  define KERNEL_ARCH cpu_avx
68 #  include "kernels/cpu/kernel_cpu.h"
69 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */
70
71 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
72 #  define KERNEL_ARCH cpu_avx2
73 #  include "kernels/cpu/kernel_cpu.h"
74 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */
75
76 CCL_NAMESPACE_END
77
78 #endif /* __KERNEL_H__ */
79