summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-15 18:29:34 +0100
committerMarek Olšák <[email protected]>2017-02-18 01:22:08 +0100
commitd6c8c26851c5fe03a6a21b2280be216aae6bbe33 (patch)
treeb9cd77e58e189ddec6ebd834c38638a3d9626077 /src/gallium
parent6b73aafceb1eb8e81754e2f349826994de678466 (diff)
radeonsi: use a clever alignment for descriptor uploads
Non-VBO descriptors won't be smaller than the cache line, so simply use the cache line size. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 72b33f3e8e0..4f2dbbb37c4 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -234,9 +234,10 @@ static bool si_upload_descriptors(struct si_context *sctx,
} else {
void *ptr;
- u_upload_alloc(sctx->b.b.stream_uploader, 0, list_size, 256,
- &desc->buffer_offset,
- (struct pipe_resource**)&desc->buffer, &ptr);
+ u_upload_alloc(sctx->b.b.stream_uploader, 0, list_size,
+ sctx->screen->b.info.tcc_cache_line_size,
+ &desc->buffer_offset,
+ (struct pipe_resource**)&desc->buffer, &ptr);
if (!desc->buffer)
return false; /* skip the draw call */
@@ -948,6 +949,7 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx)
struct si_vertex_element *velems = sctx->vertex_elements;
struct si_descriptors *desc = &sctx->vertex_buffers;
unsigned i, count = velems->count;
+ unsigned desc_list_byte_size = velems->desc_list_byte_size;
uint64_t va;
uint32_t *ptr;
@@ -961,7 +963,8 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx)
* the fine-grained upload path.
*/
u_upload_alloc(sctx->b.b.stream_uploader, 0,
- velems->desc_list_byte_size, 256,
+ desc_list_byte_size,
+ si_optimal_tcc_alignment(sctx, desc_list_byte_size),
&desc->buffer_offset,
(struct pipe_resource**)&desc->buffer, (void**)&ptr);
if (!desc->buffer)