diff options
author | Andrii Symkin <pembem22> | 2022-06-23 15:29:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-23 16:02:53 +0300 |
commit | c2a2f3553aed58ae9e4c165f8bfcad2b31dcf74b (patch) | |
tree | 236fca0080484dc7e9b1f8816e2770b4422db00d /intern/cycles/util/math_float4.h | |
parent | b8403b065e222faff3dfb3e2e9aa1b3d3f56c555 (diff) |
Cycles: unify math functions names
This patch unifies the names of math functions for different data types and uses
overloading instead. The goal is to make it possible to swap out all the float3
variables containing RGB data with something else, with as few as possible
changes to the code. It's a requirement for future spectral rendering patches.
Differential Revision: https://developer.blender.org/D15276
Diffstat (limited to 'intern/cycles/util/math_float4.h')
-rw-r--r-- | intern/cycles/util/math_float4.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/util/math_float4.h b/intern/cycles/util/math_float4.h index ae9dfe75a9c..073c65c2d6a 100644 --- a/intern/cycles/util/math_float4.h +++ b/intern/cycles/util/math_float4.h @@ -55,7 +55,7 @@ ccl_device_inline float4 floor(const float4 &a); ccl_device_inline float4 mix(const float4 &a, const float4 &b, float t); #endif /* !__KERNEL_METAL__*/ -ccl_device_inline float4 safe_divide_float4_float(const float4 a, const float b); +ccl_device_inline float4 safe_divide(const float4 a, const float b); #ifdef __KERNEL_SSE__ template<size_t index_0, size_t index_1, size_t index_2, size_t index_3> @@ -500,17 +500,17 @@ ccl_device_inline float4 load_float4(ccl_private const float *v) #endif /* !__KERNEL_GPU__ */ -ccl_device_inline float4 safe_divide_float4_float(const float4 a, const float b) +ccl_device_inline float4 safe_divide(const float4 a, const float b) { return (b != 0.0f) ? a / b : zero_float4(); } -ccl_device_inline bool isfinite4_safe(float4 v) +ccl_device_inline bool isfinite_safe(float4 v) { return isfinite_safe(v.x) && isfinite_safe(v.y) && isfinite_safe(v.z) && isfinite_safe(v.w); } -ccl_device_inline float4 ensure_finite4(float4 v) +ccl_device_inline float4 ensure_finite(float4 v) { if (!isfinite_safe(v.x)) v.x = 0.0f; |