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:
authorWilliam Leeson <leesonw>2021-10-27 14:28:13 +0300
committerWilliam Leeson <william@blender.org>2021-10-27 15:05:46 +0300
commit7b1c5712f888ea37bbccafd9ffd7a3a6a61e665f (patch)
tree659551f820d8b70fe1c37ac6a8711fcd73cd7434 /intern/cycles/scene
parent18b6f0d0f18732a071b75ad56a2475c383d19111 (diff)
Cycles: Replace saturate with saturatef
saturate is depricated in favour of __saturatef this replaces saturate with __saturatef on CUDA by createing a saturatef function which replaces all instances of saturate and are hooked up to the correct function on all platforms. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13010
Diffstat (limited to 'intern/cycles/scene')
-rw-r--r--intern/cycles/scene/constant_fold.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/scene/constant_fold.cpp b/intern/cycles/scene/constant_fold.cpp
index ca065e3f678..a1fa34e7628 100644
--- a/intern/cycles/scene/constant_fold.cpp
+++ b/intern/cycles/scene/constant_fold.cpp
@@ -68,15 +68,15 @@ void ConstantFolder::make_constant(float3 value) const
void ConstantFolder::make_constant_clamp(float value, bool clamp) const
{
- make_constant(clamp ? saturate(value) : value);
+ make_constant(clamp ? saturatef(value) : value);
}
void ConstantFolder::make_constant_clamp(float3 value, bool clamp) const
{
if (clamp) {
- value.x = saturate(value.x);
- value.y = saturate(value.y);
- value.z = saturate(value.z);
+ value.x = saturatef(value.x);
+ value.y = saturatef(value.y);
+ value.z = saturatef(value.z);
}
make_constant(value);
@@ -215,7 +215,7 @@ void ConstantFolder::fold_mix(NodeMix type, bool clamp) const
ShaderInput *color1_in = node->input("Color1");
ShaderInput *color2_in = node->input("Color2");
- float fac = saturate(node->get_float(fac_in->socket_type));
+ float fac = saturatef(node->get_float(fac_in->socket_type));
bool fac_is_zero = !fac_in->link && fac == 0.0f;
bool fac_is_one = !fac_in->link && fac == 1.0f;