We can't pack the scissor descriptor for these, and there would be no rendering
anyway, so detect this condition and skip the draw.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11084>
}
}
+static bool
+agx_scissor_culls_everything(struct agx_context *ctx)
+{
+ const struct pipe_scissor_state ss = ctx->scissor;
+
+ return ctx->rast->base.scissor &&
+ ((ss.minx == ss.maxx) || (ss.miny == ss.maxy));
+}
+
static void
agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
unsigned drawid_offset,
struct agx_context *ctx = agx_context(pctx);
struct agx_batch *batch = ctx->batch;
+ if (agx_scissor_culls_everything(ctx))
+ return;
+
/* TODO: masks */
ctx->batch->draw |= ~0;