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
32 struct brw_wm_prog_key
;
41 struct blorp_context
{
44 const struct isl_device
*isl_dev
;
46 const struct brw_compiler
*compiler
;
54 bool (*lookup_shader
)(struct blorp_context
*blorp
,
55 const void *key
, uint32_t key_size
,
56 uint32_t *kernel_out
, void *prog_data_out
);
57 void (*upload_shader
)(struct blorp_context
*blorp
,
58 const void *key
, uint32_t key_size
,
59 const void *kernel
, uint32_t kernel_size
,
60 const void *prog_data
, uint32_t prog_data_size
,
61 uint32_t *kernel_out
, void *prog_data_out
);
62 void (*exec
)(struct blorp_batch
*batch
, const struct blorp_params
*params
);
65 void blorp_init(struct blorp_context
*blorp
, void *driver_ctx
,
66 struct isl_device
*isl_dev
);
67 void blorp_finish(struct blorp_context
*blorp
);
70 struct blorp_context
*blorp
;
74 void blorp_batch_init(struct blorp_context
*blorp
, struct blorp_batch
*batch
,
76 void blorp_batch_finish(struct blorp_batch
*batch
);
78 struct blorp_address
{
80 uint32_t read_domains
;
81 uint32_t write_domain
;
87 const struct isl_surf
*surf
;
88 struct blorp_address addr
;
90 const struct isl_surf
*aux_surf
;
91 struct blorp_address aux_addr
;
92 enum isl_aux_usage aux_usage
;
94 union isl_color_value clear_color
;
98 blorp_blit(struct blorp_batch
*batch
,
99 const struct blorp_surf
*src_surf
,
100 unsigned src_level
, unsigned src_layer
,
101 enum isl_format src_format
, struct isl_swizzle src_swizzle
,
102 const struct blorp_surf
*dst_surf
,
103 unsigned dst_level
, unsigned dst_layer
,
104 enum isl_format dst_format
,
105 float src_x0
, float src_y0
,
106 float src_x1
, float src_y1
,
107 float dst_x0
, float dst_y0
,
108 float dst_x1
, float dst_y1
,
109 uint32_t filter
, bool mirror_x
, bool mirror_y
);
112 blorp_fast_clear(struct blorp_batch
*batch
,
113 const struct blorp_surf
*surf
, enum isl_format format
,
114 uint32_t level
, uint32_t start_layer
, uint32_t num_layers
,
115 uint32_t x0
, uint32_t y0
, uint32_t x1
, uint32_t y1
);
118 blorp_clear(struct blorp_batch
*batch
,
119 const struct blorp_surf
*surf
,
120 uint32_t level
, uint32_t start_layer
, uint32_t num_layers
,
121 uint32_t x0
, uint32_t y0
, uint32_t x1
, uint32_t y1
,
122 enum isl_format format
, union isl_color_value clear_color
,
123 bool color_write_disable
[4]);
126 blorp_ccs_resolve(struct blorp_batch
*batch
,
127 struct blorp_surf
*surf
, enum isl_format format
);
130 * For an overview of the HiZ operations, see the following sections of the
131 * Sandy Bridge PRM, Volume 1, Part2:
132 * - 7.5.3.1 Depth Buffer Clear
133 * - 7.5.3.2 Depth Buffer Resolve
134 * - 7.5.3.3 Hierarchical Depth Buffer Resolve
136 * Of these, two get entered in the resolve map as needing to be done to the
137 * buffer: depth resolve and hiz resolve.
141 BLORP_HIZ_OP_DEPTH_CLEAR
,
142 BLORP_HIZ_OP_DEPTH_RESOLVE
,
143 BLORP_HIZ_OP_HIZ_RESOLVE
,
147 blorp_gen6_hiz_op(struct blorp_batch
*batch
,
148 struct blorp_surf
*surf
, unsigned level
, unsigned layer
,
149 enum blorp_hiz_op op
);
152 } /* end extern "C" */
153 #endif /* __cplusplus */