Mesa (no-time-elapsed): llvmpipe: Drop PIPE_QUERY_TIME_ELAPSED support.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sun Dec 9 10:15:04 UTC 2012


Module: Mesa
Branch: no-time-elapsed
Commit: 15d1f38d06fc286c6d71820c45b1d72c3028cdfb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15d1f38d06fc286c6d71820c45b1d72c3028cdfb

Author: José Fonseca <jose.r.fonseca at gmail.com>
Date:   Sun Dec  9 10:15:19 2012 +0000

llvmpipe: Drop PIPE_QUERY_TIME_ELAPSED support.

It was slightly wrong: we were computing the longest duration of
the query among all the rasterizer tasks.

Regardless, for tile-based implementations such as llvmpipe, time differences
will never be very useful, because rendering before/during/after the query
is all interleaved.  And this is expected, see ARB_timer_query spec, issue 10.

In particular, piglit ext_timer_query-time-elapsed still fails, because
it makes assumptions that don't hold true in in tiled architectures. Not
sure how to fix that though.

---

 src/gallium/drivers/llvmpipe/lp_query.c  |    7 -------
 src/gallium/drivers/llvmpipe/lp_rast.c   |    6 ------
 src/gallium/drivers/llvmpipe/lp_screen.c |    1 +
 3 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c
index 7a62a80..01d5201 100644
--- a/src/gallium/drivers/llvmpipe/lp_query.c
+++ b/src/gallium/drivers/llvmpipe/lp_query.c
@@ -122,13 +122,6 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
          *result += pq->count[i];
       }
       break;
-   case PIPE_QUERY_TIME_ELAPSED:
-      for (i = 0; i < LP_MAX_THREADS; i++) {
-         if (pq->count[i] > *result) {
-            *result = pq->count[i];
-         }
-      }
-      break;
    case PIPE_QUERY_TIMESTAMP:
       for (i = 0; i < LP_MAX_THREADS; i++) {
          if (pq->count[i] > *result) {
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 37be6ad..44e8324 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -437,9 +437,6 @@ lp_rast_begin_query(struct lp_rasterizer_task *task,
    case PIPE_QUERY_OCCLUSION_COUNTER:
       task->vis_counter = 0;
       break;
-   case PIPE_QUERY_TIME_ELAPSED:
-      task->query_start = os_time_get_nano();
-      break;
    case PIPE_QUERY_PRIMITIVES_GENERATED:
    case PIPE_QUERY_PRIMITIVES_EMITTED:
       break;
@@ -468,9 +465,6 @@ lp_rast_end_query(struct lp_rasterizer_task *task,
    case PIPE_QUERY_OCCLUSION_COUNTER:
       pq->count[task->thread_index] += task->vis_counter;
       break;
-   case PIPE_QUERY_TIME_ELAPSED:
-      pq->count[task->thread_index] = os_time_get_nano() - task->query_start;
-      break;
    case PIPE_QUERY_TIMESTAMP:
       pq->count[task->thread_index] = os_time_get_nano();
       break;
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index a974427..3c2f60b 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -127,6 +127,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_OCCLUSION_QUERY:
       return 1;
    case PIPE_CAP_QUERY_TIME_ELAPSED:
+      return 0;
    case PIPE_CAP_QUERY_TIMESTAMP:
       return 1;
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:




More information about the mesa-commit mailing list