diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-05-06 21:33:01 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-05-06 21:38:06 +0100 |
commit | 680071502ffe54c96ef9f458a9e1c668bb27fe76 (patch) | |
tree | 8497bfdb12bb185c8ab857f366954150f08fb4f1 /src/gallium/drivers/llvmpipe | |
parent | c37d8259bb26a97689d66b49456a7a13fac26a63 (diff) |
llvmpipe: Fix fence wait.
Avoids crashing when fence is NULL (LP_NUM_THREADS=0) and leaking when
it is not.
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_query.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index a1836bbde9..c23e983906 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -106,7 +106,10 @@ llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q) if (pq->binned) { struct pipe_fence_handle *fence; pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, &fence); - pipe->screen->fence_finish(pipe->screen, fence, 0); + if (fence) { + pipe->screen->fence_finish(pipe->screen, fence, 0); + pipe->screen->fence_reference(pipe->screen, &fence, NULL); + } } lp_setup_begin_query(llvmpipe->setup, pq); |