asahi: Ignore spilled render targets with partial renders
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 23 Jun 2023 18:23:59 +0000 (14:23 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 20 Jul 2023 15:33:28 +0000 (15:33 +0000)
Partial renders exist to the spill the tilebuffer to memory, there's nothing to
do if it's already spilled (and would just waste memory bandwidth and create a
feedback loop).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>

src/gallium/drivers/asahi/agx_state.c

index 303ead9..f36101b 100644 (file)
@@ -2261,6 +2261,12 @@ agx_build_meta(struct agx_batch *batch, bool store, bool partial_render)
       if (store) {
          /* TODO: Suppress stores to discarded render targets */
          key.op[rt] = AGX_META_OP_STORE;
+      } else if (batch->tilebuffer_layout.spilled[rt] && partial_render) {
+         /* Partial render programs exist only to store/load the tilebuffer to
+          * main memory. When render targets are already spilled to main memory,
+          * there's nothing to do.
+          */
+         key.op[rt] = AGX_META_OP_NONE;
       } else {
          struct agx_resource *rsrc = agx_resource(surf->texture);
          bool valid = agx_resource_valid(rsrc, surf->u.tex.level);