diff options
author | Marek Olšák <[email protected]> | 2012-03-29 16:38:53 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-03-30 17:12:51 +0200 |
commit | 6d73382afc1d2a5e5815d0e6e7f39e0bf8138002 (patch) | |
tree | dba613c85005ecfc5e383820a09471bcd1339b31 /src/gallium/drivers/r300 | |
parent | 452d07759db7077a62d231f758f9d5e69af3fe60 (diff) |
r300g: cleanup after get_query_result change
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_query.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c index 829370b8dac..ac8ef449362 100644 --- a/src/gallium/drivers/r300/r300_query.c +++ b/src/gallium/drivers/r300/r300_query.c @@ -143,15 +143,13 @@ static boolean r300_get_query_result(struct pipe_context* pipe, uint32_t temp, *map; if (q->type == PIPE_QUERY_GPU_FINISHED) { - uint32_t *r = (uint32_t*)vresult; - if (wait) { r300->rws->buffer_wait(q->buf, RADEON_USAGE_READWRITE); - *r = TRUE; + vresult->b = TRUE; } else { - *r = !r300->rws->buffer_is_busy(q->buf, RADEON_USAGE_READWRITE); + vresult->b = !r300->rws->buffer_is_busy(q->buf, RADEON_USAGE_READWRITE); } - return *r; + return vresult->b; } map = r300->rws->buffer_map(q->buf, r300->cs, @@ -171,9 +169,10 @@ static boolean r300_get_query_result(struct pipe_context* pipe, r300->rws->buffer_unmap(q->buf); if (q->type == PIPE_QUERY_OCCLUSION_PREDICATE) { - temp = temp != 0; + vresult->b = temp != 0; + } else { + vresult->u64 = temp; } - *((uint64_t*)vresult) = temp; return TRUE; } @@ -182,7 +181,7 @@ static void r300_render_condition(struct pipe_context *pipe, uint mode) { struct r300_context *r300 = r300_context(pipe); - uint64_t result = 0; + union pipe_query_result result; boolean wait; r300->skip_rendering = FALSE; @@ -191,8 +190,12 @@ static void r300_render_condition(struct pipe_context *pipe, wait = mode == PIPE_RENDER_COND_WAIT || mode == PIPE_RENDER_COND_BY_REGION_WAIT; - if (r300_get_query_result(pipe, query, wait, (void*)&result)) { - r300->skip_rendering = result == 0; + if (r300_get_query_result(pipe, query, wait, &result)) { + if (r300_query(query)->type == PIPE_QUERY_OCCLUSION_PREDICATE) { + r300->skip_rendering = !result.b; + } else { + r300->skip_rendering = !result.u64; + } } } } |