From 42cbc52b07e54c77d5d573090ed2c286c0294f6e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 26 Mar 2025 17:20:33 +0100 Subject: [PATCH] Fix: Warning in Cycles motion blur kernel features expression This fixes the following warning with MSVC: device_impl.cpp(287): warning C4805: '|=': unsafe mix of type 'bool' and type 'ccl::uint' in operation The similar fix is applied to Metal code as well. There is no short-circuiting boolean operator ||=, so expand the expression. Pull Request: https://projects.blender.org/blender/blender/pulls/136561 --- intern/cycles/device/hiprt/device_impl.cpp | 2 +- intern/cycles/device/metal/device_impl.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intern/cycles/device/hiprt/device_impl.cpp b/intern/cycles/device/hiprt/device_impl.cpp index 92f71419e21..05b738108f5 100644 --- a/intern/cycles/device/hiprt/device_impl.cpp +++ b/intern/cycles/device/hiprt/device_impl.cpp @@ -284,7 +284,7 @@ bool HIPRTDevice::load_kernels(const uint kernel_features) * This is necessary since objects may be reported to have motion if the Vector pass is * active, but may still need to be rendered without motion blur if that isn't active as well. */ - use_motion_blur |= kernel_features & KERNEL_FEATURE_OBJECT_MOTION; + use_motion_blur = use_motion_blur || (kernel_features & KERNEL_FEATURE_OBJECT_MOTION); /* get kernel */ const char *kernel_name = "kernel"; diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index b71316e890e..91e0d721d31 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -456,7 +456,7 @@ bool MetalDevice::load_kernels(const uint _kernel_features) * This is necessary since objects may be reported to have motion if the Vector pass is * active, but may still need to be rendered without motion blur if that isn't active as well. */ - motion_blur |= kernel_features & KERNEL_FEATURE_OBJECT_MOTION; + motion_blur = motion_blur || (kernel_features & KERNEL_FEATURE_OBJECT_MOTION); /* Only request generic kernels if they aren't cached in memory. */ refresh_source_and_kernels_md5(PSO_GENERIC);