Path: blob/21.2-virgl/src/gallium/drivers/llvmpipe/lp_bld_blend.h
4570 views
/**************************************************************************1*2* Copyright 2009 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef LP_BLD_BLEND_H28#define LP_BLD_BLEND_H293031#include "gallivm/lp_bld.h"32#include "gallivm/lp_bld_init.h"3334#include "pipe/p_format.h"353637struct pipe_blend_state;38struct lp_type;39struct lp_build_context;40struct lp_build_mask_context;414243LLVMValueRef44lp_build_blend(struct lp_build_context *bld,45unsigned func,46unsigned factor_src,47unsigned factor_dst,48LLVMValueRef src,49LLVMValueRef dst,50LLVMValueRef src_factor,51LLVMValueRef dst_factor,52boolean not_alpha_dependent,53boolean optimise_only);545556LLVMValueRef57lp_build_blend_aos(struct gallivm_state *gallivm,58const struct pipe_blend_state *blend,59enum pipe_format cbuf_format,60struct lp_type type,61unsigned rt,62LLVMValueRef src,63LLVMValueRef src_alpha,64LLVMValueRef src1,65LLVMValueRef src1_alpha,66LLVMValueRef dst,67LLVMValueRef mask,68LLVMValueRef const_,69LLVMValueRef const_alpha,70const unsigned char swizzle[4],71int nr_channels);727374/**75* Apply a logic op.76*77* src/dst parameters are packed values. It should work regardless the inputs78* are scalars, or a vector.79*/80LLVMValueRef81lp_build_logicop(LLVMBuilderRef builder,82unsigned logicop_func,83LLVMValueRef src,84LLVMValueRef dst);858687LLVMValueRef88lp_build_blend_func(struct lp_build_context *bld,89unsigned func,90LLVMValueRef term1,91LLVMValueRef term2);929394boolean95lp_build_blend_func_reverse(unsigned rgb_func,96unsigned alpha_func);979899boolean100lp_build_blend_func_commutative(unsigned func);101102void103lp_build_alpha_to_coverage(struct gallivm_state *gallivm,104struct lp_type type,105struct lp_build_mask_context *mask,106LLVMValueRef alpha,107boolean do_branch);108109#endif /* !LP_BLD_BLEND_H */110111112