2011-04-27 11:58:34 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License
|
2011-04-27 11:58:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __KERNEL_H__
|
|
|
|
#define __KERNEL_H__
|
|
|
|
|
2014-01-14 19:39:21 +00:00
|
|
|
/* CPU Kernel Interface */
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
#include "util_types.h"
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
struct KernelGlobals;
|
|
|
|
|
|
|
|
KernelGlobals *kernel_globals_create();
|
|
|
|
void kernel_globals_free(KernelGlobals *kg);
|
|
|
|
|
|
|
|
void *kernel_osl_memory(KernelGlobals *kg);
|
|
|
|
bool kernel_osl_use(KernelGlobals *kg);
|
|
|
|
|
|
|
|
void kernel_const_copy(KernelGlobals *kg, const char *name, void *host, size_t size);
|
2014-03-29 12:03:48 +00:00
|
|
|
void kernel_tex_copy(KernelGlobals *kg, const char *name, device_ptr mem, size_t width, size_t height, size_t depth, InterpolationType interpolation=INTERPOLATION_LINEAR);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
void kernel_cpu_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state,
|
2011-12-20 12:25:37 +00:00
|
|
|
int sample, int x, int y, int offset, int stride);
|
2013-08-30 23:49:38 +00:00
|
|
|
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);
|
2012-01-20 17:49:17 +00:00
|
|
|
void kernel_cpu_shader(KernelGlobals *kg, uint4 *input, float4 *output,
|
2014-08-19 09:39:40 +00:00
|
|
|
int type, int i, int offset, int sample);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-01-14 19:39:21 +00:00
|
|
|
#ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2
|
2013-02-04 16:12:37 +00:00
|
|
|
void kernel_cpu_sse2_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state,
|
2011-12-20 12:25:37 +00:00
|
|
|
int sample, int x, int y, int offset, int stride);
|
2013-08-30 23:49:38 +00:00
|
|
|
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);
|
2013-02-04 16:12:37 +00:00
|
|
|
void kernel_cpu_sse2_shader(KernelGlobals *kg, uint4 *input, float4 *output,
|
2014-08-19 09:39:40 +00:00
|
|
|
int type, int i, int offset, int sample);
|
2014-01-14 19:39:21 +00:00
|
|
|
#endif
|
2013-02-04 16:12:37 +00:00
|
|
|
|
2014-01-14 19:39:21 +00:00
|
|
|
#ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
|
2013-02-04 16:12:37 +00:00
|
|
|
void kernel_cpu_sse3_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state,
|
|
|
|
int sample, int x, int y, int offset, int stride);
|
2013-08-30 23:49:38 +00:00
|
|
|
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);
|
2013-02-04 16:12:37 +00:00
|
|
|
void kernel_cpu_sse3_shader(KernelGlobals *kg, uint4 *input, float4 *output,
|
2014-08-19 09:39:40 +00:00
|
|
|
int type, int i, int offset, int sample);
|
2014-01-14 19:39:21 +00:00
|
|
|
#endif
|
2013-11-22 13:16:47 +00:00
|
|
|
|
2014-01-14 19:39:21 +00:00
|
|
|
#ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41
|
2013-11-22 13:16:47 +00:00
|
|
|
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,
|
2014-08-19 09:39:40 +00:00
|
|
|
int type, int i, int offset, int sample);
|
2011-11-15 15:13:38 +00:00
|
|
|
#endif
|
|
|
|
|
2014-01-16 16:04:11 +00:00
|
|
|
#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,
|
2014-08-19 09:39:40 +00:00
|
|
|
int type, int i, int offset, int sample);
|
2014-01-16 16:04:11 +00:00
|
|
|
#endif
|
|
|
|
|
2014-06-13 20:23:58 +00:00
|
|
|
#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,
|
2014-08-19 09:39:40 +00:00
|
|
|
int type, int i, int offset, int sample);
|
2014-06-13 20:23:58 +00:00
|
|
|
#endif
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
|
|
|
#endif /* __KERNEL_H__ */
|
|
|
|
|