brw->intel.vtbl.render_target_supported = brw_render_target_supported;
brw->intel.vtbl.is_hiz_depth_format = brw_is_hiz_depth_format;
- if (brw->intel.has_hiz) {
- if (brw->intel.gen == 7) {
- brw->intel.vtbl.resolve_depth_slice = gen7_resolve_depth_slice;
- brw->intel.vtbl.resolve_hiz_slice = gen7_resolve_hiz_slice;
- } else if (brw->intel.gen == 6) {
- brw->intel.vtbl.resolve_depth_slice = gen6_resolve_depth_slice;
- brw->intel.vtbl.resolve_hiz_slice = gen6_resolve_hiz_slice;
- } else {
- assert(0);
- }
- }
-
if (brw->intel.gen >= 7) {
gen7_init_vtable_surface_functions(brw);
} else if (brw->intel.gen >= 4) {
brw->state.dirty.cache = ~0;
}
-/** \see intel_context::vtbl::resolve_hiz_slice */
-void
-gen6_resolve_hiz_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- brw_hiz_op_params params(mt, level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
- gen6_blorp_exec(intel, ¶ms);
-}
-
-/** \see intel_context::vtbl::resolve_depth_slice */
-void
-gen6_resolve_depth_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- brw_hiz_op_params params(mt, level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
- gen6_blorp_exec(intel, ¶ms);
-}
struct intel_context;
struct intel_mipmap_tree;
-void
-gen6_resolve_hiz_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
-
-void
-gen6_resolve_depth_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
-
#ifdef __cplusplus
}
brw->state.dirty.brw = ~0;
brw->state.dirty.cache = ~0;
}
-
-/** \copydoc gen6_resolve_hiz_slice() */
-void
-gen7_resolve_hiz_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- brw_hiz_op_params params(mt, level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
- gen7_blorp_exec(intel, ¶ms);
-}
-
-/** \copydoc gen6_resolve_depth_slice() */
-void
-gen7_resolve_depth_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- brw_hiz_op_params params(mt, level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
- gen7_blorp_exec(intel, ¶ms);
-}
struct intel_context;
struct intel_mipmap_tree;
-/** \copydoc gen6_resolve_hiz_slice() */
-void
-gen7_resolve_hiz_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
-
-/** \copydoc gen6_resolve_depth_slice() */
-void
-gen7_resolve_depth_slice(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
-
#ifdef __cplusplus
}
bool (*is_hiz_depth_format)(struct intel_context *intel,
gl_format format);
- /**
- * \name 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
- * \{
- */
- void (*resolve_hiz_slice)(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
-
- void (*resolve_depth_slice)(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
- /** \} */
-
/**
* Surface state operations (i965+ only)
* \{
level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
}
-typedef void (*resolve_func_t)(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
-
static bool
intel_miptree_slice_resolve(struct intel_context *intel,
struct intel_mipmap_tree *mt,
uint32_t level,
uint32_t layer,
- enum gen6_hiz_op need,
- resolve_func_t func)
+ enum gen6_hiz_op need)
{
intel_miptree_check_level_layer(mt, level, layer);
if (!item || item->need != need)
return false;
- func(intel, mt, level, layer);
+ intel_hiz_exec(intel, mt, level, layer, need);
intel_resolve_map_remove(item);
return true;
}
uint32_t layer)
{
return intel_miptree_slice_resolve(intel, mt, level, layer,
- GEN6_HIZ_OP_HIZ_RESOLVE,
- intel->vtbl.resolve_hiz_slice);
+ GEN6_HIZ_OP_HIZ_RESOLVE);
}
bool
uint32_t layer)
{
return intel_miptree_slice_resolve(intel, mt, level, layer,
- GEN6_HIZ_OP_DEPTH_RESOLVE,
- intel->vtbl.resolve_depth_slice);
+ GEN6_HIZ_OP_DEPTH_RESOLVE);
}
static bool
intel_miptree_all_slices_resolve(struct intel_context *intel,
struct intel_mipmap_tree *mt,
- enum gen6_hiz_op need,
- resolve_func_t func)
+ enum gen6_hiz_op need)
{
bool did_resolve = false;
struct intel_resolve_map *i, *next;
next = i->next;
if (i->need != need)
continue;
- func(intel, mt, i->level, i->layer);
+
+ intel_hiz_exec(intel, mt, i->level, i->layer, need);
intel_resolve_map_remove(i);
did_resolve = true;
}
struct intel_mipmap_tree *mt)
{
return intel_miptree_all_slices_resolve(intel, mt,
- GEN6_HIZ_OP_HIZ_RESOLVE,
- intel->vtbl.resolve_hiz_slice);
+ GEN6_HIZ_OP_HIZ_RESOLVE);
}
bool
struct intel_mipmap_tree *mt)
{
return intel_miptree_all_slices_resolve(intel, mt,
- GEN6_HIZ_OP_DEPTH_RESOLVE,
- intel->vtbl.resolve_depth_slice);
+ GEN6_HIZ_OP_DEPTH_RESOLVE);
}
static void