[Mesa-dev] [PATCH 1/4] glsl: Refactor a bunch of the code out of cross_validate_outputs_to_inputs

Paul Berry stereotype441 at gmail.com
Wed Sep 4 11:16:15 PDT 2013


On 4 September 2013 08:17, Ian Romanick <idr at freedesktop.org> wrote:

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

Yeah, that looks great.  Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130904/ce0ce24c/attachment.html>


More information about the mesa-dev mailing list