(struct pipe_framebuffer_state*)r300->fb_state.state;
struct r300_textures_state *textures =
(struct r300_textures_state*)r300->textures_state.state;
- struct r300_query *query, *temp;
unsigned i;
/* Framebuffer state. */
pipe_resource_reference(&r300->dummy_vb, NULL);
pipe_resource_reference(&r300->vbo, NULL);
- /* If there are any queries pending or not destroyed, remove them now. */
- foreach_s(query, temp, &r300->query_list) {
- remove_from_list(query);
- FREE(query);
- }
-
r300->context.delete_depth_stencil_alpha_state(&r300->context,
r300->dsa_decompress_zmask);
}
r300->context.destroy = r300_destroy_context;
- make_empty_list(&r300->query_list);
-
util_slab_create(&r300->pool_transfers,
sizeof(struct pipe_transfer), 64,
UTIL_SLAB_SINGLETHREADED);
/* The buffer where query results are stored. */
struct pb_buffer *buf;
struct radeon_winsys_cs_handle *cs_buf;
- /* The size of the buffer. */
- unsigned buffer_size;
-
- /* Linked list members. */
- struct r300_query* prev;
- struct r300_query* next;
};
struct r300_surface {
query->num_results += query->num_pipes;
/* XXX grab all the results and reset the counter. */
- if (query->num_results >= query->buffer_size / 4 - 4) {
- query->num_results = (query->buffer_size / 4) / 2;
+ if (query->num_results >= query->buf->size / 4 - 4) {
+ query->num_results = (query->buf->size / 4) / 2;
fprintf(stderr, "r300: Rewinding OQBO...\n");
}
}
return NULL;
q->type = query_type;
- q->buffer_size = 4096;
if (r300screen->caps.family == CHIP_FAMILY_RV530)
q->num_pipes = r300screen->info.r300_num_z_pipes;
else
q->num_pipes = r300screen->info.r300_num_gb_pipes;
- insert_at_tail(&r300->query_list, q);
-
/* Open up the occlusion query buffer. */
- q->buf = r300->rws->buffer_create(r300->rws, q->buffer_size, 4096,
+ q->buf = r300->rws->buffer_create(r300->rws, 4096, 4096,
PIPE_BIND_CUSTOM, PIPE_USAGE_STAGING);
q->cs_buf = r300->rws->buffer_get_cs_handle(q->buf);
struct r300_query* q = r300_query(query);
pb_reference(&q->buf, NULL);
- remove_from_list(q);
FREE(query);
}