aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorErico Nunes <[email protected]>2019-12-07 04:38:03 +0100
committerErico Nunes <[email protected]>2019-12-14 07:44:43 +0100
commit8bf2b5db786b8608ddd7c83fffa695ae011bf6b3 (patch)
treef71cb27c5e05fd2441fc826236d67cb1db407a69 /src/gallium/auxiliary
parent9fb45c5bbd11fa54c0777021a236114e414207f8 (diff)
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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2445>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_helpers.c4
-rw-r--r--src/gallium/auxiliary/util/u_helpers.h2
2 files changed, 3 insertions, 3 deletions
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);
diff --git a/src/gallium/auxiliary/util/u_helpers.h b/src/gallium/auxiliary/util/u_helpers.h
index 16c4295deb5..09a95a7ab70 100644
--- a/src/gallium/auxiliary/util/u_helpers.h
+++ b/src/gallium/auxiliary/util/u_helpers.h
@@ -54,7 +54,7 @@ void util_set_shader_buffers_mask(struct pipe_shader_buffer *dst,
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);
void
util_pin_driver_threads_to_random_L3(struct pipe_context *ctx,