From f04387a41550c3247e241247ba30e3db50df3c47 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Thu, 31 Oct 2024 04:04:01 +0900 Subject: [PATCH] asahi: Introduce batch->feedback to disable compression in PBE Used for RTs that have feedback with in-place decompression. Signed-off-by: Asahi Lina Part-of: --- src/gallium/drivers/asahi/agx_batch.c | 1 + src/gallium/drivers/asahi/agx_state.c | 4 +++- src/gallium/drivers/asahi/agx_state.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_batch.c b/src/gallium/drivers/asahi/agx_batch.c index a5999532a12..2070add9b43 100644 --- a/src/gallium/drivers/asahi/agx_batch.c +++ b/src/gallium/drivers/asahi/agx_batch.c @@ -128,6 +128,7 @@ agx_batch_init(struct agx_context *ctx, batch->draw = 0; batch->load = 0; batch->resolve = 0; + batch->feedback = 0; memset(batch->uploaded_clear_color, 0, sizeof(batch->uploaded_clear_color)); batch->clear_depth = 0; batch->clear_stencil = 0; diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 3353b5d710c..11d8c45dfe5 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -3256,7 +3256,9 @@ agx_build_bg_eot(struct agx_batch *batch, bool store, bool partial_render) /* The tilebuffer is already in sRGB space if needed. Do not convert */ view.format = util_format_linear(view.format); - agx_batch_upload_pbe(batch, pbe.cpu, &view, true, true, false, false); + bool no_compress = batch->feedback & (PIPE_CLEAR_COLOR0 << rt); + agx_batch_upload_pbe(batch, pbe.cpu, &view, true, true, false, + no_compress); agx_usc_pack(&b, TEXTURE, cfg) { cfg.start = rt; diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index 93a69bd7002..041e409ae2d 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -394,7 +394,7 @@ struct agx_batch { struct agx_tilebuffer_layout tilebuffer_layout; /* PIPE_CLEAR_* bitmask */ - uint32_t clear, draw, load, resolve; + uint32_t clear, draw, load, resolve, feedback; bool initialized; uint64_t uploaded_clear_color[PIPE_MAX_COLOR_BUFS];