X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fllvmpipe%2Flp_bld_blend.h;h=adfab85dc097491e636635b3c8eab99c233a6765;hb=430d384c311468c6180a1d67ed90bb74d4fe1c3b;hp=d19e18846c286cb8ffe04da8b1f28952ecd6acbb;hpb=5d526ed21ac9f1ec9220c2adb4c905893eb9d990;p=mesa.git diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend.h b/src/gallium/drivers/llvmpipe/lp_bld_blend.h index d19e18846c2..adfab85dc09 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend.h @@ -29,66 +29,47 @@ #define LP_BLD_BLEND_H -/** - * @file - * LLVM IR building helpers interfaces. - * - * We use LLVM-C bindings for now. They are not documented, but follow the C++ - * interfaces very closely, and appear to be complete enough for code - * genration. See - * http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html - * for a standalone example. - */ - -#include +#include "gallivm/lp_bld.h" +#include "gallivm/lp_bld_init.h" #include "pipe/p_format.h" struct pipe_blend_state; -union lp_type; +struct lp_type; struct lp_build_context; - - -/** - * Whether the blending function is commutative or not. - */ -boolean -lp_build_blend_func_commutative(unsigned func); - - -/** - * Whether the blending functions are the reverse of each other. - */ -boolean -lp_build_blend_func_reverse(unsigned rgb_func, unsigned alpha_func); +struct lp_build_mask_context; LLVMValueRef -lp_build_blend_func(struct lp_build_context *bld, - unsigned func, - LLVMValueRef term1, - LLVMValueRef term2); +lp_build_blend(struct lp_build_context *bld, + unsigned func, + unsigned factor_src, + unsigned factor_dst, + LLVMValueRef src, + LLVMValueRef dst, + LLVMValueRef src_factor, + LLVMValueRef dst_factor, + boolean not_alpha_dependent, + boolean optimise_only); LLVMValueRef -lp_build_blend_aos(LLVMBuilderRef builder, +lp_build_blend_aos(struct gallivm_state *gallivm, const struct pipe_blend_state *blend, - union lp_type type, + enum pipe_format cbuf_format, + struct lp_type type, + unsigned rt, LLVMValueRef src, + LLVMValueRef src_alpha, + LLVMValueRef src1, + LLVMValueRef src1_alpha, LLVMValueRef dst, + LLVMValueRef mask, LLVMValueRef const_, - unsigned alpha_swizzle); - - -void -lp_build_blend_soa(LLVMBuilderRef builder, - const struct pipe_blend_state *blend, - union lp_type type, - LLVMValueRef src[4], - LLVMValueRef dst[4], - LLVMValueRef const_[4], - LLVMValueRef res[4]); + LLVMValueRef const_alpha, + const unsigned char swizzle[4], + int nr_channels); /** @@ -104,4 +85,26 @@ lp_build_logicop(LLVMBuilderRef builder, LLVMValueRef dst); +LLVMValueRef +lp_build_blend_func(struct lp_build_context *bld, + unsigned func, + LLVMValueRef term1, + LLVMValueRef term2); + + +boolean +lp_build_blend_func_reverse(unsigned rgb_func, + unsigned alpha_func); + + +boolean +lp_build_blend_func_commutative(unsigned func); + +void +lp_build_alpha_to_coverage(struct gallivm_state *gallivm, + struct lp_type type, + struct lp_build_mask_context *mask, + LLVMValueRef alpha, + boolean do_branch); + #endif /* !LP_BLD_BLEND_H */