summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_flow.h
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-09-10 11:44:03 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-09-10 11:44:03 +0100
commit8e6b925d2a963a2d5a403e106d7d25e3dcca0775 (patch)
treed5dcbaf755ce095c1fe11c9452ec56e14fed6a30 /src/gallium/drivers/llvmpipe/lp_bld_flow.h
parentbd3b59da632d85a062accab267e18b66274b857a (diff)
llvmpipe: Proper control flow builders.
New control flow helper functions which keep track of all variables and generate the correct Phi functions. This re-enables skipping the fs execution of quads masked out by the rasterizer, early z testing, and kill opcode. This yields a performance improvement of around 20%.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_flow.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_flow.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_flow.h b/src/gallium/drivers/llvmpipe/lp_bld_flow.h
index 1b634ff038..9d76e3064d 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_flow.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_flow.h
@@ -41,23 +41,49 @@
union lp_type;
+struct lp_build_flow_context;
+
+
+struct lp_build_flow_context *
+lp_build_flow_create(LLVMBuilderRef builder);
+
+void
+lp_build_flow_destroy(struct lp_build_flow_context *flow);
+
+void
+lp_build_flow_scope_begin(struct lp_build_flow_context *flow);
+
+void
+lp_build_flow_scope_declare(struct lp_build_flow_context *flow,
+ LLVMValueRef *variable);
+
+void
+lp_build_flow_scope_end(struct lp_build_flow_context *flow);
+
+void
+lp_build_flow_skip_begin(struct lp_build_flow_context *flow);
+
+void
+lp_build_flow_skip_cond_break(struct lp_build_flow_context *flow,
+ LLVMValueRef cond);
+
+void
+lp_build_flow_skip_end(struct lp_build_flow_context *flow);
+
+
struct lp_build_mask_context
{
- LLVMBuilderRef builder;
+ struct lp_build_flow_context *flow;
LLVMTypeRef reg_type;
LLVMValueRef value;
-
- LLVMValueRef phi;
-
- LLVMBasicBlockRef skip_block;
};
void
lp_build_mask_begin(struct lp_build_mask_context *mask,
- LLVMBuilderRef builder,
+ struct lp_build_flow_context *flow,
union lp_type type,
LLVMValueRef value);