summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-05-13 17:45:49 -0700
committerIan Romanick <[email protected]>2016-05-16 11:18:03 -0700
commit11096ecc39fdc6e075527c225710ee57b8fb40d1 (patch)
tree63e9aa618bcc6074065a30d6681c3901eb42b8e5 /src/compiler
parent7c11589eb4326b8116f2db7eba8a7886b9ee6c0f (diff)
glsl/linker: Include the interface name for input and output blocks
On my oes_shader_io_blocks branch, this fixes 71 dEQP-GLES31.functional.program_interface_query.* tests. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/linker.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 920dd94aa20..bf30b82b402 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3654,6 +3654,21 @@ add_shader_variable(struct gl_shader_program *shProg, unsigned stage_mask,
}
default: {
+ /* Issue #16 of the ARB_program_interface_query spec says:
+ *
+ * "* If a variable is a member of an interface block without an
+ * instance name, it is enumerated using just the variable name.
+ *
+ * * If a variable is a member of an interface block with an instance
+ * name, it is enumerated as "BlockName.Member", where "BlockName" is
+ * 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
+ ? ralloc_asprintf(shProg, "%s.%s", var->get_interface_type()->name,
+ name)
+ : name;
+
/* The ARB_program_interface_query spec says:
*
* "For an active variable declared as a single instance of a basic
@@ -3661,7 +3676,7 @@ add_shader_variable(struct gl_shader_program *shProg, unsigned stage_mask,
* from the shader source."
*/
gl_shader_variable *sha_v =
- create_shader_variable(shProg, var, name, type,
+ create_shader_variable(shProg, var, prefixed_name, type,
use_implicit_location, location);
if (!sha_v)
return false;