[Mesa-dev] [v2 15/17] i965/gen8: Relax asserts prohibiting arrayed/mipmapped fast clears
Topi Pohjolainen
topi.pohjolainen at gmail.com
Wed Nov 23 09:16:14 UTC 2016
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/mesa/drivers/dri/i965/brw_blorp.c | 4 ++--
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 23 +++++++++++++----------
src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 3 ++-
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 1a4b333..eaca543 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -905,7 +905,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
* INTEL_FAST_CLEAR_STATE_CLEAR so that we won't waste time doing
* redundant clears.
*/
- intel_miptree_set_fast_clear_state(irb->mt, irb->mt_level,
+ intel_miptree_set_fast_clear_state(brw, irb->mt, irb->mt_level,
logical_layer, num_layers,
INTEL_FAST_CLEAR_STATE_CLEAR);
} else {
@@ -994,7 +994,7 @@ brw_blorp_resolve_color(struct brw_context *brw, struct intel_mipmap_tree *mt,
resolve_op);
blorp_batch_finish(&batch);
- intel_miptree_set_fast_clear_state(mt, level, layer, 1,
+ intel_miptree_set_fast_clear_state(brw, mt, level, layer, 1,
INTEL_FAST_CLEAR_STATE_RESOLVED);
}
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 9428e7b..1c8ce0d 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1577,7 +1577,7 @@ intel_miptree_alloc_mcs(struct brw_context *brw,
/* Multisampled miptrees are only supported for single level. */
assert(mt->first_level == 0);
- intel_miptree_set_fast_clear_state(mt, mt->first_level, 0,
+ intel_miptree_set_fast_clear_state(brw, mt, mt->first_level, 0,
mt->logical_depth0,
INTEL_FAST_CLEAR_STATE_CLEAR);
@@ -2164,34 +2164,37 @@ intel_miptree_get_fast_clear_state(const struct intel_mipmap_tree *mt,
}
static void
-intel_miptree_check_color_resolve(const struct intel_mipmap_tree *mt,
+intel_miptree_check_color_resolve(const struct brw_context *brw,
+ const struct intel_mipmap_tree *mt,
unsigned level, unsigned layer)
{
if (!mt->mcs_buf)
return;
- /* Fast color clear is not supported for mipmapped surfaces. */
- assert(level == 0 && mt->first_level == 0 && mt->last_level == 0);
+ /* Fast color clear is supported for mipmapped surfaces only on Gen8+. */
+ assert(brw->gen >= 8 ||
+ (level == 0 && mt->first_level == 0 && mt->last_level == 0));
/* Compression of arrayed msaa surfaces is supported. */
if (mt->num_samples > 1)
return;
- /* Fast color clear is not supported for non-msaa arrays. */
- assert(layer == 0 && mt->logical_depth0 == 1);
+ /* Fast color clear is supported for non-msaa arrays only on Gen8+. */
+ assert(brw->gen >= 8 || (layer == 0 && mt->logical_depth0 == 1));
(void)level;
(void)layer;
}
void
-intel_miptree_set_fast_clear_state(struct intel_mipmap_tree *mt,
+intel_miptree_set_fast_clear_state(const struct brw_context *brw,
+ struct intel_mipmap_tree *mt,
unsigned level,
unsigned first_layer,
unsigned num_layers,
enum intel_fast_clear_state new_state)
{
- intel_miptree_check_color_resolve(mt, level, first_layer);
+ intel_miptree_check_color_resolve(brw, mt, level, first_layer);
assert(first_layer + num_layers <= mt->physical_depth0);
@@ -2229,7 +2232,7 @@ intel_miptree_used_for_rendering(const struct brw_context *brw,
if (is_lossless_compressed ||
fast_clear_state == INTEL_FAST_CLEAR_STATE_CLEAR) {
intel_miptree_set_fast_clear_state(
- mt, level, start_layer + i, 1,
+ brw, mt, level, start_layer + i, 1,
INTEL_FAST_CLEAR_STATE_UNRESOLVED);
}
}
@@ -2266,7 +2269,7 @@ intel_miptree_resolve_color(struct brw_context *brw,
unsigned level, unsigned layer,
int flags)
{
- intel_miptree_check_color_resolve(mt, level, layer);
+ intel_miptree_check_color_resolve(brw, mt, level, layer);
if (!intel_miptree_needs_color_resolve(brw, mt, flags))
return false;
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index 38c00f8..4970b36 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -905,7 +905,8 @@ intel_miptree_get_fast_clear_state(const struct intel_mipmap_tree *mt,
unsigned level, unsigned layer);
void
-intel_miptree_set_fast_clear_state(struct intel_mipmap_tree *mt,
+intel_miptree_set_fast_clear_state(const struct brw_context *brw,
+ struct intel_mipmap_tree *mt,
unsigned level,
unsigned first_layer,
unsigned num_layers,
--
2.5.5
More information about the mesa-dev
mailing list