llvmpipe/setup: move line stats collection earlier.
authorDave Airlie <airlied@redhat.com>
Fri, 10 Apr 2020 00:15:50 +0000 (10:15 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 15 Apr 2020 04:26:20 +0000 (14:26 +1000)
You have to count the stats pre-culling here.

Fixes:
KHR-GL45.pipeline_statistics_query_tests_ARB.functional_primitives_vertices_submitted_and_clipping_input_output_primitives

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>

src/gallium/drivers/llvmpipe/lp_setup_line.c

index 5e26b1e9ffc08a8eca2e3b297d6428c7829f019f..3a7212326e304cc9e9fe639a045dd1d7ec3029b6 100644 (file)
@@ -320,6 +320,10 @@ try_setup_line( struct lp_setup_context *setup,
    boolean will_draw_start;
    boolean will_draw_end;
 
+   if (lp_context->active_statistics_queries) {
+      lp_context->pipeline_statistics.c_primitives++;
+   }
+
    if (0)
       print_line(setup, v1, v2);
 
@@ -616,10 +620,6 @@ try_setup_line( struct lp_setup_context *setup,
 
    LP_COUNT(nr_tris);
 
-   if (lp_context->active_statistics_queries) {
-      lp_context->pipeline_statistics.c_primitives++;
-   }
-
    /* calculate the deltas */
    plane = GET_PLANES(line);
    plane[0].dcdy = x[0] - x[1];