freedreno: Don't count primitives for patches

The gallium helper doesn't like patches and we can't determine how
many primitives it gets tessellated into anyway.  On gens where we
have tessellation, we get the prim count from a HW counter so just
skip counting on the CPU.

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Kristian H. Kristensen
2019-10-22 16:24:26 -07:00
parent fe450ef4cf
commit d6209a50bb
@@ -256,7 +256,14 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
batch->num_draws++;
prims = u_reduced_prims_for_vertices(info->mode, info->count);
/* 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.
*/
if (info->mode != PIPE_PRIM_PATCHES)
prims = u_reduced_prims_for_vertices(info->mode, info->count);
else
prims = 0;
ctx->stats.draw_calls++;