diff options
Diffstat (limited to 'intern/cycles/kernel/kernel.h')
-rw-r--r-- | intern/cycles/kernel/kernel.h | 74 |
1 files changed, 21 insertions, 53 deletions
diff --git a/intern/cycles/kernel/kernel.h b/intern/cycles/kernel/kernel.h index b2596d10ee7..9279a94c13a 100644 --- a/intern/cycles/kernel/kernel.h +++ b/intern/cycles/kernel/kernel.h @@ -23,6 +23,10 @@ CCL_NAMESPACE_BEGIN +#define KERNEL_NAME_JOIN(x, y, z) x ## _ ## y ## _ ## z +#define KERNEL_NAME_EVAL(arch, name) KERNEL_NAME_JOIN(kernel, arch, name) +#define KERNEL_FUNCTION_FULL_NAME(name) KERNEL_NAME_EVAL(KERNEL_ARCH, name) + struct KernelGlobals; KernelGlobals *kernel_globals_create(); @@ -41,69 +45,33 @@ void kernel_tex_copy(KernelGlobals *kg, InterpolationType interpolation=INTERPOLATION_LINEAR, ExtensionType extension = EXTENSION_REPEAT); -void kernel_cpu_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, - int sample, int x, int y, int offset, int stride); -void kernel_cpu_convert_to_byte(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_convert_to_half_float(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_shader(KernelGlobals *kg, uint4 *input, float4 *output, - int type, int i, int offset, int sample); +#define KERNEL_ARCH cpu +#include "kernels/cpu/kernel_cpu.h" #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 -void kernel_cpu_sse2_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, - int sample, int x, int y, int offset, int stride); -void kernel_cpu_sse2_convert_to_byte(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_sse2_convert_to_half_float(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_sse2_shader(KernelGlobals *kg, uint4 *input, float4 *output, - int type, int i, int offset, int sample); -#endif +# define KERNEL_ARCH cpu_sse2 +# include "kernels/cpu/kernel_cpu.h" +#endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 -void kernel_cpu_sse3_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, - int sample, int x, int y, int offset, int stride); -void kernel_cpu_sse3_convert_to_byte(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_sse3_convert_to_half_float(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_sse3_shader(KernelGlobals *kg, uint4 *input, float4 *output, - int type, int i, int offset, int sample); -#endif +# define KERNEL_ARCH cpu_sse3 +# include "kernels/cpu/kernel_cpu.h" +#endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 -void kernel_cpu_sse41_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, - int sample, int x, int y, int offset, int stride); -void kernel_cpu_sse41_convert_to_byte(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_sse41_convert_to_half_float(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_sse41_shader(KernelGlobals *kg, uint4 *input, float4 *output, - int type, int i, int offset, int sample); -#endif +# define KERNEL_ARCH cpu_sse41 +# include "kernels/cpu/kernel_cpu.h" +#endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */ #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX -void kernel_cpu_avx_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, - int sample, int x, int y, int offset, int stride); -void kernel_cpu_avx_convert_to_byte(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_avx_convert_to_half_float(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_avx_shader(KernelGlobals *kg, uint4 *input, float4 *output, - int type, int i, int offset, int sample); -#endif +# define KERNEL_ARCH cpu_avx +# include "kernels/cpu/kernel_cpu.h" +#endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */ #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 -void kernel_cpu_avx2_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, - int sample, int x, int y, int offset, int stride); -void kernel_cpu_avx2_convert_to_byte(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_avx2_convert_to_half_float(KernelGlobals *kg, uchar4 *rgba, float *buffer, - float sample_scale, int x, int y, int offset, int stride); -void kernel_cpu_avx2_shader(KernelGlobals *kg, uint4 *input, float4 *output, - int type, int i, int offset, int sample); -#endif +# define KERNEL_ARCH cpu_avx2 +# include "kernels/cpu/kernel_cpu.h" +#endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */ CCL_NAMESPACE_END |