llvmpipe: move getting mask value out of depth code. (v2)
[mesa.git] / src / gallium / drivers / llvmpipe / lp_bld_depth.h
index 5d2e042fcc5a135fd877207882c8a0d9cbc93ba6..f0115daacc11553dbd003483b05fb340f7244337 100644 (file)
 #define LP_BLD_DEPTH_H
 
 
-#include <llvm-c/Core.h>  
+#include "pipe/p_compiler.h"
+#include "pipe/p_state.h"
+
+#include "gallivm/lp_bld.h"
 
  
 struct pipe_depth_state;
+struct gallivm_state;
 struct util_format_description;
-union lp_type;
+struct lp_type;
 struct lp_build_mask_context;
 
 
-union lp_type
+struct lp_type
 lp_depth_type(const struct util_format_description *format_desc,
               unsigned length);
 
 
 void
-lp_build_depth_test(LLVMBuilderRef builder,
-                    const struct pipe_depth_state *state,
-                    union lp_type type,
-                    const struct util_format_description *format_desc,
-                    struct lp_build_mask_context *mask,
-                    LLVMValueRef src,
-                    LLVMValueRef dst_ptr);
+lp_build_depth_stencil_test(struct gallivm_state *gallivm,
+                            const struct pipe_depth_state *depth,
+                            const struct pipe_stencil_state stencil[2],
+                            struct lp_type z_src_type,
+                            const struct util_format_description *format_desc,
+                            struct lp_build_mask_context *mask,
+                            LLVMValueRef stencil_refs[2],
+                            LLVMValueRef z_src,
+                            LLVMValueRef z_fb,
+                            LLVMValueRef s_fb,
+                            LLVMValueRef face,
+                            LLVMValueRef *z_value,
+                            LLVMValueRef *s_value,
+                            boolean do_branch);
+
+void
+lp_build_depth_stencil_load_swizzled(struct gallivm_state *gallivm,
+                                     struct lp_type z_src_type,
+                                     const struct util_format_description *format_desc,
+                                     boolean is_1d,
+                                     LLVMValueRef depth_ptr,
+                                     LLVMValueRef depth_stride,
+                                     LLVMValueRef *z_fb,
+                                     LLVMValueRef *s_fb,
+                                     LLVMValueRef loop_counter);
 
+void
+lp_build_depth_stencil_write_swizzled(struct gallivm_state *gallivm,
+                                      struct lp_type z_src_type,
+                                      const struct util_format_description *format_desc,
+                                      boolean is_1d,
+                                      LLVMValueRef mask_value,
+                                      LLVMValueRef z_fb,
+                                      LLVMValueRef s_fb,
+                                      LLVMValueRef loop_counter,
+                                      LLVMValueRef depth_ptr,
+                                      LLVMValueRef depth_stride,
+                                      LLVMValueRef z_value,
+                                      LLVMValueRef s_value);
+
+
+void
+lp_build_occlusion_count(struct gallivm_state *gallivm,
+                         struct lp_type type,
+                         LLVMValueRef maskvalue,
+                         LLVMValueRef counter);
 
 #endif /* !LP_BLD_DEPTH_H */