From a748b264e8a52eca5bbfd5b9fdb0d281bcc9f0f5 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 26 Oct 2021 16:51:19 -0700 Subject: [PATCH] intel/blorp/gfx12+: Drop unnecessary state cache invalidation from binding table setup. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The state cache invalidation shouldn't be necessary on recent platforms. On ICL it *seems* to be required to get the hardware to pick up an updated indirect clear color, so this change is only applied to TGL platforms and later for the moment. On some DG2 configs this seems to improve SynMark2/OglDrvRes by 16.0% ±0.1%, n=8. Acked-by: Caio Oliveira Reviewed-by: Kenneth Graunke Part-of: --- src/intel/blorp/blorp_genX_exec.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index e64976f7a29..0ca326eef31 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++ b/src/intel/blorp/blorp_genX_exec.h @@ -1625,7 +1625,7 @@ blorp_setup_binding_table(struct blorp_batch *batch, } } -#if GFX_VER >= 7 +#if GFX_VER >= 7 && GFX_VER < 12 if (has_indirect_clear_color) { /* Updating a surface state object may require that the state cache be * invalidated. From the SKL PRM, Shared Functions -> State -> State @@ -1635,6 +1635,12 @@ blorp_setup_binding_table(struct blorp_batch *batch, * the Binding Table Pointer (BTP) and Binding Table Index (BTI) is * modified [...], the L1 state cache must be invalidated to ensure * the new surface or sampler state is fetched from system memory. + * + * XXX - Investigate why exactly this invalidation is necessary to + * avoid Vulkan regressions on ICL. It's possible that the + * MI_ATOMIC used to update the clear color isn't correctly + * ordered with the pre-existing invalidation in + * blorp_update_clear_color(). */ blorp_emit(batch, GENX(PIPE_CONTROL), pipe) { pipe.StateCacheInvalidationEnable = true;