<p dir="ltr"><br>
On May 12, 2016 9:29 PM, "Ilia Mirkin" <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> wrote:<br>
><br>
> interpolateAt* can only take input variables or an element of an input<br>
> variable array. No structs.<br>
><br>
> Further, GLSL 4.50 relaxes the requirement to allow swizzles, so enable<br>
> that as well.<br>
><br>
> This fixes the following dEQP tests:<br>
><br>
> dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.negative.interpolate_struct_member<br>
> dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_centroid.negative.interpolate_struct_member<br>
> dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_offset.negative.interpolate_struct_member<br>
><br>
> Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>><br>
> ---<br>
> src/compiler/glsl/ast_function.cpp | 26 ++++++++++++++++++--------<br>
> 1 file changed, 18 insertions(+), 8 deletions(-)<br>
><br>
> diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp<br>
> index 4db3dd0..281735b 100644<br>
> --- a/src/compiler/glsl/ast_function.cpp<br>
> +++ b/src/compiler/glsl/ast_function.cpp<br>
> @@ -208,17 +208,27 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,<br>
><br>
> /* Verify that shader_in parameters are shader inputs */<br>
> if (formal->data.must_be_shader_input) {<br>
> - ir_variable *var = actual->variable_referenced();<br>
> - if (!var || var->data.mode != ir_var_shader_in) {<br>
> - _mesa_glsl_error(&loc, state,<br>
> - "parameter `%s` must be a shader input",<br>
> - formal->name);<br>
> - return false;<br>
> + const ir_rvalue *val = actual;<br>
> +<br>
> + // GLSL 4.50 allows swizzles, while earlier GLSL versions do not.<br>
> + if (val->ir_type == ir_type_swizzle) {<br>
> + if (!state->is_version(450, 0)) {</p>
<p dir="ltr">What about GLSL 4.60? Not that it exists yet but this doesn't look like a greater-equal.</p>
<p dir="ltr">> + _mesa_glsl_error(&loc, state,<br>
> + "parameter `%s` must not be swizzled",<br>
> + formal->name);<br>
> + return false;<br>
> + }<br>
> + val = ((ir_swizzle *)val)->val;<br>
> + }<br>
> +<br>
> + while (val->ir_type == ir_type_dereference_array) {<br>
> + val = ((ir_dereference_array *)val)->array;</p>
<p dir="ltr">What about arrays of arrays?</p>
<p dir="ltr">> }<br>
><br>
> - if (actual->ir_type == ir_type_swizzle) {<br>
> + if (!val->as_dereference_variable() ||<br>
> + val->variable_referenced()->data.mode != ir_var_shader_in) {<br>
> _mesa_glsl_error(&loc, state,<br>
> - "parameter `%s` must not be swizzled",<br>
> + "parameter `%s` must be a shader input",<br>
> formal->name);<br>
> return false;<br>
> }<br>
> --<br>
> 2.7.3<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>