From 1d12b29b3f6a72885134b1571778398dfcbe8da6 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Tue, 13 Jun 2023 08:02:39 -0400 Subject: [PATCH] intel/blorp: Ambiguate after CCS resolves on gfx7-8 ISL's state-machine of CCS_D describes full resolves as leaving the aux buffer in the pass-through state. Hardware doesn't behave this way on gfx8 however. On that platform, full resolves transition the aux buffer to the resolved state. This was verified by dumping the CCS before and after a full resolve on BDW (gfx7 is simply assumed to behave the same). Ambiguate after resolving to match driver expectations. Prevents iris from failing piglit's fcc-write-after-clear on BDW with a future patch which relies on fast-clear encodings being removed after a resolve. The avoided failure is: Testing implicit read of partial block UNORM -> SNORM Probe color at (0,1,0) Expected: 1.000000 1.000000 1.000000 1.000000 Observed: 0.000000 0.000000 0.000000 0.000000 Cc: mesa-stable Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/blorp/blorp_clear.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c index c3a6f9c6c31..fd6e3873456 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -1306,6 +1306,19 @@ blorp_ccs_resolve(struct blorp_batch *batch, return; batch->blorp->exec(batch, ¶ms); + + if (batch->blorp->isl_dev->info->ver <= 8) { + assert(surf->aux_usage == ISL_AUX_USAGE_CCS_D); + assert(resolve_op == ISL_AUX_OP_FULL_RESOLVE); + /* ISL's state-machine of CCS_D describes full resolves as leaving the + * aux buffer in the pass-through state. Hardware doesn't behave this + * way on Broadwell however. On that platform, full resolves transition + * the aux buffer to the resolved state. We assume that gfx7 behaves the + * same. Use an ambiguate to match driver expectations. + */ + for (int l = 0; l < num_layers; l++) + blorp_ccs_ambiguate(batch, surf, level, start_layer + l); + } } static nir_ssa_def *