From 47791697ab6eb6965f0ba8ba3f20373b3753ca2a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 14 Oct 2009 17:14:43 +1000 Subject: r300g: convert query to a state for emitting. This means we don't emit in the begin query but when we have to flush. Similiar to classic. TODO: make query object actually work. --- src/gallium/drivers/r300/r300_emit.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/r300/r300_emit.c') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 3d28249c16..babbe0dd74 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -320,12 +320,16 @@ void r300_emit_fb_state(struct r300_context* r300, END_CS; } -void r300_emit_query_begin(struct r300_context* r300, - struct r300_query* query) +void r300_emit_query_start(struct r300_context *r300) + { - struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps; + struct r300_capabilities *caps = r300_screen(r300->context.screen)->caps; + struct r300_query *query = r300->query_current; CS_LOCALS(r300); + if (!query) + return; + /* XXX This will almost certainly not return good results * for overlapping queries. */ BEGIN_CS(4); @@ -772,6 +776,11 @@ validate: goto validate; } + if (r300->dirty_state & R300_NEW_QUERY) { + r300_emit_query_start(r300); + r300->dirty_state &= ~R300_NEW_QUERY; + } + if (r300->dirty_state & R300_NEW_BLEND) { r300_emit_blend_state(r300, r300->blend_state); r300->dirty_state &= ~R300_NEW_BLEND; -- cgit v1.2.3