summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_query.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_query.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_query.c5
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 a1836bbde91..c23e9839063 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);