diff options
author | Erico Nunes <[email protected]> | 2019-12-07 04:38:03 +0100 |
---|---|---|
committer | Erico Nunes <[email protected]> | 2019-12-14 07:44:43 +0100 |
commit | 8bf2b5db786b8608ddd7c83fffa695ae011bf6b3 (patch) | |
tree | f71cb27c5e05fd2441fc826236d67cb1db407a69 /src/gallium/auxiliary/util/u_helpers.c | |
parent | 9fb45c5bbd11fa54c0777021a236114e414207f8 (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/util/u_helpers.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_helpers.c | 4 |
1 files changed, 2 insertions, 2 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); |