xref: /third_party/mesa3d/src/gallium/auxiliary/util/u_dual_blend.h (revision bf215546)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/mesa3d/src/gallium/auxiliary/util/
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

Indexes created Thu Nov 07 10:32:03 CST 2024