util: Fix c++ enum casting pickiness
authorRob Clark <robdclark@chromium.org>
Sun, 17 Jul 2022 18:17:47 +0000 (11:17 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 2 Aug 2022 00:59:48 +0000 (00:59 +0000)
Fix problems when included from c++

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17816>

src/gallium/auxiliary/util/u_blend.h

index 7fccdb2..e9308b5 100644 (file)
@@ -136,8 +136,8 @@ static inline bool
 util_blend_uses_dest(struct pipe_rt_blend_state rt)
 {
    return rt.blend_enable &&
-      (util_blend_factor_uses_dest(rt.rgb_src_factor, false) ||
-       util_blend_factor_uses_dest(rt.alpha_src_factor, true) ||
+      (util_blend_factor_uses_dest((enum pipe_blendfactor)rt.rgb_src_factor, false) ||
+       util_blend_factor_uses_dest((enum pipe_blendfactor)rt.alpha_src_factor, true) ||
        rt.rgb_dst_factor != PIPE_BLENDFACTOR_ZERO ||
        rt.alpha_dst_factor != PIPE_BLENDFACTOR_ZERO);
 }