[Mesa-dev] [PATCH 05/18] glsl: Fail to link if inter-stage input/outputs are not assigned to stream 0

Iago Toral itoral at igalia.com
Wed Jun 11 05:02:39 PDT 2014


I am a bit confused here:

Reading the code it looks like input_var should be NULL if there is no
consumer stage. In that case, if this is a separable program and there
is no consumer, then input_var must be NULL too, in which case the
linker_error would never take place.

If input_var is not NULL then there has to be a consumer stage, and in
that case we should check that we can link both stages, right?

Iago

On Wed, 2014-06-11 at 20:48 +1200, Chris Forbes wrote:
> This would appear to prohibit the use of multiple streams in separable
> programs entirely. I don't think that's the right thing.
> 
> On Wed, Jun 11, 2014 at 7:49 PM, Iago Toral Quiroga <itoral at igalia.com> wrote:
> > Outputs that are linked to inputs in the next stage must be output to stream 0,
> > otherwise we should fail to link.
> > ---
> >  src/glsl/link_varyings.cpp | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
> > index 9883c0b..0066b4e 100644
> > --- a/src/glsl/link_varyings.cpp
> > +++ b/src/glsl/link_varyings.cpp
> > @@ -1343,6 +1343,13 @@ assign_varying_locations(struct gl_context *ctx,
> >            * consumer stage, add the output.
> >            */
> >           if (input_var || (prog->SeparateShader && consumer == NULL)) {
> > +            /* Only stream 0 outputs can be consumed in the next stage */
> > +            if (input_var && output_var->data.streamId != 0) {
> > +               linker_error(prog, "output %s is assigned to stream=%d but "
> > +                            "is linked to an input, which requires stream=0",
> > +                            output_var->name, output_var->data.streamId);
> > +               return false;
> > +            }
> >              matches.record(output_var, input_var);
> >           }
> >        }
> > --
> > 1.9.1
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 




More information about the mesa-dev mailing list