llvmpipe: add compute pipeline statistics support.
authorDave Airlie <airlied@redhat.com>
Tue, 27 Aug 2019 05:04:28 +0000 (15:04 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 4 Sep 2019 05:22:20 +0000 (15:22 +1000)
This just adds the CS invocations counter.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/drivers/llvmpipe/lp_query.c
src/gallium/drivers/llvmpipe/lp_state_cs.c

index 59df745180718f1b1914842c3ce6ea9468e233cc..7f86c3791b4cecc29b78a58836b8b2b1e6d0b0ea 100644 (file)
@@ -291,7 +291,8 @@ llvmpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
          llvmpipe->pipeline_statistics.c_primitives - pq->stats.c_primitives;
       pq->stats.ps_invocations =
          llvmpipe->pipeline_statistics.ps_invocations - pq->stats.ps_invocations;
-
+      pq->stats.cs_invocations =
+         llvmpipe->pipeline_statistics.cs_invocations - pq->stats.cs_invocations;
       llvmpipe->active_statistics_queries--;
       break;
    case PIPE_QUERY_OCCLUSION_COUNTER:
index ec54ced1fc2462ad1c96049427ef0a565e483943..8c5c815e7f055cc3b5bc84b47e0e867c8acd6df2 100644 (file)
@@ -705,6 +705,7 @@ static void llvmpipe_launch_grid(struct pipe_context *pipe,
       lp_cs_tpool_wait_for_task(screen->cs_tpool, &task);
       mtx_unlock(&screen->cs_mutex);
    }
+   llvmpipe->pipeline_statistics.cs_invocations += num_tasks * info->block[0] * info->block[1] * info->block[2];
 }
 
 void