[Bf-blender-cvs] [378a13483f9] master: Fix T69185: Cycles kernel OpenCL compile error after recent changes
Brecht Van Lommel
noreply at git.blender.org
Mon Aug 26 22:16:44 CEST 2019
Commit: 378a13483f95d3225570491b5e315cad904276bc
Author: Brecht Van Lommel
Date: Mon Aug 26 22:06:02 2019 +0200
Branches: master
https://developer.blender.org/rB378a13483f95d3225570491b5e315cad904276bc
Fix T69185: Cycles kernel OpenCL compile error after recent changes
===================================================================
M intern/cycles/util/util_math.h
===================================================================
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);
More information about the Bf-blender-cvs
mailing list