From 7e662320aa768a0bf0418e179de2cc870371e7be Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 23 Oct 2022 10:54:12 -0400 Subject: [PATCH] asahi: Set data_valid for the correct level By inspection. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index ff66f01e0f1..c5e88ae5117 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -747,20 +747,24 @@ agx_flush_batch(struct agx_context *ctx, struct agx_batch *batch) agx_pool_upload(&batch->pool, ctx->render_target[0], sizeof(ctx->render_target))); } - /* Pipelines must 64 aligned */ for (unsigned i = 0; i < batch->nr_cbufs; ++i) { - struct agx_resource *rt = agx_resource(batch->cbufs[i]->texture); - BITSET_SET(rt->data_valid, 0); + struct pipe_surface *surf = batch->cbufs[i]; + + if (surf && surf->texture) { + struct agx_resource *rt = agx_resource(surf->texture); + BITSET_SET(rt->data_valid, surf->u.tex.level); + } } struct agx_resource *zbuf = batch->zsbuf ? agx_resource(batch->zsbuf->texture) : NULL; if (zbuf) { - BITSET_SET(zbuf->data_valid, 0); + unsigned level = ctx->batch->zsbuf->u.tex.level; + BITSET_SET(zbuf->data_valid, level); if (zbuf->separate_stencil) - BITSET_SET(zbuf->separate_stencil->data_valid, 0); + BITSET_SET(zbuf->separate_stencil->data_valid, level); } /* BO list for a given batch consists of: