From: Dave Airlie <[email protected]> This is just a function to tell if a certain blend mode requires dual sources.
Signed-off-by: Dave Airlie <[email protected]> --- src/gallium/auxiliary/util/u_dual_blend.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 src/gallium/auxiliary/util/u_dual_blend.h diff --git a/src/gallium/auxiliary/util/u_dual_blend.h b/src/gallium/auxiliary/util/u_dual_blend.h new file mode 100644 index 0000000..5c2ddab --- /dev/null +++ b/src/gallium/auxiliary/util/u_dual_blend.h @@ -0,0 +1,23 @@ +#ifndef U_DUAL_BLEND_H +#define U_DUAL_BLEND_H + +#include "pipe/p_state.h" + +#define util_is_dual_src_blend(x) (((x) == PIPE_BLENDFACTOR_SRC1_COLOR) || \ + ((x) == PIPE_BLENDFACTOR_SRC1_ALPHA) || \ + ((x) == PIPE_BLENDFACTOR_INV_SRC1_COLOR) || \ + ((x) == PIPE_BLENDFACTOR_INV_SRC1_ALPHA)) + +static INLINE boolean util_blend_state_is_dual(const struct pipe_blend_state *blend, + int index) +{ + if (util_is_dual_src_blend(blend->rt[index].rgb_src_factor) || + util_is_dual_src_blend(blend->rt[index].alpha_src_factor) || + util_is_dual_src_blend(blend->rt[index].rgb_dst_factor) || + util_is_dual_src_blend(blend->rt[index].alpha_dst_factor)) + return true; + return false; +} + + +#endif -- 1.7.7.6 _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
