radeonsi/gfx10: fix the vertex order for triangle strips emitted by a GS
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_flow.h
index 3cd5a9f42a54bdb14bc6782490e88205b16bdfd5..ddb3fdfd7b754031a20299508307096574933dcd 100644 (file)
@@ -37,6 +37,9 @@
 
 #include "gallivm/lp_bld.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 struct lp_type;
 
@@ -124,6 +127,12 @@ lp_build_loop_end(struct lp_build_loop_state *state,
                   LLVMValueRef end,
                   LLVMValueRef step);
 
+void
+lp_build_loop_force_set_counter(struct lp_build_loop_state *state,
+                                LLVMValueRef end);
+
+void
+lp_build_loop_force_reload_counter(struct lp_build_loop_state *state);
 void
 lp_build_loop_end_cond(struct lp_build_loop_state *state,
                        LLVMValueRef end,
@@ -131,6 +140,33 @@ lp_build_loop_end_cond(struct lp_build_loop_state *state,
                        LLVMIntPredicate cond);
 
 
+/**
+ * Implementation of simple C-style for loops
+ */
+struct lp_build_for_loop_state
+{
+   LLVMBasicBlockRef begin;
+   LLVMBasicBlockRef body;
+   LLVMBasicBlockRef exit;
+   LLVMValueRef counter_var;
+   LLVMValueRef counter;
+   LLVMValueRef step;
+   LLVMIntPredicate cond;
+   LLVMValueRef end;
+   struct gallivm_state *gallivm;
+};
+
+void
+lp_build_for_loop_begin(struct lp_build_for_loop_state *state,
+                        struct gallivm_state *gallivm,
+                        LLVMValueRef start,
+                        LLVMIntPredicate llvm_cond,
+                        LLVMValueRef end,
+                        LLVMValueRef step);
+
+void
+lp_build_for_loop_end(struct lp_build_for_loop_state *state);
+
 
 /**
  * if/else/endif.
@@ -165,10 +201,19 @@ lp_build_alloca(struct gallivm_state *gallivm,
                 LLVMTypeRef type,
                 const char *name);
 
+LLVMValueRef
+lp_build_alloca_undef(struct gallivm_state *gallivm,
+                      LLVMTypeRef type,
+                      const char *name);
+
 LLVMValueRef
 lp_build_array_alloca(struct gallivm_state *gallivm,
                       LLVMTypeRef type,
                       LLVMValueRef count,
                       const char *name);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !LP_BLD_FLOW_H */