diff options
author | Roland Scheidegger <[email protected]> | 2013-06-20 20:31:18 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-06-22 17:09:37 +0200 |
commit | d282f4ea9b99e4eefec8ce0664cdf49d53d7b052 (patch) | |
tree | f1e7cafbc6257b729cc479e2919c4ed9eb3423fa /src | |
parent | a415aa9489270dcda616dc8e9fd01d9c0f3a4678 (diff) |
llvmpipe: fix wrong results for queries not in a scene
The result isn't always 0 in this case (depends on query type),
so instead of special casing this just use the ordinary path (should result
in correct values thanks to initialization in query_begin/end), just
skipping the fence wait.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_query.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index 386639e5367..1d3edffba94 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -100,20 +100,17 @@ llvmpipe_get_query_result(struct pipe_context *pipe, uint64_t *result = (uint64_t *)vresult; int i; - if (!pq->fence) { - /* no fence because there was no scene, so results is zero */ - *result = 0; - return TRUE; - } - - if (!lp_fence_signalled(pq->fence)) { - if (!lp_fence_issued(pq->fence)) - llvmpipe_flush(pipe, NULL, __FUNCTION__); + if (pq->fence) { + /* only have a fence if there was a scene */ + if (!lp_fence_signalled(pq->fence)) { + if (!lp_fence_issued(pq->fence)) + llvmpipe_flush(pipe, NULL, __FUNCTION__); - if (!wait) - return FALSE; + if (!wait) + return FALSE; - lp_fence_wait(pq->fence); + lp_fence_wait(pq->fence); + } } /* Sum the results from each of the threads: |