Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-11 16:36:08 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-11 16:36:08 +0400
commit6686f189480c4de3e91f49a76811bf006ed9f9b2 (patch)
treebb7184c7e0117c2766eeb727448d9460113b705a /intern/cycles/kernel
parent18d709022e3ad2208382157a566095c406504d24 (diff)
Cycles: more opencl tweaks, status is:
* kernel has shading nodes / textures disabled, amd/nvidia opencl compilers choke on these, need to figure out how to avoid this * works in cycles_test, not available as option in blender yet * kernel compiles and runs with opencl 1.1 from intel/amd/nvidia
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/CMakeLists.txt18
-rw-r--r--intern/cycles/kernel/kernel_compat_opencl.h7
-rw-r--r--intern/cycles/kernel/kernel_types.h2
3 files changed, 18 insertions, 9 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index bc1f8bd40a5..b6d758369cc 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -72,6 +72,12 @@ SET(svm_headers
svm/volume.h
)
+SET(util_headers
+ ../util/util_color.h
+ ../util/util_math.h
+ ../util/util_transform.h
+ ../util/util_types.h)
+
# CUDA module
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
@@ -118,11 +124,13 @@ ENDIF()
# OPENCL kernel
IF(WITH_CYCLES_OPENCL)
- SET(util_headers
- ../util/util_color.h
- ../util/util_math.h
- ../util/util_transform.h
- ../util/util_types.h)
+ #SET(kernel_preprocessed ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
+ #ADD_CUSTOM_COMMAND(
+ # OUTPUT ${kernel_preprocessed}
+ # COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DWITH_OPENCL -o ${kernel_preprocessed}
+ # DEPENDS ${kernel_sources} ${util_headers})
+ #ADD_CUSTOM_TARGET(cycles_kernel_preprocess ALL DEPENDS ${kernel_preprocessed})
+ #INSTALL(FILES ${kernel_preprocessed} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/kernel)
INSTALL(FILES kernel.cl ${headers} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/kernel)
INSTALL(FILES ${svm_headers} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/kernel/svm)
diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index 0127093d8ce..3d493c61fe4 100644
--- a/intern/cycles/kernel/kernel_compat_opencl.h
+++ b/intern/cycles/kernel/kernel_compat_opencl.h
@@ -22,7 +22,10 @@
#define __KERNEL_GPU__
#define __KERNEL_OPENCL__
-CCL_NAMESPACE_BEGIN
+/* no namespaces in opencl */
+#define CCL_NAMESPACE_BEGIN
+#define CCL_NAMESPACE_END
+#define WITH_OPENCL
/* in opencl all functions are device functions, so leave this empty */
#define __device
@@ -104,7 +107,5 @@ __device float kernel_tex_interp_(__global float *data, int width, float x)
#include "util_types.h"
-CCL_NAMESPACE_END
-
#endif /* __KERNEL_COMPAT_OPENCL_H__ */
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 992a4d95b54..c0cb3fc8a09 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -34,8 +34,8 @@ CCL_NAMESPACE_BEGIN
#define __BACKGROUND__
#define __EMISSION__
#define __CAUSTICS_TRICKS__
-#define __SVM__
#ifndef __KERNEL_OPENCL__
+#define __SVM__
#define __TEXTURES__
#endif
#define __RAY_DIFFERENTIALS__