unsigned offset;
/* if we've flushed the query */
boolean flushed;
+ /* if begin has been emitted */
+ boolean begin_emitted;
/* Linked list members. */
struct r300_query* prev;
struct r300_query* next;
}
OUT_CS_REG(R300_ZB_ZPASS_DATA, 0);
END_CS;
+ query->begin_emitted = TRUE;
}
END_CS;
}
-void r300_emit_query_end(struct r300_context* r300,
- struct r300_query* query)
+void r300_emit_query_end(struct r300_context* r300)
{
struct r300_capabilities *caps = r300_screen(r300->context.screen)->caps;
+ struct r300_query *query = r300->query_current;
+
+ if (!query)
+ return;
+
+ if (query->begin_emitted == FALSE)
+ return;
if (!r300->winsys->add_buffer(r300->winsys, r300->oqbo,
0, RADEON_GEM_DOMAIN_GTT)) {
void r300_emit_query_begin(struct r300_context* r300,
struct r300_query* query);
-void r300_emit_query_end(struct r300_context* r300,
- struct r300_query* query);
+void r300_emit_query_end(struct r300_context* r300);
void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs);
draw_flush(r300->draw);
}
+ r300_emit_query_end(r300);
+
if (r300->dirty_hw) {
FLUSH_CS;
r300_emit_invariant_state(r300);
}
static void r300_end_query(struct pipe_context* pipe,
- struct pipe_query* query)
+ struct pipe_query* query)
{
struct r300_context* r300 = r300_context(pipe);
- struct r300_query* q = (struct r300_query*)query;
-
- r300_emit_dirty_state(r300);
- r300_emit_query_end(r300, q);
+ r300_emit_query_end(r300);
r300->query_current = NULL;
}