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:
authorMartijn Berger <martijn.berger@gmail.com>2014-04-07 16:01:31 +0400
committerMartijn Berger <martijn.berger@gmail.com>2014-04-07 16:01:31 +0400
commitb224fbf2e741c20ac1020f4da1b4e63fd6b8e626 (patch)
tree5420db1e52fbf4c77f9e54e4ca21c7fe3f6f93c4 /intern/cycles/kernel/kernel_compat_opencl.h
parent5dc23e6df851e2091f2808dc68a1fe03bab78026 (diff)
OpenCL + AMD adapt kernel to newer driver
Diffstat (limited to 'intern/cycles/kernel/kernel_compat_opencl.h')
-rw-r--r--intern/cycles/kernel/kernel_compat_opencl.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index 4f4414cc298..8346b09619e 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]