diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-02-04 19:04:07 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-02-04 19:07:50 +0400 |
commit | 28e6d05e0952bf96eec0320231178c883e0b8079 (patch) | |
tree | 7dfda1019692f0402eb3e23d77b2ad494966cb2f /intern/cycles/util/util_types.h | |
parent | 30b5aef6789a2cf39020151b00410bd1d8f1c3d7 (diff) |
Fix cycles crash with float image textures on CPU without AVX support.
The AVX kernel functions for reading image textures could be get used from non-AVX
kernels. These are C++ class methods and need to be marked for inlining, all other
functions are static so they don't leak into other kernels.
Diffstat (limited to 'intern/cycles/util/util_types.h')
-rw-r--r-- | intern/cycles/util/util_types.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 45038488c14..66aab766667 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -39,6 +39,7 @@ #define ccl_constant #if defined(_WIN32) && !defined(FREE_WINDOWS) + #define ccl_device_inline static __forceinline #ifdef __KERNEL_64_BIT__ #define ccl_align(...) __declspec(align(__VA_ARGS__)) @@ -46,13 +47,18 @@ #define ccl_align(...) /* not support for function arguments (error C2719) */ #endif #define ccl_may_alias +#define ccl_always_inline __forceinline + #else + #define ccl_device_inline static inline __attribute__((always_inline)) #ifndef FREE_WINDOWS64 #define __forceinline inline __attribute__((always_inline)) #endif #define ccl_align(...) __attribute__((aligned(__VA_ARGS__))) #define ccl_may_alias __attribute__((__may_alias__)) +#define ccl_always_inline __attribute__((always_inline)) + #endif #endif |