[Mesa-stable] [PATCH 15/18] Revert "glsl/linker: Don't include interface name for built-in blocks"

Kenneth Graunke kenneth at whitecape.org
Mon Aug 1 17:29:42 UTC 2016


This reverts commit 79bbff9defd98167bf14336a44985088e2fd3f37.

Issue 16 of the ARB_program_interface_query spec clearly states:

   For tessellation control, tessellation evaluation, and geometry shaders,
   per-vertex built-in inputs like gl_Position are in a block with an
   instance name of "gl_in[]".  Additionally, for tessellation control
   shaders, per-vertex built-in outputs like gl_Position are in a block
   with an instance name of "gl_out[]".  In these cases, applying the
   standard rules would result in an enumerated name of
   "gl_PerVertex.gl_Position".

So we should add "gl_PerVertex.gl_Position", not "gl_Position".
I believe the reverted commit was hacking around broken Piglit tests;
it looks like Ian fixed those Piglit tests in piglit commit
1ea15c92fa41cbe62bd32e77b616e2560107a34f, but never landed a fix
to Mesa.  This fixes spec/arb_program_interface_query/resource-query.

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, 1 insertion(+), 2 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index bf11cb4..b10b872 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3798,8 +3798,7 @@ add_shader_variable(struct gl_shader_program *shProg, unsigned stage_mask,
        *    the name of the interface block (not the instance name) and
        *    "Member" is the name of the variable."
        */
-      const char *prefixed_name = (var->data.from_named_ifc_block &&
-                                   !is_gl_identifier(var->name))
+      const char *prefixed_name = var->data.from_named_ifc_block
          ? ralloc_asprintf(shProg, "%s.%s",
                            var->get_interface_type()->without_array()->name,
                            name)
-- 
2.9.2



More information about the mesa-stable mailing list