iris: Skip some fast-clears even on color changes

Previously, we only skipped fast-clearing if the aux state was CLEAR and
the clear color hadn't changed. That was because we relied on
blorp_fast_clear() to update the clear color for us. Now that we update
the clear color outside of blorp_fast_clear(), also skip fast-clearing
when the clear color changes while in the CLEAR state.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30824>
This commit is contained in:
Nanley Chery 2024-08-14 15:04:02 -04:00 committed by Marge Bot
parent 2886851a8e
commit 64d861b700

View file

@ -259,14 +259,6 @@ fast_clear_color(struct iris_context *ice,
iris_resource_set_clear_color(ice, res, color);
/* If the buffer is already in ISL_AUX_STATE_CLEAR, and the color hasn't
* changed, the clear is redundant and can be skipped.
*/
const enum isl_aux_state aux_state =
iris_resource_get_aux_state(res, level, box->z);
if (!color_changed && box->depth == 1 && aux_state == ISL_AUX_STATE_CLEAR)
return;
/* Ivybridge PRM Vol 2, Part 1, "11.7 MCS Buffer for Render Target(s)":
*
* "Any transition from any value in {Clear, Render, Resolve} to a
@ -292,6 +284,14 @@ fast_clear_color(struct iris_context *ice,
if (color_changed && res->aux.clear_color_bo)
iris_resource_update_indirect_color(batch, res);
/* If the buffer is already in ISL_AUX_STATE_CLEAR, the clear is redundant
* and can be skipped.
*/
const enum isl_aux_state aux_state =
iris_resource_get_aux_state(res, level, box->z);
if (box->depth == 1 && aux_state == ISL_AUX_STATE_CLEAR)
return;
iris_batch_sync_region_start(batch);
struct blorp_batch blorp_batch;