aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2016-08-29 10:16:40 +0300
committerTopi Pohjolainen <[email protected]>2016-09-12 11:48:30 +0300
commitb712aa2614447985cacabdd375ab99ff18bd1e71 (patch)
treea402ee4c99266a052e645599b9252a53f9a73edf
parenta1c7de09dc2b00cc990903ebee52228315e5d4e5 (diff)
i965/blorp: Sanity check all layers before actual clear
Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index dc2be1e72e0..703e5471463 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -720,7 +720,6 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
}
}
- intel_miptree_check_level_layer(irb->mt, irb->mt_level, layer);
intel_miptree_used_for_rendering(irb->mt);
/* We can't setup the blorp_surf until we've allocated the MCS above */
@@ -790,12 +789,16 @@ brw_blorp_clear_color(struct brw_context *brw, struct gl_framebuffer *fb,
if (rb == NULL)
continue;
+ const unsigned num_layers = fb->MaxNumLayers ? irb->layer_count : 1;
+ for (unsigned layer = 0; layer < num_layers; layer++) {
+ intel_miptree_check_level_layer(irb->mt, irb->mt_level, layer);
+ }
+
if (fb->MaxNumLayers > 0) {
unsigned layer_multiplier =
(irb->mt->msaa_layout == INTEL_MSAA_LAYOUT_UMS ||
irb->mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) ?
irb->mt->num_samples : 1;
- unsigned num_layers = irb->layer_count;
for (unsigned layer = 0; layer < num_layers; layer++) {
if (!do_single_blorp_clear(
brw, fb, rb, buf, partial_clear, encode_srgb,