summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/r600_query.c
diff options
context:
space:
mode:
authorNiels Ole Salscheider <[email protected]>2013-08-09 11:59:28 +0200
committerTom Stellard <[email protected]>2013-08-23 16:59:44 -0700
commitdb6f4165f4af89b8a963c5fd5ece4fc9a94c42d0 (patch)
treea6c4d63517155a9f46c6d0023a3f4166934bd7fd /src/gallium/drivers/radeonsi/r600_query.c
parentad9b5b9ae9a9068be4571a406f6118b9f4382ac4 (diff)
radeonsi: Implement PIPE_QUERY_TIMESTAMP
Signed-off-by: Niels Ole Salscheider <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/r600_query.c')
-rw-r--r--src/gallium/drivers/radeonsi/r600_query.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/r600_query.c b/src/gallium/drivers/radeonsi/r600_query.c
index 0162cce894a..927577c220c 100644
--- a/src/gallium/drivers/radeonsi/r600_query.c
+++ b/src/gallium/drivers/radeonsi/r600_query.c
@@ -42,6 +42,11 @@ static void r600_begin_query(struct pipe_context *ctx, struct pipe_query *query)
struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
+ if (!si_query_needs_begin(rquery->type)) {
+ assert(0);
+ return;
+ }
+
memset(&rquery->result, 0, sizeof(rquery->result));
rquery->results_start = rquery->results_end;
r600_query_begin(rctx, (struct r600_query *)query);
@@ -53,8 +58,15 @@ static void r600_end_query(struct pipe_context *ctx, struct pipe_query *query)
struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
+ if (!si_query_needs_begin(rquery->type)) {
+ memset(&rquery->result, 0, sizeof(rquery->result));
+ }
+
r600_query_end(rctx, rquery);
- LIST_DELINIT(&rquery->list);
+
+ if (si_query_needs_begin(rquery->type)) {
+ LIST_DELINIT(&rquery->list);
+ }
}
static boolean r600_get_query_result(struct pipe_context *ctx,