[Mesa-dev] [PATCH V3 11/28] glsl: cross validate varyings with a component qualifier
Kenneth Graunke
kenneth at whitecape.org
Fri Feb 26 01:26:04 UTC 2016
On Friday, January 8, 2016 10:15:58 AM PST Timothy Arceri wrote:
> This change checks for component overlap, including handling overlap of
> locations and components by doubles. Previously there was no validation
> for assigning explicit locations to a location used by the second half
> of a double.
>
> V3: simplify handling of doubles and fix double component aliasing
> detection
>
> V2: fix component matching for matricies
>
> Cc: Anuj Phogat <anuj.phogat at gmail.com>
> ---
> src/glsl/link_varyings.cpp | 63 +++++++++++++++++++++++++++++++++++++
+--------
> 1 file changed, 52 insertions(+), 11 deletions(-)
>
> diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
> index 6a9ee94..03c131a 100644
> --- a/src/glsl/link_varyings.cpp
> +++ b/src/glsl/link_varyings.cpp
> @@ -222,7 +222,7 @@ cross_validate_outputs_to_inputs(struct
gl_shader_program *prog,
> gl_shader *producer, 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.
> */
> @@ -243,18 +243,59 @@ cross_validate_outputs_to_inputs(struct
gl_shader_program *prog,
> unsigned num_elements = type->count_attribute_slots(false);
> unsigned idx = var->data.location - VARYING_SLOT_VAR0;
> unsigned slot_limit = idx + num_elements;
> + unsigned last_comp;
> +
> + if (var->type->without_array()->is_record()) {
> + /* The componet qualifier can't be used on structs so just
treat
^^^ component
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/43bd29c0/attachment-0001.sig>
More information about the mesa-dev
mailing list