struct r600_resource_buffer *rbuffer = r600_buffer(draw->index_buffer);
boolean flushed;
- u_upload_data(rctx->upload_ib, 0,
+ u_upload_data(rctx->vbuf_mgr->uploader, 0,
draw->info.count * draw->index_size,
rbuffer->r.b.user_ptr,
&draw->index_buffer_offset,
*rbuffer = NULL;
- u_upload_data(rctx->upload_const, 0, size, ptr, const_offset,
+ u_upload_data(rctx->vbuf_mgr->uploader, 0, size, ptr, const_offset,
(struct pipe_resource**)rbuffer, &flushed);
} else {
*const_offset = 0;
#endif
r600_context_flush(&rctx->ctx);
- /* XXX These shouldn't be really necessary, but removing them breaks some tests.
+ /* XXX This shouldn't be really necessary, but removing it breaks some tests.
* Needless buffer reallocations may significantly increase memory consumption,
- * so getting rid of these 3 calls is important. */
+ * so getting rid of this call is important. */
u_upload_flush(rctx->vbuf_mgr->uploader);
- u_upload_flush(rctx->upload_ib);
- u_upload_flush(rctx->upload_const);
}
static void r600_destroy_context(struct pipe_context *context)
free(rctx->states[i]);
}
- u_upload_destroy(rctx->upload_ib);
- u_upload_destroy(rctx->upload_const);
u_vbuf_mgr_destroy(rctx->vbuf_mgr);
FREE(rctx);
return NULL;
}
- rctx->vbuf_mgr = u_vbuf_mgr_create(&rctx->context, 1024 * 1024, 16,
- PIPE_BIND_VERTEX_BUFFER,
+ rctx->vbuf_mgr = u_vbuf_mgr_create(&rctx->context, 1024 * 1024, 256,
+ PIPE_BIND_VERTEX_BUFFER |
+ PIPE_BIND_INDEX_BUFFER |
+ PIPE_BIND_CONSTANT_BUFFER,
U_VERTEX_FETCH_BYTE_ALIGNED);
if (!rctx->vbuf_mgr) {
r600_destroy_context(&rctx->context);
return NULL;
}
- rctx->upload_ib = u_upload_create(&rctx->context, 128 * 1024, 16,
- PIPE_BIND_INDEX_BUFFER);
- if (rctx->upload_ib == NULL) {
- r600_destroy_context(&rctx->context);
- return NULL;
- }
-
- rctx->upload_const = u_upload_create(&rctx->context, 1024 * 1024, 256,
- PIPE_BIND_CONSTANT_BUFFER);
- if (rctx->upload_const == NULL) {
- r600_destroy_context(&rctx->context);
- return NULL;
- }
-
rctx->blitter = util_blitter_create(&rctx->context);
if (rctx->blitter == NULL) {
FREE(rctx);