summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_query.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2015-11-18 11:59:21 +0100
committerNicolai Hähnle <[email protected]>2015-11-18 12:27:12 +0100
commit1d10b3d01e8af58f3c14bf39af8b592860ab36aa (patch)
tree99b63a01abf1e938eaf1ace5d4bdbf25662ae06d /src/gallium/drivers/radeon/r600_query.h
parent019106760d16a7badf2d3a7034b4281b6cf2c27f (diff)
radeon: convert hardware queries to the new style
Move r600_query and r600_query_hw into the header because we will want to reuse the buffer handling and suspend/resume logic outside of the common radeon code. Reviewed-by: Marek Olšák <[email protected]> [Fixed a rebase conflict and re-tested before pushing.]
Diffstat (limited to 'src/gallium/drivers/radeon/r600_query.h')
-rw-r--r--src/gallium/drivers/radeon/r600_query.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.h b/src/gallium/drivers/radeon/r600_query.h
index 6d568d6fd3b..baad5825d3b 100644
--- a/src/gallium/drivers/radeon/r600_query.h
+++ b/src/gallium/drivers/radeon/r600_query.h
@@ -29,9 +29,11 @@
#define R600_QUERY_H
#include "pipe/p_defines.h"
+#include "util/list.h"
struct r600_common_context;
struct r600_query;
+struct r600_resource;
#define R600_QUERY_DRAW_CALLS (PIPE_QUERY_DRIVER_SPECIFIC + 0)
#define R600_QUERY_REQUESTED_VRAM (PIPE_QUERY_DRIVER_SPECIFIC + 1)
@@ -58,4 +60,41 @@ struct r600_query_ops {
union pipe_query_result *result);
};
+struct r600_query {
+ struct r600_query_ops *ops;
+
+ /* The type of query */
+ unsigned type;
+};
+
+struct r600_query_buffer {
+ /* The buffer where query results are stored. */
+ struct r600_resource *buf;
+ /* Offset of the next free result after current query data */
+ unsigned results_end;
+ /* If a query buffer is full, a new buffer is created and the old one
+ * is put in here. When we calculate the result, we sum up the samples
+ * from all buffers. */
+ struct r600_query_buffer *previous;
+};
+
+struct r600_query_hw {
+ struct r600_query b;
+
+ /* The query buffer and how many results are in it. */
+ struct r600_query_buffer buffer;
+ /* Size of the result in memory for both begin_query and end_query,
+ * this can be one or two numbers, or it could even be a size of a structure. */
+ unsigned result_size;
+ /* The number of dwords for begin_query or end_query. */
+ unsigned num_cs_dw;
+ /* Linked list of queries */
+ struct list_head list;
+ /* For transform feedback: which stream the query is for */
+ unsigned stream;
+};
+
+void r600_query_hw_destroy(struct r600_common_context *rctx,
+ struct r600_query *rquery);
+
#endif /* R600_QUERY_H */