[Mesa-dev] [PATCH 1/5] main: Use NumUniformBlocks to count UBOs

Kristian Høgsberg krh at bitplanet.net
Fri Oct 16 10:57:36 PDT 2015


On Fri, Oct 16, 2015 at 2:58 AM, Iago Toral Quiroga <itoral at igalia.com> wrote:
> Now that we have separate index spaces for UBOs and SSBOs we do not need
> to iterate through BufferInterfaceBlocks any more, we can just take the
> UBO count directly from NumUniformBlocks.

Nice cleanup, all five patches

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> ---
>  src/mesa/main/shaderapi.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 6a2f60d..26995ad 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -729,11 +729,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
>        if (!has_ubo)
>           break;
>
> -      *params = 0;
> -      for (unsigned i = 0; i < shProg->NumBufferInterfaceBlocks; i++) {
> -         if (!shProg->BufferInterfaceBlocks[i].IsShaderStorage)
> -            (*params)++;
> -      }
> +      *params = shProg->NumUniformBlocks;
>        return;
>     case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
>        /* This enum isn't part of the OES extension for OpenGL ES 2.0.  It is
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list