Module: Mesa Branch: fast-color-clear Commit: f27e60d0ea402ff5764b7e2363547b933ddfe3aa URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f27e60d0ea402ff5764b7e2363547b933ddfe3aa
Author: Plamena Manolova <[email protected]> Date: Wed Feb 27 22:08:50 2019 +0200 i965: Clarify when to skip color clear. In certain cases we can't skip a color clear even if the aux_state is ISL_AUX_STATE_CLEAR, for instance if the clear color has changed or the aux_usage is ISL_AUX_USAGE_MCS. Signed-off-by: Plamena Manolova <[email protected]> --- src/mesa/drivers/dri/i965/brw_blorp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c index 97a5f6a9937..13f902e5a3a 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -1290,11 +1290,16 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb, intel_miptree_set_clear_color(brw, irb->mt, clear_color); - /* If the buffer is already in ISL_AUX_STATE_CLEAR, the clear - * is redundant and can be skipped. + /* If the buffer is already in ISL_AUX_STATE_CLEAR and the clear color + * hasn't changed, the clear is redundant and can be skipped. We can't + * skip the clear if the aux_usage is ISL_AUX_USAGE_MCS since unless some + * primitives are drawn the aux_state will always be ISL_AUX_STATE_CLEAR. */ - if (aux_state == ISL_AUX_STATE_CLEAR) + if (!(intel_miptree_set_clear_color(brw, irb->mt, clear_color)) && + (aux_state == ISL_AUX_STATE_CLEAR) && + (irb->mt->aux_usage != ISL_AUX_USAGE_MCS)) { return; + } DBG("%s (fast) to mt %p level %d layers %d+%d\n", __FUNCTION__, irb->mt, irb->mt_level, irb->mt_layer, num_layers); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
