aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_scene.h
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-06-25 23:27:04 +0200
committerRoland Scheidegger <[email protected]>2013-06-26 23:17:53 +0200
commit08203428800554215657f1ebf19d74328103800e (patch)
tree2ffcdf6192673c70944a0087a114dc7877f49b82 /src/gallium/drivers/llvmpipe/lp_scene.h
parent3dbba95b72262344b82fba018b7c2c1208754cd2 (diff)
llvmpipe: rework query logic
Previously lp_rast_begin_query commands were always inserted into each bin, and re-issued if the scene was restarted, while lp_rast_end_query commands were executed for each still active query at the end of tile rasterization. Also, the ps_invocations and vis_counter were set to zero when the respective command was encountered. This however cannot work for multiple queries of the same type (note that occlusion counter and occlusion predicate while different type were also affected). So, change the logic to always set the ps_invocations and vis_counter to zero at the start of tile rasterization, and then use "start" and "end" per-thread query values when encountering the begin/end query commands instead, which should work for multiple queries of the same type. This also means queries do not have to be reissued in a new scene, however they still need to be finished at end of tile rasterization, so a list of queries still active at the end of a scene needs to be maintained. Also while here don't bin the queries which don't do anything in rasterization. (This change does not actually handle multiple queries of the same type yet, as the list of active queries is just a simple fixed array and setup can still only have one query active per type.) Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_scene.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h
index 2d63c002ce2..16f69698ed0 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.h
+++ b/src/gallium/drivers/llvmpipe/lp_scene.h
@@ -129,6 +129,10 @@ struct lp_scene {
struct pipe_context *pipe;
struct lp_fence *fence;
+ /* The queries still active at end of scene */
+ struct llvmpipe_query *active_queries[3];
+ unsigned num_active_queries;
+
/* Framebuffer mappings - valid only between begin_rasterization()
* and end_rasterization().
*/