diff options
author | Nicolai Hähnle <[email protected]> | 2015-11-20 11:46:26 +0100 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2015-11-20 22:46:11 +0100 |
commit | 6f4fe8e76ada4cd04f20d37825d7763fcc2b62ae (patch) | |
tree | a21b9b741d013952a2d5f6a03f3d414e76c7a1e7 | |
parent | 47fae842d01331af5acc56ff8db37c09ceca791f (diff) |
radeon: reset query buffers for PIPE_QUERY_TIMESTAMP
Since begin_query is not called for this query type, we need to reset the
query buffer state in end_query instead.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93015
Reviewed-by: Marek Olšák <[email protected]>
Tested-by: Andy Furniss <[email protected]>
Tested-by: Mathias Tillman <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeon/r600_query.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index 2797bcb76b7..526be16aa89 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -654,17 +654,11 @@ static boolean r600_begin_query(struct pipe_context *ctx, return rquery->ops->begin(rctx, rquery); } -boolean r600_query_hw_begin(struct r600_common_context *rctx, - struct r600_query *rquery) +static void r600_query_hw_reset_buffers(struct r600_common_context *rctx, + struct r600_query_hw *query) { - struct r600_query_hw *query = (struct r600_query_hw *)rquery; struct r600_query_buffer *prev = query->buffer.previous; - if (query->flags & R600_QUERY_HW_FLAG_NO_START) { - assert(0); - return false; - } - /* Discard the old query buffers. */ while (prev) { struct r600_query_buffer *qbuf = prev; @@ -682,6 +676,19 @@ boolean r600_query_hw_begin(struct r600_common_context *rctx, query->buffer.results_end = 0; query->buffer.previous = NULL; +} + +boolean r600_query_hw_begin(struct r600_common_context *rctx, + struct r600_query *rquery) +{ + struct r600_query_hw *query = (struct r600_query_hw *)rquery; + + if (query->flags & R600_QUERY_HW_FLAG_NO_START) { + assert(0); + return false; + } + + r600_query_hw_reset_buffers(rctx, query); r600_query_hw_emit_start(rctx, query); @@ -705,6 +712,9 @@ void r600_query_hw_end(struct r600_common_context *rctx, { struct r600_query_hw *query = (struct r600_query_hw *)rquery; + if (query->flags & R600_QUERY_HW_FLAG_NO_START) + r600_query_hw_reset_buffers(rctx, query); + r600_query_hw_emit_stop(rctx, query); if (!(query->flags & R600_QUERY_HW_FLAG_NO_START)) |