draw: fix tessellation stats query
authorDave Airlie <airlied@redhat.com>
Fri, 10 Apr 2020 04:35:24 +0000 (14:35 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 15 Apr 2020 04:26:17 +0000 (14:26 +1000)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>

src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c

index f9db2928582e3b55b4889c7bd627b2f13886416e..d403e81c224d0d7f60a8035f9b27720b2174819b 100644 (file)
@@ -596,8 +596,11 @@ llvm_pipeline_generic(struct draw_pt_middle_end *middle,
 
    if (draw->collect_statistics) {
       draw->statistics.ia_vertices += prim_info->count;
-      draw->statistics.ia_primitives +=
-         u_decomposed_prims_for_vertices(prim_info->prim, prim_info->count);
+      if (prim_info->prim == PIPE_PRIM_PATCHES)
+         draw->statistics.ia_primitives += prim_info->count / draw->pt.vertices_per_patch;
+      else
+         draw->statistics.ia_primitives +=
+            u_decomposed_prims_for_vertices(prim_info->prim, prim_info->count);
       draw->statistics.vs_invocations += fetch_info->count;
    }