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:
authorAndrii Symkin <pembem22>2022-07-25 17:55:48 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-07-25 18:36:58 +0300
commit793d2031395246fb2421d130742e0fe61ab2b29c (patch)
tree1c6a1ecea8b9bb0fe1b0149029ea4a0befd8a6e3 /intern/cycles/util/types_float8.h
parent7a74d91e323c4d695b908ca4178837cee756eeaf (diff)
Cycles: add math functions for float8
This patch adds required math functions for float8 to make it possible using float8 instead of float3 for color data. Differential Revision: https://developer.blender.org/D15525
Diffstat (limited to 'intern/cycles/util/types_float8.h')
-rw-r--r--intern/cycles/util/types_float8.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/intern/cycles/util/types_float8.h b/intern/cycles/util/types_float8.h
index d71149946f7..f04dc675c84 100644
--- a/intern/cycles/util/types_float8.h
+++ b/intern/cycles/util/types_float8.h
@@ -11,11 +11,13 @@
CCL_NAMESPACE_BEGIN
-#if !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__)
-
+#ifdef __KERNEL_GPU__
+struct float8
+#else
struct ccl_try_align(32) float8
+#endif
{
-# ifdef __KERNEL_AVX2__
+#ifdef __KERNEL_AVX2__
union {
__m256 m256;
struct {
@@ -32,18 +34,19 @@ struct ccl_try_align(32) float8
__forceinline float8 &operator=(const float8 &a);
-# else /* __KERNEL_AVX2__ */
+#else /* __KERNEL_AVX2__ */
float a, b, c, d, e, f, g, h;
-# endif /* __KERNEL_AVX2__ */
+#endif /* __KERNEL_AVX2__ */
+#ifndef __KERNEL_GPU__
__forceinline float operator[](int i) const;
__forceinline float &operator[](int i);
+#endif
};
ccl_device_inline float8 make_float8(float f);
ccl_device_inline float8
make_float8(float a, float b, float c, float d, float e, float f, float g, float h);
-#endif /* !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__) */
CCL_NAMESPACE_END