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-05-31 15:31:00 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-31 15:31:00 +0400
commit64c2d5e90e7ec80eb693c814787d8eee393c3bab (patch)
tree0d3f2be5289ad5f6a09b316d538159854fbb8f92 /intern/cycles/kernel/kernel_compat_opencl.h
parenteedcba7ed57e85b01b4aa5bc106502178835e6ae (diff)
Cycles: more opencl fixes.
Diffstat (limited to 'intern/cycles/kernel/kernel_compat_opencl.h')
-rw-r--r--intern/cycles/kernel/kernel_compat_opencl.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index e6e54850605..c8be03d7dd0 100644
--- a/intern/cycles/kernel/kernel_compat_opencl.h
+++ b/intern/cycles/kernel/kernel_compat_opencl.h
@@ -22,10 +22,10 @@
#define __KERNEL_GPU__
#define __KERNEL_OPENCL__
-#include "util_types.h"
-
CCL_NAMESPACE_BEGIN
+#pragma OPENCL EXTENSION cl_khr_byte_addressable_store: enable
+
#define __device
#define __device_inline
@@ -42,12 +42,26 @@ __device float kernel_tex_interp_(__global float *data, int width, float x)
return (1.0f - t)*data[index] + t*data[nindex];
}
-#define make_float3(x, y, z) ((float3)(x, y, z)) /* todo 1.1 */
+#define make_float2(x, y) ((float2)(x, y))
+#define make_float3(x, y, z) ((float3)(x, y, z, 0.0f))
+#define make_float4(x, y, z, w) ((float4)(x, y, z, w))
+#define make_int2(x, y) ((int2)(x, y))
+#define make_int3(x, y, z) ((int3)(x, y, z, 0))
+#define make_int4(x, y, z, w) ((int4)(x, y, z, w))
+
+typedef float4 float3;
+typedef int4 int3;
#define __uint_as_float(x) as_float(x)
#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 kernel_data (*kg->data)
#define kernel_tex_interp(t, x) \
@@ -57,6 +71,8 @@ __device float kernel_tex_interp_(__global float *data, int width, float x)
#define NULL 0
+#include "util_types.h"
+
CCL_NAMESPACE_END
#endif /* __KERNEL_COMPAT_OPENCL_H__ */