brw_blorp_params_init(struct brw_blorp_params *params)
{
memset(params, 0, sizeof(*params));
- params->hiz_op = GEN6_HIZ_OP_NONE;
params->num_draw_buffers = 1;
params->num_layers = 1;
}
void
blorp_gen6_hiz_op(struct blorp_batch *batch,
struct brw_blorp_surf *surf, unsigned level, unsigned layer,
- enum gen6_hiz_op op)
+ enum blorp_hiz_op op)
{
struct brw_blorp_params params;
brw_blorp_params_init(¶ms);
#include <stdbool.h>
#include "isl/isl.h"
-#include "intel_resolve_map.h" /* needed for enum gen6_hiz_op */
struct brw_context;
struct brw_wm_prog_key;
brw_blorp_ccs_resolve(struct blorp_batch *batch,
struct brw_blorp_surf *surf, enum isl_format format);
+/**
+ * For an overview of the HiZ operations, see the following sections of the
+ * Sandy Bridge PRM, Volume 1, Part2:
+ * - 7.5.3.1 Depth Buffer Clear
+ * - 7.5.3.2 Depth Buffer Resolve
+ * - 7.5.3.3 Hierarchical Depth Buffer Resolve
+ *
+ * Of these, two get entered in the resolve map as needing to be done to the
+ * buffer: depth resolve and hiz resolve.
+ */
+enum blorp_hiz_op {
+ BLORP_HIZ_OP_NONE,
+ BLORP_HIZ_OP_DEPTH_CLEAR,
+ BLORP_HIZ_OP_DEPTH_RESOLVE,
+ BLORP_HIZ_OP_HIZ_RESOLVE,
+};
+
void
blorp_gen6_hiz_op(struct blorp_batch *batch,
struct brw_blorp_surf *surf, unsigned level, unsigned layer,
- enum gen6_hiz_op op);
+ enum blorp_hiz_op op);
#ifdef __cplusplus
} /* end extern "C" */
uint32_t depth_format;
struct brw_blorp_surface_info src;
struct brw_blorp_surface_info dst;
- enum gen6_hiz_op hiz_op;
+ enum blorp_hiz_op hiz_op;
enum blorp_fast_clear_op fast_clear_op;
bool color_write_disable[4];
struct brw_blorp_wm_inputs wm_inputs;
static void
gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+ unsigned int level, unsigned int layer, enum blorp_hiz_op op)
{
intel_miptree_check_level_layer(mt, level, layer);
intel_miptree_used_for_rendering(mt);
*/
void
intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+ unsigned int level, unsigned int layer, enum blorp_hiz_op op)
{
const char *opname = NULL;
switch (op) {
- case GEN6_HIZ_OP_DEPTH_RESOLVE:
+ case BLORP_HIZ_OP_DEPTH_RESOLVE:
opname = "depth resolve";
break;
- case GEN6_HIZ_OP_HIZ_RESOLVE:
+ case BLORP_HIZ_OP_HIZ_RESOLVE:
opname = "hiz ambiguate";
break;
- case GEN6_HIZ_OP_DEPTH_CLEAR:
+ case BLORP_HIZ_OP_DEPTH_CLEAR:
opname = "depth clear";
break;
- case GEN6_HIZ_OP_NONE:
+ case BLORP_HIZ_OP_NONE:
opname = "noop?";
break;
}
void
intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+ unsigned int level, unsigned int layer, enum blorp_hiz_op op);
void gen6_blorp_exec(struct blorp_batch *batch,
const struct brw_blorp_params *params);
for (unsigned layer = 0; layer < depth_irb->layer_count; layer++) {
intel_hiz_exec(brw, mt, depth_irb->mt_level,
depth_irb->mt_layer + layer,
- GEN6_HIZ_OP_DEPTH_CLEAR);
+ BLORP_HIZ_OP_DEPTH_CLEAR);
}
} else {
intel_hiz_exec(brw, mt, depth_irb->mt_level, depth_irb->mt_layer,
- GEN6_HIZ_OP_DEPTH_CLEAR);
+ BLORP_HIZ_OP_DEPTH_CLEAR);
}
if (brw->gen == 6) {
uint32_t tile_x, uint32_t tile_y);
void gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+ unsigned int level, unsigned int layer, enum blorp_hiz_op op);
uint32_t get_hw_prim_for_gl_prim(int mode);
*/
void
gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+ unsigned int level, unsigned int layer, enum blorp_hiz_op op)
{
- if (op == GEN6_HIZ_OP_NONE)
+ if (op == BLORP_HIZ_OP_NONE)
return;
/* Disable the PMA stall fix since we're about to do a HiZ operation. */
uint32_t dw1 = 0;
switch (op) {
- case GEN6_HIZ_OP_DEPTH_RESOLVE:
+ case BLORP_HIZ_OP_DEPTH_RESOLVE:
dw1 |= GEN8_WM_HZ_DEPTH_RESOLVE;
break;
- case GEN6_HIZ_OP_HIZ_RESOLVE:
+ case BLORP_HIZ_OP_HIZ_RESOLVE:
dw1 |= GEN8_WM_HZ_HIZ_RESOLVE;
break;
- case GEN6_HIZ_OP_DEPTH_CLEAR:
+ case BLORP_HIZ_OP_DEPTH_CLEAR:
dw1 |= GEN8_WM_HZ_DEPTH_CLEAR;
break;
- case GEN6_HIZ_OP_NONE:
+ case BLORP_HIZ_OP_NONE:
unreachable("Should not get here.");
}
blorp_emit(batch, GENX(3DSTATE_WM), wm) {
switch (params->hiz_op) {
- case GEN6_HIZ_OP_DEPTH_CLEAR:
+ case BLORP_HIZ_OP_DEPTH_CLEAR:
wm.DepthBufferClear = true;
break;
- case GEN6_HIZ_OP_DEPTH_RESOLVE:
+ case BLORP_HIZ_OP_DEPTH_RESOLVE:
wm.DepthBufferResolveEnable = true;
break;
- case GEN6_HIZ_OP_HIZ_RESOLVE:
+ case BLORP_HIZ_OP_HIZ_RESOLVE:
wm.HierarchicalDepthBufferResolveEnable = true;
break;
- case GEN6_HIZ_OP_NONE:
+ case BLORP_HIZ_OP_NONE:
break;
default:
unreachable("not reached");
batch->blorp->isl_dev->info->max_wm_threads - 1;
switch (params->hiz_op) {
- case GEN6_HIZ_OP_DEPTH_CLEAR:
+ case BLORP_HIZ_OP_DEPTH_CLEAR:
wm.DepthBufferClear = true;
break;
- case GEN6_HIZ_OP_DEPTH_RESOLVE:
+ case BLORP_HIZ_OP_DEPTH_RESOLVE:
wm.DepthBufferResolveEnable = true;
break;
- case GEN6_HIZ_OP_HIZ_RESOLVE:
+ case BLORP_HIZ_OP_HIZ_RESOLVE:
wm.HierarchicalDepthBufferResolveEnable = true;
break;
- case GEN6_HIZ_OP_NONE:
+ case BLORP_HIZ_OP_NONE:
break;
default:
unreachable("not reached");
.DepthBufferWriteEnable = true,
};
- if (params->hiz_op == GEN6_HIZ_OP_DEPTH_RESOLVE) {
+ if (params->hiz_op == BLORP_HIZ_OP_DEPTH_RESOLVE) {
ds.DepthTestEnable = true;
ds.DepthTestFunction = COMPAREFUNCTION_NEVER;
}
exec_node_init(&m->link);
m->level = level;
m->layer = layer;
- m->need = GEN6_HIZ_OP_HIZ_RESOLVE;
+ m->need = BLORP_HIZ_OP_HIZ_RESOLVE;
exec_list_push_tail(&mt->hiz_map, &m->link);
}
return;
intel_resolve_map_set(&mt->hiz_map,
- level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
+ level, layer, BLORP_HIZ_OP_HIZ_RESOLVE);
}
return;
intel_resolve_map_set(&mt->hiz_map,
- level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
+ level, layer, BLORP_HIZ_OP_DEPTH_RESOLVE);
}
void
struct intel_mipmap_tree *mt,
uint32_t level,
uint32_t layer,
- enum gen6_hiz_op need)
+ enum blorp_hiz_op need)
{
intel_miptree_check_level_layer(mt, level, layer);
uint32_t layer)
{
return intel_miptree_slice_resolve(brw, mt, level, layer,
- GEN6_HIZ_OP_HIZ_RESOLVE);
+ BLORP_HIZ_OP_HIZ_RESOLVE);
}
bool
uint32_t layer)
{
return intel_miptree_slice_resolve(brw, mt, level, layer,
- GEN6_HIZ_OP_DEPTH_RESOLVE);
+ BLORP_HIZ_OP_DEPTH_RESOLVE);
}
static bool
intel_miptree_all_slices_resolve(struct brw_context *brw,
struct intel_mipmap_tree *mt,
- enum gen6_hiz_op need)
+ enum blorp_hiz_op need)
{
bool did_resolve = false;
struct intel_mipmap_tree *mt)
{
return intel_miptree_all_slices_resolve(brw, mt,
- GEN6_HIZ_OP_HIZ_RESOLVE);
+ BLORP_HIZ_OP_HIZ_RESOLVE);
}
bool
struct intel_mipmap_tree *mt)
{
return intel_miptree_all_slices_resolve(brw, mt,
- GEN6_HIZ_OP_DEPTH_RESOLVE);
+ BLORP_HIZ_OP_DEPTH_RESOLVE);
}
void
intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+ unsigned int level, unsigned int layer, enum blorp_hiz_op op);
#ifdef __cplusplus
}
intel_resolve_map_set(struct exec_list *resolve_map,
uint32_t level,
uint32_t layer,
- enum gen6_hiz_op need)
+ enum blorp_hiz_op need)
{
foreach_list_typed(struct intel_resolve_map, map, link, resolve_map) {
if (map->level == level && map->layer == layer) {
#pragma once
#include <stdint.h>
+#include "blorp.h"
#include "compiler/glsl/list.h"
#ifdef __cplusplus
extern "C" {
#endif
-/**
- * For an overview of the HiZ operations, see the following sections of the
- * Sandy Bridge PRM, Volume 1, Part2:
- * - 7.5.3.1 Depth Buffer Clear
- * - 7.5.3.2 Depth Buffer Resolve
- * - 7.5.3.3 Hierarchical Depth Buffer Resolve
- *
- * Of these, two get entered in the resolve map as needing to be done to the
- * buffer: depth resolve and hiz resolve.
- */
-enum gen6_hiz_op {
- GEN6_HIZ_OP_DEPTH_CLEAR,
- GEN6_HIZ_OP_DEPTH_RESOLVE,
- GEN6_HIZ_OP_HIZ_RESOLVE,
- GEN6_HIZ_OP_NONE,
-};
-
/**
* \brief Map of miptree slices to needed resolves.
*
uint32_t level;
uint32_t layer;
- enum gen6_hiz_op need;
+ enum blorp_hiz_op need;
};
void
intel_resolve_map_set(struct exec_list *resolve_map,
uint32_t level,
uint32_t layer,
- enum gen6_hiz_op need);
+ enum blorp_hiz_op need);
struct intel_resolve_map *
intel_resolve_map_get(struct exec_list *resolve_map,