[Mesa-dev] [PATCH] glsl: Fix program interface queries relating to interface blocks.

Matt Turner mattst88 at gmail.com
Tue Dec 20 02:41:17 UTC 2016


On Mon, Dec 19, 2016 at 4:13 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> For what it's worth, the OpenGL wiki's Program Introspection page(*),
> under "Interface block member naming" gives an example matching my above
> reply.  It says:
>
>     uniform BlockName3
>     {
>       int mem;
>     } instanceName3[4];
>
>     This definition will create a single member named "BlockName3.min".
>     The reason this array of four blocks only counts as having one
>     variable is because each of the four blocks uses the same internal
>     definition. There is nothing that could be queried from
>     BlockName3[1] that could not be queried from BlockName3[0].
>
> (*) https://www.khronos.org/opengl/wiki/Program_Introspection
>
> I think that's a decent explanation of why this is reasonable.  Because
> the block entries have per-element entries (Block[0], Block[1], etc.
> you can query whether a block is referenced (i.e. a UBO binding is used).

This might be a stupid question, but why is the field named "mem" in
the code, but the following paragraph says "min"? Are the two not
supposed to be the same?


More information about the mesa-dev mailing list