Skip to content
Snippets Groups Projects
Commit 89ed95ad authored by Vadim Girlin's avatar Vadim Girlin Committed by Alex Deucher
Browse files

r600g: fix corner case checks for the queries

parent 3b605cb0
No related branches found
No related tags found
No related merge requests found
......@@ -1744,9 +1744,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
r600_context_flush(ctx);
}
/* if it's new OQ (not resume) */
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER &&
query->results_start == query->results_end) {
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) {
/* Count queries emitted without flushes, and flush if more than
* half of buffer used, to avoid overwriting results which may be
* still in use. */
......@@ -1759,7 +1757,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
}
new_results_end = query->results_end + query->result_size;
if (new_results_end > query->buffer_size)
if (new_results_end >= query->buffer_size)
new_results_end = 0;
/* collect current results if query buffer is full */
......@@ -1858,7 +1856,7 @@ void r600_query_predication(struct r600_context *ctx, struct r600_query *query,
/* find count of the query data blocks */
count = query->buffer_size + query->results_end - query->results_start;
if (count > query->buffer_size) count-=query->buffer_size;
if (count >= query->buffer_size) count-=query->buffer_size;
count /= query->result_size;
if (ctx->pm4_cdwords + 5 * count > ctx->pm4_ndwords)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment