summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_arit.h
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-03 22:31:08 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:22 +0100
commit64611e086dbefa2003773ab541c0381b5713e18d (patch)
treeecec50beeb8e27ddf029534bed69c1fd28c57a8a /src/gallium/drivers/llvmpipe/lp_bld_arit.h
parentc87fab0008453567b45dd5e5eb7dd5d026990071 (diff)
llvmpipe: Separate constant building.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_arit.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_arit.h39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.h b/src/gallium/drivers/llvmpipe/lp_bld_arit.h
index c437d2bcd0..cec54a257f 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_arit.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.h
@@ -43,43 +43,28 @@
union lp_type type;
-/*
- * Constants
- */
-
-
-LLVMValueRef
-lp_build_undef(union lp_type type);
-
-
-LLVMValueRef
-lp_build_zero(union lp_type type);
-
-
-LLVMValueRef
-lp_build_one(union lp_type type);
-
-
-LLVMValueRef
-lp_build_const_aos(union lp_type type,
- double r, double g, double b, double a,
- const unsigned char *swizzle);
-
-/*
- * Basic arithmetic
- */
-
-
/**
+ * 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;
};