Re: [Mesa-dev] [PATCH 2/2] glsl/linker: Include the interface name for input and output blocks

2016-05-13 Thread Kenneth Graunke
On Friday, May 13, 2016 6:42:54 PM PDT Ian Romanick wrote:
> From: Ian Romanick 
> 
> On my oes_shader_io_blocks branch, this fixes 71
> dEQP-GLES31.functional.program_interface_query.* tests.
> 
> Signed-off-by: Ian Romanick 
> Cc: mesa-sta...@lists.freedesktop.org
> ---
>  src/compiler/glsl/linker.cpp | 17 -
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
> index 41b43ab..3749585 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."

lol..."if it's in a block with one kind of name, use the block's other 
name..."

Reviewed-by: Kenneth Graunke 

> +   */
> +  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;
> 



signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] glsl/linker: Include the interface name for input and output blocks

2016-05-13 Thread Ian Romanick
From: Ian Romanick 

On my oes_shader_io_blocks branch, this fixes 71
dEQP-GLES31.functional.program_interface_query.* tests.

Signed-off-by: Ian Romanick 
Cc: mesa-sta...@lists.freedesktop.org
---
 src/compiler/glsl/linker.cpp | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 41b43ab..3749585 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;
-- 
2.5.5

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev