diff options
author | Dave Airlie <airlied@redhat.com> | 2009-10-14 17:14:43 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-10-14 17:14:43 +1000 |
commit | 47791697ab6eb6965f0ba8ba3f20373b3753ca2a (patch) | |
tree | aca935bf2a2330a15a4fcd07cf832d733a8e8959 /src/gallium/drivers/r300/r300_query.c | |
parent | c1bee7bdea470b6b5dcebef9aacc8fe4feca687c (diff) | |
download | external_mesa3d-47791697ab6eb6965f0ba8ba3f20373b3753ca2a.zip external_mesa3d-47791697ab6eb6965f0ba8ba3f20373b3753ca2a.tar.gz external_mesa3d-47791697ab6eb6965f0ba8ba3f20373b3753ca2a.tar.bz2 |
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.
Diffstat (limited to 'src/gallium/drivers/r300/r300_query.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_query.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c index b013136..fb4340f 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, |