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:
Diffstat (limited to 'intern/cycles/util/util_math.h')
-rw-r--r--intern/cycles/util/util_math.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index fd3199f209f..85cbd18b7ba 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -266,6 +266,11 @@ ccl_device_inline int floor_to_int(float f)
return float_to_int(floorf(f));
}
+ccl_device_inline int quick_floor_to_int(float x)
+{
+ return float_to_int(x) - ((x < 0) ? 1 : 0);
+}
+
ccl_device_inline int ceil_to_int(float f)
{
return float_to_int(ceilf(f));
@@ -550,6 +555,11 @@ ccl_device_inline float xor_signmask(float x, int y)
return __int_as_float(__float_as_int(x) ^ y);
}
+ccl_device float bits_to_01(uint bits)
+{
+ return bits * (1.0f/(float)0xFFFFFFFF);
+}
+
/* projections */
ccl_device_inline float2 map_to_tube(const float3 co)
{