Cycles: Fix building with native only option
Approach suggested by Lukas S.
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
|
||||
#include "kernel/kernel_compat_cpu.h"
|
||||
|
||||
#ifndef __SPLIT_KERNEL__
|
||||
#ifndef KERNEL_STUB
|
||||
# ifndef __SPLIT_KERNEL__
|
||||
# include "kernel/kernel_math.h"
|
||||
# include "kernel/kernel_types.h"
|
||||
|
||||
@@ -34,7 +35,7 @@
|
||||
# include "kernel/kernel_path.h"
|
||||
# include "kernel/kernel_path_branched.h"
|
||||
# include "kernel/kernel_bake.h"
|
||||
#else
|
||||
# else
|
||||
# include "kernel/split/kernel_split_common.h"
|
||||
|
||||
# include "kernel/split/kernel_data_init.h"
|
||||
@@ -55,12 +56,15 @@
|
||||
# include "kernel/split/kernel_next_iteration_setup.h"
|
||||
# include "kernel/split/kernel_indirect_subsurface.h"
|
||||
# include "kernel/split/kernel_buffer_update.h"
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL_STUB
|
||||
# endif /* __SPLIT_KERNEL__ */
|
||||
#else
|
||||
# include "util/util_debug.h"
|
||||
# define STUB_ASSERT(arch, name) assert(!(#name " kernel stub for architecture " #arch " was called!"))
|
||||
#endif
|
||||
|
||||
# ifdef __SPLIT_KERNEL__
|
||||
# include "kernel/split/kernel_data_init.h"
|
||||
# endif /* __SPLIT_KERNEL__ */
|
||||
#endif /* KERNEL_STUB */
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
@@ -191,20 +195,26 @@ void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
|
||||
{ \
|
||||
STUB_ASSERT(KERNEL_ARCH, name); \
|
||||
}
|
||||
|
||||
# define DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(name, type) \
|
||||
void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData* /*data*/) \
|
||||
{ \
|
||||
STUB_ASSERT(KERNEL_ARCH, name); \
|
||||
}
|
||||
#else
|
||||
# define DEFINE_SPLIT_KERNEL_FUNCTION(name) \
|
||||
void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData* /*data*/) \
|
||||
{ \
|
||||
kernel_##name(kg); \
|
||||
}
|
||||
#endif /* KERNEL_STUB */
|
||||
|
||||
#define DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(name, type) \
|
||||
# define DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(name, type) \
|
||||
void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData* /*data*/) \
|
||||
{ \
|
||||
ccl_local type locals; \
|
||||
kernel_##name(kg, &locals); \
|
||||
}
|
||||
#endif /* KERNEL_STUB */
|
||||
|
||||
DEFINE_SPLIT_KERNEL_FUNCTION(path_init)
|
||||
DEFINE_SPLIT_KERNEL_FUNCTION(scene_intersect)
|
||||
|
@@ -67,6 +67,10 @@ void KERNEL_FUNCTION_FULL_NAME(data_init)(
|
||||
unsigned int num_samples,
|
||||
ccl_global float *buffer)
|
||||
{
|
||||
#ifdef KERNEL_STUB
|
||||
STUB_ASSERT(KERNEL_ARCH, data_init);
|
||||
#else
|
||||
|
||||
#ifdef __KERNEL_OPENCL__
|
||||
kg->data = data;
|
||||
#endif
|
||||
@@ -143,6 +147,8 @@ void KERNEL_FUNCTION_FULL_NAME(data_init)(
|
||||
*(rng_state + index) = hash_int_2d(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* KERENL_STUB */
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
Reference in New Issue
Block a user