diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index db064aba297..2c091656080 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -230,31 +230,33 @@ update_draw_stats(struct fd_context *ctx, const struct pipe_draw_info *info, const struct pipe_draw_start_count *draws, unsigned num_draws) assert_dt { - /* Counting prims in sw doesn't work for GS and tesselation. For older - * gens we don't have those stages and don't have the hw counters enabled, - * so keep the count accurate for non-patch geometry. - */ - unsigned prims = 0; - if ((info->mode != PIPE_PRIM_PATCHES) && - (info->mode != PIPE_PRIM_MAX)) { - for (unsigned i = 0; i < num_draws; i++) { - prims += u_reduced_prims_for_vertices(info->mode, draws[i].count); - } - } - ctx->stats.draw_calls++; - /* TODO prims_emitted should be clipped when the stream-out buffer is - * not large enough. See max_tf_vtx().. probably need to move that - * into common code. Although a bit more annoying since a2xx doesn't - * use ir3 so no common way to get at the pipe_stream_output_info - * which is needed for this calculation. - */ - if (ctx->streamout.num_targets > 0) { - assert(ctx->active_queries); - ctx->stats.prims_emitted += prims; + if (ctx->screen->gpu_id < 600) { + /* Counting prims in sw doesn't work for GS and tesselation. For older + * gens we don't have those stages and don't have the hw counters enabled, + * so keep the count accurate for non-patch geometry. + */ + unsigned prims = 0; + if ((info->mode != PIPE_PRIM_PATCHES) && + (info->mode != PIPE_PRIM_MAX)) { + for (unsigned i = 0; i < num_draws; i++) { + prims += u_reduced_prims_for_vertices(info->mode, draws[i].count); + } + } + + /* TODO prims_emitted should be clipped when the stream-out buffer is + * not large enough. See max_tf_vtx().. probably need to move that + * into common code. Although a bit more annoying since a2xx doesn't + * use ir3 so no common way to get at the pipe_stream_output_info + * which is needed for this calculation. + */ + if (ctx->streamout.num_targets > 0) { + assert(ctx->active_queries); + ctx->stats.prims_emitted += prims; + } + ctx->stats.prims_generated += prims; } - ctx->stats.prims_generated += prims; } static void