tmpPtr[i] = util_cpu_to_le32(((uint32_t *)ptr)[i]);
}
- u_upload_data(rctx->b.uploader, 0, size, 256, tmpPtr, &cb->buffer_offset, &cb->buffer);
+ u_upload_data(ctx->stream_uploader, 0, size, 256,
+ tmpPtr, &cb->buffer_offset, &cb->buffer);
free(tmpPtr);
} else {
- u_upload_data(rctx->b.uploader, 0, input->buffer_size, 256, ptr, &cb->buffer_offset, &cb->buffer);
+ u_upload_data(ctx->stream_uploader, 0,
+ input->buffer_size, 256, ptr,
+ &cb->buffer_offset, &cb->buffer);
}
/* account it in gtt */
rctx->b.gtt += input->buffer_size;
}
}
- u_upload_alloc(rctx->b.uploader, start, count * 2, 256,
- &out_offset, &out_buffer, &ptr);
+ u_upload_alloc(ctx->stream_uploader, start, count * 2,
+ 256, &out_offset, &out_buffer, &ptr);
util_shorten_ubyte_elts_to_userptr(
&rctx->b.b, &ib, 0, ib.offset + start, count, ptr);
if (ib.user_buffer && (R600_BIG_ENDIAN || info.indirect ||
info.instance_count > 1 ||
info.count*ib.index_size > 20)) {
- u_upload_data(rctx->b.uploader, 0, info.count * ib.index_size, 256,
+ u_upload_data(ctx->stream_uploader, 0,
+ info.count * ib.index_size, 256,
ib.user_buffer, &ib.offset, &ib.buffer);
ib.user_buffer = NULL;
}
unsigned offset;
struct r600_resource *staging = NULL;
- u_upload_alloc(rctx->uploader, 0, box->width + (box->x % R600_MAP_BUFFER_ALIGNMENT),
- 256, &offset, (struct pipe_resource**)&staging, (void**)&data);
+ u_upload_alloc(ctx->stream_uploader, 0,
+ box->width + (box->x % R600_MAP_BUFFER_ALIGNMENT),
+ 256, &offset, (struct pipe_resource**)&staging,
+ (void**)&data);
if (staging) {
data += box->x % R600_MAP_BUFFER_ALIGNMENT;
/* Upload vertices. The hw rectangle has only 3 vertices,
* I guess the 4th one is derived from the first 3.
* The vertex specification should match u_blitter's vertex element state. */
- u_upload_alloc(rctx->uploader, 0, sizeof(float) * 24, 256, &offset, &buf, (void**)&vb);
+ u_upload_alloc(rctx->b.stream_uploader, 0, sizeof(float) * 24, 256,
+ &offset, &buf, (void**)&vb);
if (!buf)
return;
if (!rctx->allocator_zeroed_memory)
return false;
- rctx->uploader = u_upload_create(&rctx->b, 1024 * 1024,
- PIPE_BIND_INDEX_BUFFER |
- PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_STREAM);
- if (!rctx->uploader)
+ rctx->b.stream_uploader = u_upload_create(&rctx->b, 1024 * 1024,
+ 0, PIPE_USAGE_STREAM);
+ if (!rctx->b.stream_uploader)
return false;
- rctx->b.stream_uploader = rctx->uploader;
- rctx->b.const_uploader = rctx->uploader;
+ rctx->b.const_uploader = rctx->b.stream_uploader;
rctx->ctx = rctx->ws->ctx_create(rctx->ws);
if (!rctx->ctx)
if (rctx->ctx)
rctx->ws->ctx_destroy(rctx->ctx);
- if (rctx->uploader) {
- u_upload_destroy(rctx->uploader);
+ if (rctx->b.stream_uploader) {
+ u_upload_destroy(rctx->b.stream_uploader);
}
slab_destroy_child(&rctx->pool_transfers);
unsigned last_dirty_tex_counter;
unsigned last_compressed_colortex_counter;
- struct u_upload_mgr *uploader;
struct u_suballocator *allocator_zeroed_memory;
struct slab_child_pool pool_transfers;
dispatch.kernarg_address = kernel_args_va;
- u_upload_data(sctx->b.uploader, 0, sizeof(dispatch), 256,
- &dispatch, &dispatch_offset,
- (struct pipe_resource**)&dispatch_buf);
+ u_upload_data(sctx->b.b.stream_uploader, 0, sizeof(dispatch),
+ 256, &dispatch, &dispatch_offset,
+ (struct pipe_resource**)&dispatch_buf);
if (!dispatch_buf) {
fprintf(stderr, "Error: Failed to allocate dispatch "
/* The extra num_work_size_bytes are for work group / work item size information */
kernel_args_size = program->input_size + num_work_size_bytes;
- u_upload_alloc(sctx->b.uploader, 0, kernel_args_size, 256,
+ u_upload_alloc(sctx->b.b.stream_uploader, 0, kernel_args_size, 256,
&kernel_args_offset,
(struct pipe_resource**)&input_buffer, &kernel_args_ptr);
} else {
void *ptr;
- u_upload_alloc(sctx->b.uploader, 0, list_size, 256,
+ u_upload_alloc(sctx->b.b.stream_uploader, 0, list_size, 256,
&desc->buffer_offset,
(struct pipe_resource**)&desc->buffer, &ptr);
if (!desc->buffer)
* directly through a staging buffer and don't go through
* the fine-grained upload path.
*/
- u_upload_alloc(sctx->b.uploader, 0, velems->desc_list_byte_size, 256,
+ u_upload_alloc(sctx->b.b.stream_uploader, 0,
+ velems->desc_list_byte_size, 256,
&desc->buffer_offset,
(struct pipe_resource**)&desc->buffer, (void**)&ptr);
if (!desc->buffer)
{
void *tmp;
- u_upload_alloc(sctx->b.uploader, 0, size, 256, const_offset,
+ u_upload_alloc(sctx->b.b.stream_uploader, 0, size, 256, const_offset,
(struct pipe_resource**)rbuffer, &tmp);
if (*rbuffer)
util_memcpy_cpu_to_le32(tmp, ptr, size);
si_get_draw_start_count(sctx, info, &start, &count);
start_offset = start * ib.index_size;
- u_upload_alloc(sctx->b.uploader, start_offset, count * 2, 256,
+ u_upload_alloc(ctx->stream_uploader, start_offset,
+ count * 2, 256,
&out_offset, &out_buffer, &ptr);
if (!out_buffer) {
pipe_resource_reference(&ib.buffer, NULL);
si_get_draw_start_count(sctx, info, &start, &count);
start_offset = start * ib.index_size;
- u_upload_data(sctx->b.uploader, start_offset, count * ib.index_size,
+ u_upload_data(ctx->stream_uploader, start_offset,
+ count * ib.index_size,
256, (char*)ib.user_buffer + start_offset,
&ib.offset, &ib.buffer);
if (!ib.buffer)