From e4e46f2c4cf3dd429d8fea6bd935468a507be2f8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 20 Jan 2021 14:08:32 -0800 Subject: [PATCH] freedreno/a6xx: Skip the body of emit_state if we're clean. drawoverhead test 1 (no state change) perf +5.43864% +/- 1.28466% (n=10). Part of #4106. Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index 5b6e5102717..a3939383681 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -311,7 +311,8 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info, ctx->last.restart_index = restart_index; } - fd6_emit_state(ring, &emit); + if (emit.dirty) + fd6_emit_state(ring, &emit); /* for debug after a lock up, write a unique counter value * to scratch7 for each draw, to make it easier to match up