<div dir="ltr">On 4 September 2013 08:17, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 09/03/2013 09:41 AM, Paul Berry wrote:<br>
> On 30 August 2013 16:07, Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a><br>
</div><div class="im">> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>> wrote:<br>
><br>
> From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
</div>> <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
<div class="im">><br>
> The new function, cross_validate_types_and_qualifiers, will have<br>
> multiple callers from this file in future commits.<br>
><br>
> Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
</div>> <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
<div><div class="h5">> ---<br>
> src/glsl/link_varyings.cpp | 171<br>
> +++++++++++++++++++++++++--------------------<br>
> 1 file changed, 94 insertions(+), 77 deletions(-)<br>
><br>
> diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp<br>
> index 4ceb1d3..a1899f7 100644<br>
> --- a/src/glsl/link_varyings.cpp<br>
> +++ b/src/glsl/link_varyings.cpp<br>
> @@ -41,6 +41,97 @@<br>
><br>
><br>
> /**<br>
> + * Validate the types and qualifiers of an output from one stage<br>
> against the<br>
> + * matching input to another stage.<br>
> + */<br>
> +static void<br>
> +cross_validate_types_and_qualifiers(struct gl_shader_program *prog,<br>
> + const ir_variable *input,<br>
> + const ir_variable *output,<br>
> + GLenum consumer_type,<br>
> + const char *consumer_stage,<br>
> + const char *producer_stage)<br>
><br>
><br>
> It seems redundant to pass both consumer_type and consumer_stage as<br>
> arguments, since the latter is just<br>
> _mesa_glsl_shader_target_name(consumer_type). You might want to just<br>
> pass consumer_type and producer_type, and use<br>
> _mesa_glsl_shader_target_name() to convert them to strings in the event<br>
> of an error.<br>
<br>
</div></div>I thought about doing that. I decided against it for a couple<br>
reasons... but now that I've looked at it again, I like it. :) I've<br>
changed the signature to<br>
<br>
static void<br>
cross_validate_types_and_qualifiers(struct gl_shader_program *prog,<br>
const ir_variable *input,<br>
const ir_variable *output,<br>
GLenum consumer_type,<br>
GLenum producer_type);<br>
<br>
And I just call _mesa_glsl_shader_target_name in the linker_error calls.<br>
I pushed this to master of my repo on fdo. Does that look good to you?<br></blockquote><div><br></div><div>Yeah, that looks great. Thanks!<br></div></div></div></div>