freedreno: Don't count SW TF queries on a6xx.

On a6xx, since we have GS and tess, we do this counting in hardware.  The
next fix is going to use some functions that don't work with GS prims.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9687>
This commit is contained in:
Eric Anholt
2021-03-17 21:15:57 -07:00
committed by Marge Bot
parent 2e002675db
commit 538e5059d0

View File

@@ -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) const struct pipe_draw_start_count *draws, unsigned num_draws)
assert_dt 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++; ctx->stats.draw_calls++;
/* TODO prims_emitted should be clipped when the stream-out buffer is if (ctx->screen->gpu_id < 600) {
* not large enough. See max_tf_vtx().. probably need to move that /* Counting prims in sw doesn't work for GS and tesselation. For older
* into common code. Although a bit more annoying since a2xx doesn't * gens we don't have those stages and don't have the hw counters enabled,
* use ir3 so no common way to get at the pipe_stream_output_info * so keep the count accurate for non-patch geometry.
* which is needed for this calculation. */
*/ unsigned prims = 0;
if (ctx->streamout.num_targets > 0) { if ((info->mode != PIPE_PRIM_PATCHES) &&
assert(ctx->active_queries); (info->mode != PIPE_PRIM_MAX)) {
ctx->stats.prims_emitted += prims; 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 static void