+ 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);
+ }
+
+ if (queryState == SVGA3D_QUERYSTATE_PENDING ||
+ queryState == SVGA3D_QUERYSTATE_NEW) {