1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**************************************************************************
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2009 VMware, Inc.
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * All Rights Reserved.
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * "Software"), to deal in the Software without restriction, including
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * without limitation the rights to use, copy, modify, merge, publish,
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * distribute, sub license, and/or sell copies of the Software, and to
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * permit persons to whom the Software is furnished to do so, subject to
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the following conditions:
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice (including the
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * next paragraph) shall be included in all copies or substantial portions
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the Software.
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org **************************************************************************/
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Depth/stencil testing to LLVM IR translation.
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * @author Jose Fonseca <jfonseca@vmware.com>
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef LP_BLD_DEPTH_H
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LP_BLD_DEPTH_H
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_compiler.h"
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_state.h"
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "gallivm/lp_bld.h"
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct pipe_depth_state;
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct gallivm_state;
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct util_format_description;
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct lp_type;
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct lp_build_mask_context;
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct lp_type
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orglp_depth_type(const struct util_format_description *format_desc,
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org              unsigned length);
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orglp_build_depth_stencil_test(struct gallivm_state *gallivm,
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            const struct pipe_depth_state *depth,
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            const struct pipe_stencil_state stencil[2],
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            struct lp_type type,
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            const struct util_format_description *format_desc,
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            struct lp_build_mask_context *mask,
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            LLVMValueRef stencil_refs[2],
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            LLVMValueRef zs_src,
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            LLVMValueRef zs_dst_ptr,
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            LLVMValueRef facing,
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            LLVMValueRef *zs_value,
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            boolean do_branch);
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orglp_build_depth_write(LLVMBuilderRef builder,
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     const struct util_format_description *format_desc,
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     LLVMValueRef zs_dst_ptr,
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     LLVMValueRef zs_value);
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orglp_build_deferred_depth_write(struct gallivm_state *gallivm,
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              struct lp_type z_src_type,
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              const struct util_format_description *format_desc,
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              struct lp_build_mask_context *mask,
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              LLVMValueRef zs_dst_ptr,
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              LLVMValueRef zs_value);
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orglp_build_occlusion_count(struct gallivm_state *gallivm,
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                         struct lp_type type,
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                         LLVMValueRef maskvalue,
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                         LLVMValueRef counter);
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* !LP_BLD_DEPTH_H */
92