summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_query.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300/r300_query.c')
-rw-r--r--src/gallium/drivers/r300/r300_query.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index 10cb468dfc..5b0121ce9e 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -37,7 +37,9 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe,
struct r300_screen *r300screen = r300->screen;
struct r300_query *q;
- assert(query_type == PIPE_QUERY_OCCLUSION_COUNTER);
+ if (query_type != PIPE_QUERY_OCCLUSION_COUNTER) {
+ return NULL;
+ }
q = CALLOC_STRUCT(r300_query);
if (!q)
@@ -55,7 +57,9 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe,
insert_at_tail(&r300->query_list, q);
/* Open up the occlusion query buffer. */
- q->buffer = r300->rws->buffer_create(r300->rws, 4096, 0, q->domain, q->buffer_size);
+ q->buffer = r300->rws->buffer_create(r300->rws, q->buffer_size, 4096,
+ PIPE_BIND_CUSTOM, PIPE_USAGE_STREAM,
+ q->domain);
return (struct pipe_query*)q;
}
@@ -132,7 +136,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
flags = PIPE_TRANSFER_READ | (!wait ? PIPE_TRANSFER_DONTBLOCK : 0);
- map = r300->rws->buffer_map(r300->rws, q->buffer, flags);
+ map = r300->rws->buffer_map(r300->rws, q->buffer, r300->cs, flags);
if (!map)
return FALSE;