if (pq->fence) {
if (swr_is_fence_pending(pq->fence))
- swr_fence_finish(pipe->screen, pq->fence, 0);
+ swr_fence_finish(pipe->screen, NULL, pq->fence, 0);
swr_fence_reference(pipe->screen, &pq->fence, NULL);
}
/* nothing to do here */
break;
default:
- /*
- * All other results are collected from SwrCore counters via
- * SwrGetStats. This returns immediately, but results are later filled
- * in by the backend. Fence status is the only indication of
- * completion. */
- SwrGetStats(ctx->swrContext, &result->core);
+ /* TODO: should fence instead of stalling pipeline */
+ SwrWaitForIdle(ctx->swrContext);
+ memcpy(&result->core, &ctx->stats, sizeof(result->core));
+#if 0
if (!pq->fence) {
struct swr_screen *screen = swr_screen(pipe->screen);
swr_fence_reference(pipe->screen, &pq->fence, screen->flush_fence);
}
swr_fence_submit(ctx, pq->fence);
+#endif
/* Only change stat collection if there are no active queries */
if (ctx->active_queries == 0)
if (!wait && !swr_is_fence_done(pq->fence))
return FALSE;
- swr_fence_finish(pipe->screen, pq->fence, 0);
+ swr_fence_finish(pipe->screen, NULL, pq->fence, 0);
swr_fence_reference(pipe->screen, &pq->fence, NULL);
}
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
result->u64 = end->core.IaPrimitives - start->core.IaPrimitives;
+ break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
result->u64 = end->core.SoNumPrimsWritten[index]
- start->core.SoNumPrimsWritten[index];