asahi: Don't store to unbound render targets
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 22 Mar 2022 01:11:47 +0000 (21:11 -0400)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 22 May 2022 02:01:32 +0000 (22:01 -0400)
Otherwise we have a state leak with depth-only attachments, as in
glmark2 -bshadow.

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

src/gallium/drivers/asahi/agx_pipe.c

index f5b1c92..6018704 100644 (file)
@@ -451,10 +451,14 @@ agx_flush(struct pipe_context *pctx,
       clear_pipeline_textures = true;
    }
 
-   uint64_t pipeline_store =
-      agx_build_store_pipeline(ctx,
-                               dev->internal.store,
-                               agx_pool_upload(&ctx->batch->pool, ctx->render_target[0], sizeof(ctx->render_target)));
+   uint64_t pipeline_store = 0;
+
+   if (ctx->batch->cbufs[0]) {
+      pipeline_store =
+         agx_build_store_pipeline(ctx,
+                                  dev->internal.store,
+                                  agx_pool_upload(&ctx->batch->pool, ctx->render_target[0], sizeof(ctx->render_target)));
+   }
 
    /* Pipelines must 64 aligned */
    struct agx_ptr pipeline_null =