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

Ilia Mirkin imirkin at alum.mit.edu
Mon Aug 1 22:40:30 UTC 2016


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.

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

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20160801/e5a4721a/attachment.html>


More information about the mesa-stable mailing list