X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fswr%2Fswr_query.cpp;h=35d0e53fb2375c5d62e8823f39a8be7ba8ecf889;hb=d86e2487a0fb3b3d1f88a07d0eff723f3b30c737;hp=5c599654ba90ac99bd89777bd5f2878cfefbddc3;hpb=9d86a5eea79ac30bb90af363c66a5ba8529b37d8;p=mesa.git diff --git a/src/gallium/drivers/swr/swr_query.cpp b/src/gallium/drivers/swr/swr_query.cpp index 5c599654ba9..35d0e53fb23 100644 --- a/src/gallium/drivers/swr/swr_query.cpp +++ b/src/gallium/drivers/swr/swr_query.cpp @@ -63,7 +63,7 @@ swr_destroy_query(struct pipe_context *pipe, struct pipe_query *q) 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); } @@ -91,18 +91,17 @@ swr_gather_stats(struct pipe_context *pipe, struct swr_query *pq) /* 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) @@ -128,7 +127,7 @@ swr_get_query_result(struct pipe_context *pipe, 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); } @@ -152,6 +151,7 @@ swr_get_query_result(struct pipe_context *pipe, 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];