diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-03-24 00:46:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-03-24 01:25:31 +0300 |
commit | 51380b9346a5115bbbaf064387509d96bdf21a43 (patch) | |
tree | 9ad9f1475c313cd559af72a7f9dbf3fa16dbff9d /intern/cycles/util | |
parent | d84b4becd3bce34b75385155535b17d77f68578a (diff) |
Fix Cycles Metal build error and GCC warning after recent changes
Function overloading of make_float4() doesn't work since it's a macro, just
don't do this minor cleanup then.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/math_float4.h | 10 | ||||
-rw-r--r-- | intern/cycles/util/types_float4.h | 1 | ||||
-rw-r--r-- | intern/cycles/util/types_float4_impl.h | 5 |
3 files changed, 5 insertions, 11 deletions
diff --git a/intern/cycles/util/math_float4.h b/intern/cycles/util/math_float4.h index 5d4da7dd30f..ae9dfe75a9c 100644 --- a/intern/cycles/util/math_float4.h +++ b/intern/cycles/util/math_float4.h @@ -90,13 +90,13 @@ ccl_device_inline float4 zero_float4() #ifdef __KERNEL_SSE__ return float4(_mm_setzero_ps()); #else - return make_float4(0.0f); + return make_float4(0.0f, 0.0f, 0.0f, 0.0f); #endif } ccl_device_inline float4 one_float4() { - return make_float4(1.0f); + return make_float4(1.0f, 1.0f, 1.0f, 1.0f); } #if !defined(__KERNEL_METAL__) @@ -149,7 +149,7 @@ ccl_device_inline float4 operator/(const float4 &a, const float4 &b) ccl_device_inline float4 operator+(const float4 &a, const float f) { - return a + make_float4(f); + return a + make_float4(f, f, f, f); } ccl_device_inline float4 operator+(const float4 &a, const float4 &b) @@ -163,7 +163,7 @@ ccl_device_inline float4 operator+(const float4 &a, const float4 &b) ccl_device_inline float4 operator-(const float4 &a, const float f) { - return a - make_float4(f); + return a - make_float4(f, f, f, f); } ccl_device_inline float4 operator-(const float4 &a, const float4 &b) @@ -317,7 +317,7 @@ ccl_device_inline float4 reduce_add(const float4 &a) # endif # else float sum = (a.x + a.y) + (a.z + a.w); - return make_float4(sum); + return make_float4(sum, sum, sum, sum); # endif } diff --git a/intern/cycles/util/types_float4.h b/intern/cycles/util/types_float4.h index 0e84dfa3d64..68ba787dac0 100644 --- a/intern/cycles/util/types_float4.h +++ b/intern/cycles/util/types_float4.h @@ -45,7 +45,6 @@ ccl_device_inline float4 make_float4(const int4 &i); ccl_device_inline void print_float4(const char *label, const float4 &a); #endif /* __KERNEL_GPU__ */ -ccl_device_inline float4 make_float4(float f); CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT4_H__ */ diff --git a/intern/cycles/util/types_float4_impl.h b/intern/cycles/util/types_float4_impl.h index aa923eb038d..de2e7cb7061 100644 --- a/intern/cycles/util/types_float4_impl.h +++ b/intern/cycles/util/types_float4_impl.h @@ -89,11 +89,6 @@ ccl_device_inline void print_float4(const char *label, const float4 &a) { printf("%s: %.8f %.8f %.8f %.8f\n", label, (double)a.x, (double)a.y, (double)a.z, (double)a.w); } -#else -ccl_device_inline float4 make_float4(float f) -{ - return make_float4(f, f, f, f); -} #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END |