[Mesa-dev] [PATCH 05/16] glsl: set stage flag for structs and arrays in resource list

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Jul 21 01:03:18 PDT 2015


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On 18/07/15 03:25, Timothy Arceri wrote:
> This fixes the remaining failing tests in:
> ES31-CTS.program_interface_query.uniform-types
> ---
>  src/glsl/linker.cpp | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index cb679bd..dc8c873 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2648,9 +2648,19 @@ build_stageref(struct gl_shader_program *shProg, const char *name)
>         */
>        foreach_in_list(ir_instruction, node, sh->ir) {
>           ir_variable *var = node->as_variable();
> -         if (var && strcmp(var->name, name) == 0) {
> -            stages |= (1 << i);
> -            break;
> +         if (var) {
> +            unsigned baselen = strlen(var->name);
> +            if (strncmp(var->name, name, baselen) == 0) {
> +               /* Check for exact name matches but also check for arrays and
> +                * structs.
> +                */
> +               if (name[baselen] == '\0' ||
> +                   name[baselen] == '[' ||
> +                   name[baselen] == '.') {
> +                  stages |= (1 << i);
> +                  break;
> +               }
> +            }
>           }
>        }
>     }
> 


More information about the mesa-dev mailing list