unsigned results_end;
/* Size of the result */
unsigned result_size;
- /* Count of new queries started in one stream without flushing */
- unsigned queries_emitted;
- /* State flags */
- boolean flushed;
/* The buffer where query results are stored. It's used as a ring,
* data blocks for current query are stored sequentially from
* results_start to results_end, with wrapping on the buffer end */
void r600_query_begin(struct r600_context *ctx, struct r600_query *query);
void r600_query_end(struct r600_context *ctx, struct r600_query *query);
void r600_context_queries_suspend(struct r600_context *ctx);
-void r600_context_queries_resume(struct r600_context *ctx, boolean flushed);
+void r600_context_queries_resume(struct r600_context *ctx);
void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
int flag_wait);
void r600_context_emit_fence(struct r600_context *ctx, struct r600_resource *fence,
rctx->saved_render_cond_mode);
rctx->saved_render_cond = NULL;
}
- r600_context_queries_resume(&rctx->ctx, FALSE);
+ r600_context_queries_resume(&rctx->ctx);
}
static unsigned u_num_layers(struct pipe_resource *r, unsigned level)
r600_init_cs(ctx);
/* resume queries */
- r600_context_queries_resume(ctx, TRUE);
+ r600_context_queries_resume(ctx);
/* set all valid group as dirty so they get reemited on
* next draw command
r600_context_flush(ctx, RADEON_FLUSH_ASYNC);
}
- 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. */
- if (query->flushed) {
- query->queries_emitted = 1;
- } else {
- if (++query->queries_emitted > query->buffer->b.b.b.width0 / query->result_size / 2)
- r600_context_flush(ctx, RADEON_FLUSH_ASYNC);
- }
- }
-
new_results_end = query->results_end + query->result_size;
if (new_results_end >= query->buffer->b.b.b.width0)
new_results_end = 0;
if (query->results_end >= query->buffer->b.b.b.width0)
query->results_end = 0;
- query->flushed = FALSE;
-
ctx->num_query_running--;
}
}
}
-void r600_context_queries_resume(struct r600_context *ctx, boolean flushed)
+void r600_context_queries_resume(struct r600_context *ctx)
{
struct r600_query *query;
LIST_FOR_EACH_ENTRY(query, &ctx->active_query_list, list) {
- if (flushed)
- query->flushed = TRUE;
-
r600_query_begin(ctx, query);
}
}