[Mesa-stable] [Mesa-dev] [PATCH 14/18] glsl: Don't include the array index.

Timothy Arceri timothy.arceri at collabora.com
Tue Aug 2 01:52:59 UTC 2016


On Mon, 2016-08-01 at 18:40 -0400, Ilia Mirkin wrote:
> Fwiw I remember having trouble finding justification for the comments
> in that issue, and iirc the opposite seemed to be indicated by the
> spec text. (E.g.that array indices should be maintained.) I suspect
> there are also AoA interactions.

Yeah I find this odd also. I *believe* we discussed this with Ian a
while back but I can't find the emails, maybe I'm thinking of something
else.

> I guess my point here is to double check this, as well as what other
> drivers do in this and similar situations.

Probably a good idea.

As for AoA I think the other drivers still don't support AoA of blocks
and the specs provide nothing on the topic so who knows what we are
meant to do for them.

> 
> On Aug 1, 2016 12:31 PM, "Kenneth Graunke" <kenneth at whitecape.org>
> wrote:
> Issue 16 of the ARB_program_interface_query spec gives an example:
> 
>       For example, in the following code:
> 
>         uniform Block1 {
>           int member1;
>         };
>         uniform Block2 {
>           int member2;
>         } instance2;
>         uniform Block3 {
>           int member3;
>         } instance3[2];  // uses two separate buffer bindings
> 
>       the three uniforms (if active) are enumerated as "member1",
>       "Block2.member2", and "Block3.member3".
> 
> From this it's pretty clear that the array index should not be
> included.
> 
> Cc: mesa-stable at lists.freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/compiler/glsl/linker.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/linker.cpp
> b/src/compiler/glsl/linker.cpp
> index 6d45a02..bf11cb4 100644
> --- a/src/compiler/glsl/linker.cpp
> +++ b/src/compiler/glsl/linker.cpp
> @@ -3800,7 +3800,8 @@ add_shader_variable(struct gl_shader_program
> *shProg, unsigned stage_mask,
>         */
>        const char *prefixed_name = (var->data.from_named_ifc_block &&
>                                     !is_gl_identifier(var->name))
> -         ? ralloc_asprintf(shProg, "%s.%s", var-
> >get_interface_type()->name,
> +         ? ralloc_asprintf(shProg, "%s.%s",
> +                           var->get_interface_type()-
> >without_array()->name,
>                             name)
>           : name;
> 
> --
> 2.9.2
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable


More information about the mesa-stable mailing list