summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2019-10-22 16:24:26 -0700
committerKristian H. Kristensen <[email protected]>2019-11-07 16:36:47 -0800
commitd6209a50bb13a40c0823f4c53eb1566328ba6630 (patch)
treece2dc98d20435e83ca8eab2471dafb5daa0938bb /src/gallium/drivers/freedreno
parentfe450ef4cf672f4f66ea1966cc96bc706b864357 (diff)
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 <[email protected]> Acked-by: Eric Anholt <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_draw.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index 059de2ec8c6..b738498c56b 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -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++;