aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_dual_blend.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-04-16 09:17:34 +0200
committermarha <marha@users.sourceforge.net>2012-04-16 09:17:34 +0200
commitd6d3999ccb2cb72d55820770260172eccbbb68d7 (patch)
tree568ce82dd1a8e2edbbe8cd4cb5ab5b14157f34f6 /mesalib/src/gallium/auxiliary/util/u_dual_blend.h
parentfffd436e9c2ec6f5aa501ee57d0e4ade7293ee60 (diff)
downloadvcxsrv-d6d3999ccb2cb72d55820770260172eccbbb68d7.tar.gz
vcxsrv-d6d3999ccb2cb72d55820770260172eccbbb68d7.tar.bz2
vcxsrv-d6d3999ccb2cb72d55820770260172eccbbb68d7.zip
libX11 xserver pixman mesa git update 16 Apr 2012
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_dual_blend.h')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_dual_blend.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_dual_blend.h b/mesalib/src/gallium/auxiliary/util/u_dual_blend.h
new file mode 100644
index 000000000..e31d43c18
--- /dev/null
+++ b/mesalib/src/gallium/auxiliary/util/u_dual_blend.h
@@ -0,0 +1,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