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_query.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/r300/r300_query.c') diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c index b01313648b..fb4340ff3d 100644 --- a/src/gallium/drivers/r300/r300_query.c +++ b/src/gallium/drivers/r300/r300_query.c @@ -74,6 +74,8 @@ static void r300_begin_query(struct pipe_context* pipe, struct r300_context* r300 = r300_context(pipe); struct r300_query* q = (struct r300_query*)query; + assert(r300->query_current == NULL); + map = pipe->screen->buffer_map(pipe->screen, r300->oqbo, PIPE_BUFFER_USAGE_CPU_WRITE); map += q->offset / 4; @@ -81,8 +83,8 @@ static void r300_begin_query(struct pipe_context* pipe, pipe->screen->buffer_unmap(pipe->screen, r300->oqbo); q->flushed = FALSE; - r300_emit_dirty_state(r300); - r300_emit_query_begin(r300, q); + r300->query_current = q; + r300->dirty_state |= R300_NEW_QUERY; } static void r300_end_query(struct pipe_context* pipe, @@ -93,6 +95,8 @@ static void r300_end_query(struct pipe_context* pipe, r300_emit_dirty_state(r300); r300_emit_query_end(r300, q); + + r300->query_current = NULL; } static boolean r300_get_query_result(struct pipe_context* pipe, -- cgit v1.2.3