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 <alyssa@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4734>
This commit is contained in:
Erik Faye-Lund 2020-04-29 12:29:46 +02:00 committed by Marge Bot
parent 8471f7a5fa
commit 354474b9e5
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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);