aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_dual_blend.h
blob: e31d43c18bd7c90ad6de179dc521c868903dce7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef U_DUAL_BLEND_H
#define U_DUAL_BLEND_H

#include "pipe/p_state.h"

static INLINE boolean util_blend_factor_is_dual_src(int factor)
{
   return (factor == PIPE_BLENDFACTOR_SRC1_COLOR) ||
          (factor == PIPE_BLENDFACTOR_SRC1_ALPHA) ||
          (factor == PIPE_BLENDFACTOR_INV_SRC1_COLOR) ||
          (factor == PIPE_BLENDFACTOR_INV_SRC1_ALPHA);
}

static INLINE boolean util_blend_state_is_dual(const struct pipe_blend_state *blend, 
				  int index)
{
   if (util_blend_factor_is_dual_src(blend->rt[index].rgb_src_factor) ||
       util_blend_factor_is_dual_src(blend->rt[index].alpha_src_factor) ||
       util_blend_factor_is_dual_src(blend->rt[index].rgb_dst_factor) ||
       util_blend_factor_is_dual_src(blend->rt[index].alpha_dst_factor))
      return true;
   return false;
}


#endif