1#ifndef U_DUAL_BLEND_H
2#define U_DUAL_BLEND_H
3
4#include "pipe/p_state.h"
5
6static INLINE boolean util_blend_factor_is_dual_src(int factor)
7{
8   return (factor == PIPE_BLENDFACTOR_SRC1_COLOR) ||
9          (factor == PIPE_BLENDFACTOR_SRC1_ALPHA) ||
10          (factor == PIPE_BLENDFACTOR_INV_SRC1_COLOR) ||
11          (factor == PIPE_BLENDFACTOR_INV_SRC1_ALPHA);
12}
13
14static INLINE boolean util_blend_state_is_dual(const struct pipe_blend_state *blend,
15				  int index)
16{
17   if (util_blend_factor_is_dual_src(blend->rt[index].rgb_src_factor) ||
18       util_blend_factor_is_dual_src(blend->rt[index].alpha_src_factor) ||
19       util_blend_factor_is_dual_src(blend->rt[index].rgb_dst_factor) ||
20       util_blend_factor_is_dual_src(blend->rt[index].alpha_dst_factor))
21      return true;
22   return false;
23}
24
25
26#endif
27