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

Kenneth Graunke kenneth at whitecape.org
Tue Dec 20 04:06:24 UTC 2016


On Monday, December 19, 2016 8:41:17 PM PST Matt Turner wrote:
> 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?

Oh.  I think that's a typo.  It should be BlockName3.mem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161219/e998c251/attachment.sig>


More information about the mesa-dev mailing list