From 8bf2b5db786b8608ddd7c83fffa695ae011bf6b3 Mon Sep 17 00:00:00 2001 From: Erico Nunes Date: Sat, 7 Dec 2019 04:38:03 +0100 Subject: gallium/util: add alignment parameter to util_upload_index_buffer At least on Mali Utgard, index buffers need to be aligned on 0x40. To avoid duplicating this, add an alignment parameter. Keep the previous default for the other existing users. Signed-off-by: Erico Nunes Reviewed-by: Eric Anholt Part-of: --- src/gallium/auxiliary/util/u_helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/auxiliary/util/u_helpers.c') diff --git a/src/gallium/auxiliary/util/u_helpers.c b/src/gallium/auxiliary/util/u_helpers.c index 00a1a9791fa..5e5eeedbf45 100644 --- a/src/gallium/auxiliary/util/u_helpers.c +++ b/src/gallium/auxiliary/util/u_helpers.c @@ -144,12 +144,12 @@ bool util_upload_index_buffer(struct pipe_context *pipe, const struct pipe_draw_info *info, struct pipe_resource **out_buffer, - unsigned *out_offset) + unsigned *out_offset, unsigned alignment) { unsigned start_offset = info->start * info->index_size; u_upload_data(pipe->stream_uploader, start_offset, - info->count * info->index_size, 4, + info->count * info->index_size, alignment, (char*)info->index.user + start_offset, out_offset, out_buffer); u_upload_unmap(pipe->stream_uploader); -- cgit v1.2.3