From: Erik Faye-Lund Date: Wed, 29 Apr 2020 10:29:46 +0000 (+0200) Subject: mesa/st: consider NumUniformBlocks instead of num_ubos when binding X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=354474b9e5a9e9fdbba1b113f36d7d119d4187c0;p=mesa.git mesa/st: consider NumUniformBlocks instead of num_ubos when binding This is the number of uniform blocks at linking time, not after finalizing shaders. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Eric Anholt Part-of: --- diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 181fef1b749..2b5cc547ec5 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -204,7 +204,7 @@ st_bind_ubos(struct st_context *st, struct gl_program *prog, if (!prog) return; - for (i = 0; i < prog->info.num_ubos; i++) { + for (i = 0; i < prog->sh.NumUniformBlocks; i++) { struct gl_buffer_binding *binding; struct st_buffer_object *st_obj; diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 32eebd74154..956439122a3 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -232,7 +232,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, struct pipe_transfer *ubo_transfer[PIPE_MAX_CONSTANT_BUFFERS] = {0}; assert(prog->info.num_ubos <= ARRAY_SIZE(ubo_transfer)); - for (unsigned i = 0; i < prog->info.num_ubos; i++) { + for (unsigned i = 0; i < prog->sh.NumUniformBlocks; i++) { struct gl_buffer_binding *binding = &st->ctx->UniformBufferBindings[prog->sh.UniformBlocks[i]->Binding]; struct st_buffer_object *st_obj = st_buffer_object(binding->BufferObject);