From 9231f24be1f5f52a1d64f2089808620dc7a146d2 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 16 Aug 2023 11:53:24 +0300 Subject: [PATCH] hasvk: add state cache invalidation back before fast clears Prior to 87149cc545, blorp added a state cache invalidation prior to fast clears. This got dropped on Hasvk. Signed-off-by: Lionel Landwerlin Fixes: 87149cc545 ("blorp: update and move fast clear PIPE_CONTROLs to drivers") Part-of: --- src/intel/blorp/blorp.h | 6 ++++++ src/intel/vulkan_hasvk/anv_blorp.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h index 21cb360..a1e2705 100644 --- a/src/intel/blorp/blorp.h +++ b/src/intel/blorp/blorp.h @@ -138,6 +138,12 @@ struct blorp_address { bool local_hint; }; +static inline bool +blorp_address_is_null(struct blorp_address address) +{ + return address.buffer == NULL && address.offset == 0; +} + struct blorp_surf { const struct isl_surf *surf; diff --git a/src/intel/vulkan_hasvk/anv_blorp.c b/src/intel/vulkan_hasvk/anv_blorp.c index ca9ec7c..925046f 100644 --- a/src/intel/vulkan_hasvk/anv_blorp.c +++ b/src/intel/vulkan_hasvk/anv_blorp.c @@ -1824,6 +1824,12 @@ anv_image_mcs_op(struct anv_cmd_buffer *cmd_buffer, ANV_PIPE_END_OF_PIPE_SYNC_BIT, "before fast clear mcs"); + if (!blorp_address_is_null(surf.clear_color_addr)) { + anv_add_pending_pipe_bits(cmd_buffer, + ANV_PIPE_STATE_CACHE_INVALIDATE_BIT, + "before blorp clear color edit"); + } + switch (mcs_op) { case ISL_AUX_OP_FAST_CLEAR: blorp_fast_clear(&batch, &surf, format, swizzle, @@ -1912,6 +1918,12 @@ anv_image_ccs_op(struct anv_cmd_buffer *cmd_buffer, ANV_PIPE_END_OF_PIPE_SYNC_BIT, "before fast clear ccs"); + if (!blorp_address_is_null(surf.clear_color_addr)) { + anv_add_pending_pipe_bits(cmd_buffer, + ANV_PIPE_STATE_CACHE_INVALIDATE_BIT, + "before blorp clear color edit"); + } + switch (ccs_op) { case ISL_AUX_OP_FAST_CLEAR: blorp_fast_clear(&batch, &surf, format, swizzle, -- 2.7.4