2 * Copyright © 2012 Intel Corporation
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:
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
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
33 struct brw_wm_prog_key
;
42 struct blorp_context
{
45 const struct isl_device
*isl_dev
;
47 const struct brw_compiler
*compiler
;
55 bool (*lookup_shader
)(struct blorp_context
*blorp
,
56 const void *key
, uint32_t key_size
,
57 uint32_t *kernel_out
, void *prog_data_out
);
58 void (*upload_shader
)(struct blorp_context
*blorp
,
59 const void *key
, uint32_t key_size
,
60 const void *kernel
, uint32_t kernel_size
,
61 const void *prog_data
, uint32_t prog_data_size
,
62 uint32_t *kernel_out
, void *prog_data_out
);
63 void (*exec
)(struct blorp_batch
*batch
, const struct blorp_params
*params
);
66 void blorp_init(struct blorp_context
*blorp
, void *driver_ctx
,
67 struct isl_device
*isl_dev
);
68 void blorp_finish(struct blorp_context
*blorp
);
71 struct blorp_context
*blorp
;
75 void blorp_batch_init(struct blorp_context
*blorp
, struct blorp_batch
*batch
,
77 void blorp_batch_finish(struct blorp_batch
*batch
);
79 struct blorp_address
{
81 uint32_t read_domains
;
82 uint32_t write_domain
;
88 const struct isl_surf
*surf
;
89 struct blorp_address addr
;
91 const struct isl_surf
*aux_surf
;
92 struct blorp_address aux_addr
;
93 enum isl_aux_usage aux_usage
;
95 union isl_color_value clear_color
;
99 blorp_blit(struct blorp_batch
*batch
,
100 const struct blorp_surf
*src_surf
,
101 unsigned src_level
, unsigned src_layer
,
102 enum isl_format src_format
, struct isl_swizzle src_swizzle
,
103 const struct blorp_surf
*dst_surf
,
104 unsigned dst_level
, unsigned dst_layer
,
105 enum isl_format dst_format
, struct isl_swizzle dst_swizzle
,
106 float src_x0
, float src_y0
,
107 float src_x1
, float src_y1
,
108 float dst_x0
, float dst_y0
,
109 float dst_x1
, float dst_y1
,
110 uint32_t filter
, bool mirror_x
, bool mirror_y
);
113 blorp_copy(struct blorp_batch
*batch
,
114 const struct blorp_surf
*src_surf
,
115 unsigned src_level
, unsigned src_layer
,
116 const struct blorp_surf
*dst_surf
,
117 unsigned dst_level
, unsigned dst_layer
,
118 uint32_t src_x
, uint32_t src_y
,
119 uint32_t dst_x
, uint32_t dst_y
,
120 uint32_t src_width
, uint32_t src_height
);
123 blorp_fast_clear(struct blorp_batch
*batch
,
124 const struct blorp_surf
*surf
, enum isl_format format
,
125 uint32_t level
, uint32_t start_layer
, uint32_t num_layers
,
126 uint32_t x0
, uint32_t y0
, uint32_t x1
, uint32_t y1
);
129 blorp_clear(struct blorp_batch
*batch
,
130 const struct blorp_surf
*surf
,
131 enum isl_format format
, struct isl_swizzle swizzle
,
132 uint32_t level
, uint32_t start_layer
, uint32_t num_layers
,
133 uint32_t x0
, uint32_t y0
, uint32_t x1
, uint32_t y1
,
134 union isl_color_value clear_color
,
135 const bool color_write_disable
[4]);
138 blorp_clear_depth_stencil(struct blorp_batch
*batch
,
139 const struct blorp_surf
*depth
,
140 const struct blorp_surf
*stencil
,
141 uint32_t level
, uint32_t start_layer
,
143 uint32_t x0
, uint32_t y0
, uint32_t x1
, uint32_t y1
,
144 bool clear_depth
, float depth_value
,
145 uint8_t stencil_mask
, uint8_t stencil_value
);
148 blorp_ccs_resolve(struct blorp_batch
*batch
,
149 struct blorp_surf
*surf
, enum isl_format format
);
152 * For an overview of the HiZ operations, see the following sections of the
153 * Sandy Bridge PRM, Volume 1, Part2:
154 * - 7.5.3.1 Depth Buffer Clear
155 * - 7.5.3.2 Depth Buffer Resolve
156 * - 7.5.3.3 Hierarchical Depth Buffer Resolve
158 * Of these, two get entered in the resolve map as needing to be done to the
159 * buffer: depth resolve and hiz resolve.
163 BLORP_HIZ_OP_DEPTH_CLEAR
,
164 BLORP_HIZ_OP_DEPTH_RESOLVE
,
165 BLORP_HIZ_OP_HIZ_RESOLVE
,
169 blorp_gen6_hiz_op(struct blorp_batch
*batch
,
170 struct blorp_surf
*surf
, unsigned level
, unsigned layer
,
171 enum blorp_hiz_op op
);
174 } /* end extern "C" */
175 #endif /* __cplusplus */