diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-13 16:32:44 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-13 16:32:44 +0400 |
commit | dd9c1b7fbf501ef58c9952150698fb5ce3c45903 (patch) | |
tree | f52d353e3dc36a33a3a8b6609fa8a2ffe39b2d4c /intern/cycles/util/util_math.h | |
parent | f9642926303ec89679e61076ca9e4b9f0be3afe9 (diff) |
Cycles: OpenCL image texture support, fix an attribute node issue and refactor
feature enabling #defines a bit.
Diffstat (limited to 'intern/cycles/util/util_math.h')
-rw-r--r-- | intern/cycles/util/util_math.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 8c0e7105b22..fee2f10085b 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -965,6 +965,20 @@ __device_inline void print_int4(const char *label, const int4& a) #ifndef __KERNEL_OPENCL__ +__device_inline unsigned int as_int(uint i) +{ + union { unsigned int ui; int i; } u; + u.ui = i; + return u.i; +} + +__device_inline unsigned int as_uint(int i) +{ + union { unsigned int ui; int i; } u; + u.i = i; + return u.ui; +} + __device_inline unsigned int as_uint(float f) { union { unsigned int i; float f; } u; |