draw: collect tessellation invocations statistics
authorDave Airlie <airlied@redhat.com>
Thu, 26 Mar 2020 05:36:42 +0000 (15:36 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 15 Apr 2020 04:25:56 +0000 (14:25 +1000)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>

src/gallium/auxiliary/draw/draw_tess.c

index dc7282af39aa4dc0a15a571039925fadd64d7e7e..9178f5c8368c4c1e59b0585874d226102d902673 100644 (file)
@@ -185,6 +185,9 @@ int draw_tess_ctrl_shader_run(struct draw_tess_ctrl_shader *shader,
    output_prims->primitive_lengths = NULL;
    output_prims->primitive_count = 0;
 
+   if (shader->draw->collect_statistics) {
+      shader->draw->statistics.hs_invocations += num_patches;
+   }
 #ifdef LLVM_AVAILABLE
    for (unsigned i = 0; i < num_patches; i++) {
       uint32_t vert_start = output_verts->count;
@@ -346,6 +349,9 @@ int draw_tess_eval_shader_run(struct draw_tess_eval_shader *shader,
    shader->input_vertex_stride = input_stride;
    shader->input_info = input_info;
 
+   if (shader->draw->collect_statistics) {
+      shader->draw->statistics.ds_invocations += input_prim->primitive_count;
+   }
 #ifdef LLVM_AVAILABLE
    struct pipe_tessellation_factors factors;
    struct pipe_tessellator_data data = { 0 };