results_base = (results_base + 16) % query->buffer->b.b.b.width0;
}
break;
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
+ while (results_base != query->results_end) {
+ query->result = query->result ||
+ r600_query_read_result(map + results_base, 0, 2, true);
+ results_base = (results_base + 16) % query->buffer->b.b.b.width0;
+ }
+ break;
case PIPE_QUERY_TIME_ELAPSED:
while (results_base != query->results_end) {
query->result +=
void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
{
- unsigned new_results_end;
+ unsigned new_results_end, i;
+ u32 *results;
r600_need_cs_space(ctx, query->num_cs_dw * 2, TRUE);
r600_query_result(ctx, query, TRUE);
}
- if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) {
- u32 *results;
- int i;
-
+ switch (query->type) {
+ case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
results = ctx->ws->buffer_map(query->buffer->buf, ctx->cs, PIPE_TRANSFER_WRITE);
if (results) {
results = (u32*)((char*)results + query->results_end);
}
ctx->ws->buffer_unmap(query->buffer->buf);
}
+ break;
+ case PIPE_QUERY_TIME_ELAPSED:
+ break;
+ default:
+ assert(0);
}
/* emit begin query */
switch (query->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1);
ctx->pm4[ctx->pm4_cdwords++] = query->results_end;
/* emit end query */
switch (query->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1);
ctx->pm4[ctx->pm4_cdwords++] = query->results_end + 8;
switch (query_type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
query->result_size = 16 * ctx->max_db;
query->num_cs_dw = 6;
break;
switch (query->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
*result = query->result;
break;
case PIPE_QUERY_TIME_ELAPSED: