[Piglit] [PATCH] shader_runner: Set uniform block bindings for multiple UBOs

Anuj Phogat anuj.phogat at gmail.com
Thu Jul 10 11:23:03 PDT 2014


On Sun, Jul 6, 2014 at 1:08 AM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> glLinkProgram (re)sets all uniform block bindings to zero. If we want
> to actually use multiple uniform blocks, we need to call
> glUniformBlockBinding to specify which binding point goes with which
> uniform block.
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  tests/shaders/shader_runner.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index fce5e9d..410ade6 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -1990,6 +1990,8 @@ setup_ubos(void)
>                 glBindBuffer(GL_UNIFORM_BUFFER, uniform_block_bos[i]);
>                 glBufferData(GL_UNIFORM_BUFFER, size, NULL, GL_STATIC_DRAW);
>                 glBindBufferBase(GL_UNIFORM_BUFFER, i, uniform_block_bos[i]);
> +
> +               glUniformBlockBinding(prog, i, i);
>         }
>  }
>
Looks good to me.
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

> --
> 2.0.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list