summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-09-15 12:07:18 -0600
committerBrian Paul <[email protected]>2016-09-17 10:24:13 -0600
commit15dee0fc1ddfc02ca5e073f67323907c87136263 (patch)
tree795551585942029989c566036967d082a0353212
parentc71e82b8e98a16ac77ee53659b709deb5204d30b (diff)
svga: skip query flush if we already have the query result
This reduces the number of times we flush in some situations (the arbocclude demo is one trivial example). Tested with Piglit, ETQW, Sauerbraten, arbocclude. Reviewed-by: Charmaine Lee <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_pipe_query.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c
index 74a7f5fa52b..5de3937474e 100644
--- a/src/gallium/drivers/svga/svga_pipe_query.c
+++ b/src/gallium/drivers/svga/svga_pipe_query.c
@@ -638,11 +638,11 @@ get_query_result_vgpu10(struct svga_context *svga, struct svga_query *sq,
sws->query_get_result(sws, sq->gb_query, sq->offset, &queryState, result, resultLen);
- if (!sq->fence) {
- /* The query hasn't been submitted yet. We need to submit it now
- * since the GL spec says "Querying the state for a given occlusion
- * query forces that occlusion query to complete within a finite amount
- * of time."
+ if (queryState != SVGA3D_QUERYSTATE_SUCCEEDED && !sq->fence) {
+ /* We don't have the query result yet, and the query hasn't been
+ * submitted. We need to submit it now since the GL spec says
+ * "Querying the state for a given occlusion query forces that
+ * occlusion query to complete within a finite amount of time."
*/
svga_context_flush(svga, &sq->fence);
}