From fb7257af4e6f89b7aee681b240bfb3e2a155d061 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 17 Nov 2022 17:22:45 -0500 Subject: [PATCH] asahi: Hide ctx->batch This will make it easier to support multiple batches. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 5d449bd..5b77b6d 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -659,34 +659,35 @@ agx_clear(struct pipe_context *pctx, unsigned buffers, const struct pipe_scissor const union pipe_color_union *color, double depth, unsigned stencil) { struct agx_context *ctx = agx_context(pctx); + struct agx_batch *batch = ctx->batch; - unsigned fastclear = buffers & ~(ctx->batch->draw | ctx->batch->load); + unsigned fastclear = buffers & ~(batch->draw | batch->load); unsigned slowclear = buffers & ~fastclear; assert(scissor_state == NULL && "we don't support PIPE_CAP_CLEAR_SCISSORED"); /* Fast clears configure the batch */ if (fastclear & PIPE_CLEAR_COLOR0) - memcpy(ctx->batch->clear_color, color->f, sizeof(color->f)); + memcpy(batch->clear_color, color->f, sizeof(color->f)); if (fastclear & PIPE_CLEAR_DEPTH) - ctx->batch->clear_depth = depth; + batch->clear_depth = depth; if (fastclear & PIPE_CLEAR_STENCIL) - ctx->batch->clear_stencil = stencil; + batch->clear_stencil = stencil; /* Slow clears draw a fullscreen rectangle */ if (slowclear) { agx_blitter_save(ctx, ctx->blitter, false /* render cond */); util_blitter_clear(ctx->blitter, ctx->framebuffer.width, - ctx->framebuffer.height, - util_framebuffer_get_num_layers(&ctx->framebuffer), - slowclear, color, depth, stencil, - util_framebuffer_get_num_samples(&ctx->framebuffer) > 1); + ctx->framebuffer.height, + util_framebuffer_get_num_layers(&ctx->framebuffer), + slowclear, color, depth, stencil, + util_framebuffer_get_num_samples(&ctx->framebuffer) > 1); } - ctx->batch->clear |= fastclear; - assert((ctx->batch->draw & slowclear) == slowclear); + batch->clear |= fastclear; + assert((batch->draw & slowclear) == slowclear); } -- 2.7.4