summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_query.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-04-21 15:30:33 -0400
committerRob Clark <[email protected]>2017-04-22 10:03:02 -0400
commitd310ea0f3258b49f6268df08a7e372764ad5e2d8 (patch)
tree83866411ef3f9a08cac95b95ed23cb2e05bdd7e2 /src/gallium/drivers/freedreno/freedreno_query.h
parent935623af141930db8cbe1089e448cde4066da114 (diff)
freedreno: add support for hw accumulating queries
Some queries on a4xx and all queries on a5xx can do result accumulation on CP so we don't need to track per-tile samples. We do still need to handle pausing/resuming while switching batches (in case the query is active over multiple draws which are executed out of order). So introduce new accumulated-query helpers for these sorts of queries, since it doesn't really fit in cleanly with the original query infra- structure. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_query.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_query.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_query.h b/src/gallium/drivers/freedreno/freedreno_query.h
index 1e4f45ffcd3..49a86803c4d 100644
--- a/src/gallium/drivers/freedreno/freedreno_query.h
+++ b/src/gallium/drivers/freedreno/freedreno_query.h
@@ -77,4 +77,25 @@ skip_begin_query(int type)
}
}
+/* maps query_type to sample provider idx: */
+static inline
+int pidx(unsigned query_type)
+{
+ switch (query_type) {
+ case PIPE_QUERY_OCCLUSION_COUNTER:
+ return 0;
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
+ return 1;
+ /* TODO currently queries only emitted in main pass (not in binning pass)..
+ * which is fine for occlusion query, but pretty much not anything else.
+ */
+ case PIPE_QUERY_TIME_ELAPSED:
+ return 2;
+ case PIPE_QUERY_TIMESTAMP:
+ return 3;
+ default:
+ return -1;
+ }
+}
+
#endif /* FREEDRENO_QUERY_H_ */