diff options
author | Jason Ekstrand <[email protected]> | 2017-05-25 19:13:47 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-06-07 22:18:53 -0700 |
commit | 3b65f9499c36d7b4ce7e4661299c23bc9d3816e6 (patch) | |
tree | 10b8830c14f6ef3a725b9f3293917b55da90260d /src/mesa | |
parent | 076defba7a4a89972d34084fefa6227344280f77 (diff) |
i965/blorp: Move MCS allocation earlier for clears
This way it happens before we call get_aux_state.
Reviewed-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c index c3bdc6d4396..6f144709487 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -791,6 +791,20 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb, const unsigned num_layers = fb->MaxNumLayers ? irb->layer_count : 1; if (can_fast_clear) { + /* If the MCS buffer hasn't been allocated yet, we need to allocate + * it now. + */ + if (!irb->mt->mcs_buf) { + assert(!intel_miptree_is_lossless_compressed(brw, irb->mt)); + if (!intel_miptree_alloc_non_msrt_mcs(brw, irb->mt, false)) { + /* MCS allocation failed--probably this will only happen in + * out-of-memory conditions. But in any case, try to recover + * by falling back to a non-blorp clear technique. + */ + return false; + } + } + const enum intel_fast_clear_state fast_clear_state = intel_miptree_get_fast_clear_state(irb->mt, irb->mt_level, logical_layer); @@ -808,20 +822,6 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb, irb->mt->fast_clear_color = clear_color; - /* If the MCS buffer hasn't been allocated yet, we need to allocate - * it now. - */ - if (!irb->mt->mcs_buf) { - assert(!intel_miptree_is_lossless_compressed(brw, irb->mt)); - if (!intel_miptree_alloc_non_msrt_mcs(brw, irb->mt, false)) { - /* MCS allocation failed--probably this will only happen in - * out-of-memory conditions. But in any case, try to recover - * by falling back to a non-blorp clear technique. - */ - return false; - } - } - DBG("%s (fast) to mt %p level %d layers %d+%d\n", __FUNCTION__, irb->mt, irb->mt_level, irb->mt_layer, num_layers); |