[Bf-blender-cvs] [b224fbf] master: OpenCL + AMD adapt kernel to newer driver

Martijn Berger noreply at git.blender.org
Mon Apr 7 14:02:27 CEST 2014


Commit: b224fbf2e741c20ac1020f4da1b4e63fd6b8e626
Author: Martijn Berger
Date:   Mon Apr 7 14:01:31 2014 +0200
https://developer.blender.org/rBb224fbf2e741c20ac1020f4da1b4e63fd6b8e626

OpenCL + AMD adapt kernel to newer driver

===================================================================

M	intern/cycles/kernel/kernel_compat_opencl.h
M	intern/cycles/kernel/kernel_types.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index 4f4414c..8346b09 100644
--- a/intern/cycles/kernel/kernel_compat_opencl.h
+++ b/intern/cycles/kernel/kernel_compat_opencl.h
@@ -85,27 +85,36 @@
 #define __float_as_uint(x) as_uint(x)
 #define __int_as_float(x) as_float(x)
 #define __float_as_int(x) as_int(x)
-#define sqrtf(x) sqrt(((float)x))
-#define cosf(x) cos(((float)x))
-#define sinf(x) sin(((float)x))
 #define powf(x, y) pow(((float)x), ((float)y))
 #define fabsf(x) fabs(((float)x))
 #define copysignf(x, y) copysign(((float)x), ((float)y))
-#define cosf(x) cos(((float)x))
 #define asinf(x) asin(((float)x))
 #define acosf(x) acos(((float)x))
 #define atanf(x) atan(((float)x))
-#define tanf(x) tan(((float)x))
-#define logf(x) log(((float)x))
 #define floorf(x) floor(((float)x))
 #define ceilf(x) ceil(((float)x))
-#define expf(x) exp(((float)x))
 #define hypotf(x, y) hypot(((float)x), ((float)y))
 #define atan2f(x, y) atan2(((float)x), ((float)y))
 #define fmaxf(x, y) fmax(((float)x), ((float)y))
 #define fminf(x, y) fmin(((float)x), ((float)y))
 #define fmodf(x, y) fmod((float)x, (float)y)
 
+#ifndef __CL_USE_NATIVE__
+#define sinf(x) native_sin(((float)x))
+#define cosf(x) native_cos(((float)x))
+#define tanf(x) native_tan(((float)x))
+#define expf(x) native_exp(((float)x))
+#define sqrtf(x) native_sqrt(((float)x))
+#define logf(x) native_log(((float)x))
+#else
+#define sinf(x) sin(((float)x))
+#define cosf(x) cos(((float)x))
+#define tanf(x) tan(((float)x))
+#define expf(x) exp(((float)x))
+#define sqrtf(x) sqrt(((float)x))
+#define logf(x) log(((float)x))
+#endif
+
 /* data lookup defines */
 #define kernel_data (*kg->data)
 #define kernel_tex_fetch(t, index) kg->t[index]
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 1045b0a..75151a3 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -92,23 +92,20 @@ CCL_NAMESPACE_BEGIN
 #endif
 
 #ifdef __KERNEL_OPENCL_AMD__
-#define __SVM__
-#define __EMISSION__
-#define __IMAGE_TEXTURES__
-#define __PROCEDURAL_TEXTURES__
-#define __EXTRA_NODES__
-#define __HOLDOUT__
-#define __NORMAL_MAP__
-//#define __BACKGROUND_MIS__
-//#define __LAMP_MIS__
-//#define __AO__
-//#define __ANISOTROPIC__
+#define __CL_USE_NATIVE__
+#define __KERNEL_SHADING__
+//__KERNEL_ADV_SHADING__
+#define __MULTI_CLOSURE__
+#define __TRANSPARENT_SHADOWS__
+#define __PASSES__
+#define __BACKGROUND_MIS__
+#define __LAMP_MIS__
+#define __AO__
+#define __ANISOTROPIC__
 //#define __CAMERA_MOTION__
 //#define __OBJECT_MOTION__
 //#define __HAIR__
-//#define __MULTI_CLOSURE__
-//#define __TRANSPARENT_SHADOWS__
-//#define __PASSES__
+//end __KERNEL_ADV_SHADING__
 #endif
 
 #ifdef __KERNEL_OPENCL_INTEL_CPU__




More information about the Bf-blender-cvs mailing list