[Mesa-dev] [PATCH 12/28] glsl: update explicit location matching to support component qualifier

Kenneth Graunke kenneth at whitecape.org
Fri Feb 26 01:30:29 UTC 2016


On Tuesday, December 29, 2015 4:00:12 PM PST Timothy Arceri wrote:
> This is needed so we don't optimise away the varying when more than
> one shares the same location.
> ---
>  src/glsl/linker.cpp | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 31d55e3..f709922 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2684,7 +2684,7 @@ match_explicit_outputs_to_inputs(struct 
gl_shader_program *prog,
>                                   gl_shader *consumer)
>  {
>     glsl_symbol_table parameters;
> -   ir_variable *explicit_locations[MAX_VARYING] = { NULL };
> +   ir_variable *explicit_locations[MAX_VARYING][4] = { {NULL, NULL} };
>  
>     /* Find all shader outputs in the "producer" stage.
>      */
> @@ -2697,8 +2697,8 @@ match_explicit_outputs_to_inputs(struct 
gl_shader_program *prog,
>        if (var->data.explicit_location &&
>            var->data.location >= VARYING_SLOT_VAR0) {
>           const unsigned idx = var->data.location - VARYING_SLOT_VAR0;
> -         if (explicit_locations[idx] == NULL)
> -            explicit_locations[idx] = var;
> +         if (explicit_locations[idx][var->data.location_frac] == NULL)
> +            explicit_locations[idx][var->data.location_frac] = var;
>        }
>     }
>  
> @@ -2712,7 +2712,8 @@ match_explicit_outputs_to_inputs(struct 
gl_shader_program *prog,
>        ir_variable *output = NULL;
>        if (input->data.explicit_location
>            && input->data.location >= VARYING_SLOT_VAR0) {
> -         output = explicit_locations[input->data.location - 
VARYING_SLOT_VAR0];
> +         output = explicit_locations[input->data.location - 
VARYING_SLOT_VAR0]
> +            [input->data.location_frac];
>  
>           if (output != NULL){
>              input->data.is_unmatched_generic_inout = 0;
> 

Patches 12-15 are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160225/a8e4fb03/attachment.sig>


More information about the mesa-dev mailing list