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:
-rw-r--r--intern/cycles/util/util_math.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 9faf7149ce2..ebddd56bd40 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -619,12 +619,12 @@ ccl_device float bits_to_01(uint bits)
ccl_device_inline uint count_leading_zeros(uint x)
{
- assert(x != 0);
#if defined(__KERNEL_CUDA__) || defined(__KERNEL_OPTIX__)
return __clz(x);
#elif defined(__KERNEL_OPENCL__)
return clz(x);
#else
+ assert(x != 0);
# ifdef _MSC_VER
unsigned long leading_zero = 0;
_BitScanReverse(&leading_zero, x);
@@ -637,12 +637,12 @@ ccl_device_inline uint count_leading_zeros(uint x)
ccl_device_inline uint count_trailing_zeros(uint x)
{
- assert(x != 0);
#if defined(__KERNEL_CUDA__) || defined(__KERNEL_OPTIX__)
return (__ffs(x) - 1);
#elif defined(__KERNEL_OPENCL__)
return (31 - count_leading_zeros(x & -x));
#else
+ assert(x != 0);
# ifdef _MSC_VER
unsigned long ctz = 0;
_BitScanForward(&ctz, x);