Merge branch 'gallium-userbuf'
[mesa.git] / src / mesa / drivers / dri / i965 / gen6_blorp.h
1 /*
2 * Copyright © 2011 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24 #pragma once
25
26 #include <stdint.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 struct intel_context;
33 struct intel_mipmap_tree;
34
35 /**
36 * For an overview of the HiZ operations, see the following sections of the
37 * Sandy Bridge PRM, Volume 1, Part2:
38 * - 7.5.3.1 Depth Buffer Clear
39 * - 7.5.3.2 Depth Buffer Resolve
40 * - 7.5.3.3 Hierarchical Depth Buffer Resolve
41 */
42 enum gen6_hiz_op {
43 GEN6_HIZ_OP_DEPTH_CLEAR,
44 GEN6_HIZ_OP_DEPTH_RESOLVE,
45 GEN6_HIZ_OP_HIZ_RESOLVE,
46 };
47
48 /**
49 * \name HiZ internals
50 * \{
51 *
52 * Used internally by gen6_hiz_exec() and gen7_hiz_exec().
53 */
54
55 void
56 gen6_hiz_init(struct brw_context *brw);
57
58 void
59 gen6_hiz_emit_batch_head(struct brw_context *brw);
60
61 void
62 gen6_hiz_emit_vertices(struct brw_context *brw,
63 struct intel_mipmap_tree *mt,
64 unsigned int level,
65 unsigned int layer);
66
67 void
68 gen6_hiz_emit_depth_stencil_state(struct brw_context *brw,
69 enum gen6_hiz_op op,
70 uint32_t *out_offset);
71 /** \} */
72
73 void
74 gen6_resolve_hiz_slice(struct intel_context *intel,
75 struct intel_mipmap_tree *mt,
76 uint32_t level,
77 uint32_t layer);
78
79 void
80 gen6_resolve_depth_slice(struct intel_context *intel,
81 struct intel_mipmap_tree *mt,
82 uint32_t level,
83 uint32_t layer);
84
85 #ifdef __cplusplus
86 }
87 #endif