This lowers lgkm wait cycles by 30% on VI and normal conditions.
The might be a measurable improvement when CE is disabled (radeon)
or under L2 thrashing.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
0, PIPE_USAGE_STREAM);
if (!rctx->b.stream_uploader)
return false;
- rctx->b.const_uploader = rctx->b.stream_uploader;
+
+ rctx->b.const_uploader = u_upload_create(&rctx->b, 128 * 1024,
+ 0, PIPE_USAGE_DEFAULT);
+ if (!rctx->b.const_uploader)
+ return false;
rctx->ctx = rctx->ws->ctx_create(rctx->ws);
if (!rctx->ctx)
if (rctx->ctx)
rctx->ws->ctx_destroy(rctx->ctx);
- if (rctx->b.stream_uploader) {
+ if (rctx->b.stream_uploader)
u_upload_destroy(rctx->b.stream_uploader);
- }
+ if (rctx->b.const_uploader)
+ u_upload_destroy(rctx->b.const_uploader);
slab_destroy_child(&rctx->pool_transfers);
dispatch.kernarg_address = kernel_args_va;
- u_upload_data(sctx->b.b.stream_uploader, 0, sizeof(dispatch),
+ u_upload_data(sctx->b.b.const_uploader, 0, sizeof(dispatch),
256, &dispatch, &dispatch_offset,
(struct pipe_resource**)&dispatch_buf);
/* 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.b.stream_uploader, 0, kernel_args_size,
+ u_upload_alloc(sctx->b.b.const_uploader, 0, kernel_args_size,
sctx->screen->b.info.tcc_cache_line_size,
&kernel_args_offset,
(struct pipe_resource**)&input_buffer, &kernel_args_ptr);
} else {
void *ptr;
- u_upload_alloc(sctx->b.b.stream_uploader, 0, list_size,
+ u_upload_alloc(sctx->b.b.const_uploader, 0, list_size,
sctx->screen->b.info.tcc_cache_line_size,
&desc->buffer_offset,
(struct pipe_resource**)&desc->buffer, &ptr);
* directly through a staging buffer and don't go through
* the fine-grained upload path.
*/
- u_upload_alloc(sctx->b.b.stream_uploader, 0,
+ u_upload_alloc(sctx->b.b.const_uploader, 0,
desc_list_byte_size,
si_optimal_tcc_alignment(sctx, desc_list_byte_size),
&desc->buffer_offset,
{
void *tmp;
- u_upload_alloc(sctx->b.b.stream_uploader, 0, size,
+ u_upload_alloc(sctx->b.b.const_uploader, 0, size,
si_optimal_tcc_alignment(sctx, size),
const_offset,
(struct pipe_resource**)rbuffer, &tmp);
assert(src->stride == 0);
/* Assume the attrib has 4 dwords like the vbo
- * module. This is also a good upper bound. */
- u_upload_data(sctx->b.b.stream_uploader, 0, 16, 16,
+ * module. This is also a good upper bound.
+ *
+ * Use const_uploader to upload into VRAM directly.
+ */
+ u_upload_data(sctx->b.b.const_uploader, 0, 16, 16,
src->user_buffer,
&dsti->buffer_offset,
&dsti->buffer);