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.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.h')
-rw-r--r-- | intern/cycles/util/math.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/intern/cycles/util/math.h b/intern/cycles/util/math.h index 555a5304764..d1773970bab 100644 --- a/intern/cycles/util/math.h +++ b/intern/cycles/util/math.h @@ -297,8 +297,15 @@ ccl_device_inline float4 __int4_as_float4(int4 i) #endif /* !defined(__KERNEL_METAL__) */ #if defined(__KERNEL_METAL__) -# define isnan_safe(v) isnan(v) -# define isfinite_safe(v) isfinite(v) +ccl_device_forceinline bool isnan_safe(float f) +{ + return isnan(f); +} + +ccl_device_forceinline bool isfinite_safe(float f) +{ + return isfinite(f); +} #else template<typename T> ccl_device_inline uint pointer_pack_to_uint_0(T *ptr) { |