mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
asahi: Skip draws if the scissor culls everything
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>
This commit is contained in:
parent
861109e441
commit
6d9242e109
1 changed files with 12 additions and 0 deletions
|
|
@ -1190,6 +1190,15 @@ agx_index_buffer_ptr(struct agx_batch *batch,
|
|||
}
|
||||
}
|
||||
|
||||
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,
|
||||
|
|
@ -1210,6 +1219,9 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
|
|||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue