From 2e002675db14c7140542d2bf2b1eac04eee03e74 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 17 Mar 2021 19:54:52 -0700 Subject: [PATCH] freedreno: Move the primitives generated/written updates after the draw. If we're going to clamp the written value, we need the max vtx update from the draw's state emit. Part-of: --- src/gallium/drivers/freedreno/freedreno_draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index 9f84f7bb88f..db064aba297 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -352,9 +352,6 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, batch->back_blit = ctx->in_shadow; batch->num_draws++; - if (unlikely(ctx->stats_users > 0)) - update_draw_stats(ctx, info, draws, num_draws); - /* Clearing last_fence must come after the batch dependency tracking * (resource_read()/resource_written()), as that can trigger a flush, * re-populating last_fence @@ -376,6 +373,9 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, batch->num_vertices += draws[i].count * info->instance_count; } + if (unlikely(ctx->stats_users > 0)) + update_draw_stats(ctx, info, draws, num_draws); + for (unsigned i = 0; i < ctx->streamout.num_targets; i++) { assert(num_draws == 1); ctx->streamout.offsets[i] += draws[0].count;