asahi: Don't clobber clear colours
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 22 Feb 2022 01:22:49 +0000 (20:22 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Mar 2022 00:19:30 +0000 (00:19 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>

src/gallium/drivers/asahi/agx_pipe.c

index 7f82eea..0dfe421 100644 (file)
@@ -389,7 +389,9 @@ agx_clear(struct pipe_context *pctx, unsigned buffers, const struct pipe_scissor
 {
    struct agx_context *ctx = agx_context(pctx);
    ctx->batch->clear |= buffers;
-   memcpy(ctx->batch->clear_color, color->f, sizeof(color->f));
+
+   if (buffers & PIPE_CLEAR_COLOR0)
+      memcpy(ctx->batch->clear_color, color->f, sizeof(color->f));
 }