From 378a13483f95d3225570491b5e315cad904276bc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 26 Aug 2019 22:06:02 +0200 Subject: Fix T69185: Cycles kernel OpenCL compile error after recent changes --- intern/cycles/util/util_math.h | 4 ++-- 1 file 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); -- cgit v1.2.3