diff options
Diffstat (limited to 'intern/cycles/util/types_int3_impl.h')
-rw-r--r-- | intern/cycles/util/types_int3_impl.h | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/intern/cycles/util/types_int3_impl.h b/intern/cycles/util/types_int3_impl.h index abc0f4e4309..830dfa3c658 100644 --- a/intern/cycles/util/types_int3_impl.h +++ b/intern/cycles/util/types_int3_impl.h @@ -56,38 +56,35 @@ __forceinline int &int3::operator[](int i) } # endif -ccl_device_inline int3 make_int3(int i) +ccl_device_inline int3 make_int3(int x, int y, int z) { -# ifdef __KERNEL_GPU__ - int3 a = {i, i, i}; +# if defined(__KERNEL_GPU__) + return {x, y, z}; +# elif defined(__KERNEL_SSE__) + return int3(_mm_set_epi32(0, z, y, x)); # else -# ifdef __KERNEL_SSE__ - int3 a(_mm_set1_epi32(i)); -# else - int3 a = {i, i, i, i}; -# endif + return {x, y, z, 0}; # endif - return a; } -ccl_device_inline int3 make_int3(int x, int y, int z) +#endif /* __KERNEL_NATIVE_VECTOR_TYPES__ */ + +ccl_device_inline int3 make_int3(int i) { -# ifdef __KERNEL_GPU__ - int3 a = {x, y, z}; -# else -# ifdef __KERNEL_SSE__ - int3 a(_mm_set_epi32(0, z, y, x)); -# else - int3 a = {x, y, z, 0}; -# endif -# endif - return a; +#if defined(__KERNEL_GPU__) + return make_int3(i, i, i); +#elif defined(__KERNEL_SSE__) + return int3(_mm_set1_epi32(i)); +#else + return {i, i, i, i}; +#endif } -ccl_device_inline void print_int3(const char *label, const int3 &a) +ccl_device_inline void print_int3(ccl_private const char *label, const int3 a) { +#ifdef __KERNEL_PRINTF__ printf("%s: %d %d %d\n", label, a.x, a.y, a.z); +#endif } -#endif /* __KERNEL_NATIVE_VECTOR_TYPES__ */ CCL_NAMESPACE_END |