mesa/st: consider NumUniformBlocks instead of num_ubos when binding
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 29 Apr 2020 10:29:46 +0000 (12:29 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 5 May 2020 09:17:51 +0000 (09:17 +0000)
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>

src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_draw_feedback.c

index 181fef1b74947495405a09bf0389737912d1a700..2b5cc547ec52ba80780e0b6de87e2f05d9f82e69 100644 (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;
 
index 32eebd741548493f415d77037e9109bfff4b1620..956439122a37e1d155cef38934c646f05428baa3 100644 (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);