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.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
*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) {
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;
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;
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: