From 861109e4413feb60f177e43e3269c8092e8816cf Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 31 May 2021 02:04:41 +0530 Subject: [PATCH] asahi: Mark scissor dirty if rast->scissor changes Although there is a scissor enable bit in the hardware rasterizer state, we cannot rely on it alone as we also "scissor" to the viewport. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_state.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 73f3fe57bfd..d1158e25097 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -170,7 +170,18 @@ static void agx_bind_rasterizer_state(struct pipe_context *pctx, void *cso) { struct agx_context *ctx = agx_context(pctx); - ctx->rast = cso; + struct agx_rasterizer *so = cso; + + /* Check if scissor state has changed, since scissor enable is part of the + * rasterizer state but everything else needed for scissors is part of + * viewport/scissor states */ + bool scissor_changed = (cso == NULL) || (ctx->rast == NULL) || + (ctx->rast->base.scissor != so->base.scissor); + + ctx->rast = so; + + if (scissor_changed) + ctx->dirty |= AGX_DIRTY_SCISSOR; } static enum agx_wrap