From f081bacc25fa62888f0983e8e9658325dc835e95 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 4 Aug 2009 11:51:13 +0100 Subject: llvmpipe: Move p_build_context to lp_bld_type.h As it will be shared with more modules. --- src/gallium/drivers/llvmpipe/lp_bld_type.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/gallium/drivers/llvmpipe/lp_bld_type.h') diff --git a/src/gallium/drivers/llvmpipe/lp_bld_type.h b/src/gallium/drivers/llvmpipe/lp_bld_type.h index 4623183223..0eeaf7b6aa 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_type.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_type.h @@ -108,6 +108,32 @@ union lp_type { }; +/** + * We need most of the information here in order to correctly and efficiently + * translate an arithmetic operation into LLVM IR. Putting it here avoids the + * trouble of passing it as parameters. + */ +struct lp_build_context +{ + LLVMBuilderRef builder; + + /** + * This not only describes the input/output LLVM types, but also whether + * to normalize/clamp the results. + */ + union lp_type type; + + /** Same as lp_build_undef(type) */ + LLVMValueRef undef; + + /** Same as lp_build_zero(type) */ + LLVMValueRef zero; + + /** Same as lp_build_one(type) */ + LLVMValueRef one; +}; + + LLVMTypeRef lp_build_elem_type(union lp_type type); -- cgit v1.2.3