diff options
author | Marek Olšák <[email protected]> | 2015-12-19 17:15:02 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-01-02 15:15:44 +0100 |
commit | e0f932846c91e6eca6495c86b72e87af64dfefb5 (patch) | |
tree | 36778f580024fa572d58017f1e0a4df914405e23 /src/mesa | |
parent | 020009f7ccdffa84c6e1649c4e915954f5fd7cc0 (diff) |
u_upload_mgr: pass alignment to u_upload_data manually
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_atom_constbuf.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 5 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 20f8b3df99d..66811d29c29 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -84,6 +84,7 @@ void st_upload_constants( struct st_context *st, cb.buffer = NULL; cb.user_buffer = NULL; u_upload_data(st->constbuf_uploader, 0, paramBytes, + st->ctx->Const.UniformBufferOffsetAlignment, params->ParameterValues, &cb.buffer_offset, &cb.buffer); u_upload_unmap(st->constbuf_uploader); } else { diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 635a0126834..63b46222e6b 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -107,7 +107,7 @@ setup_index_buffer(struct st_context *st, else if (st->indexbuf_uploader) { /* upload indexes from user memory into a real buffer */ u_upload_data(st->indexbuf_uploader, 0, - ib->count * ibuffer->index_size, ib->ptr, + ib->count * ibuffer->index_size, 4, ib->ptr, &ibuffer->offset, &ibuffer->buffer); if (!ibuffer->buffer) { /* out of memory */ diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 90eb67711f3..9b01bdc129e 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -314,10 +314,11 @@ void st_init_limits(struct pipe_screen *screen, c->GLSLSkipStrictMaxUniformLimitCheck = screen->get_param(screen, PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS); + c->UniformBufferOffsetAlignment = + screen->get_param(screen, PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT); + if (can_ubo) { extensions->ARB_uniform_buffer_object = GL_TRUE; - c->UniformBufferOffsetAlignment = - screen->get_param(screen, PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT); c->MaxCombinedUniformBlocks = c->MaxUniformBufferBindings = c->Program[MESA_SHADER_VERTEX].MaxUniformBlocks + c->Program[MESA_SHADER_TESS_CTRL].MaxUniformBlocks + |