gallium: Add util_blend_uses_dest helper

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6407>
This commit is contained in:
Alyssa Rosenzweig
2020-08-20 11:45:38 -04:00
committed by Marge Bot
parent e05930511b
commit e055463459
+10
View File
@@ -132,4 +132,14 @@ util_blend_factor_uses_dest(enum pipe_blendfactor factor, bool alpha)
}
}
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) ||
rt.rgb_dst_factor != PIPE_BLENDFACTOR_ZERO ||
rt.alpha_dst_factor != PIPE_BLENDFACTOR_ZERO);
}
#endif /* U_BLEND_H */