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

Marek Olšák maraeo at gmail.com
Wed Jul 29 12:58:18 PDT 2015


Hi,

Where does the spec say we should fail to link? I don't see such a
statement there.

It looks like varyings with stream > 0 should not be linked with the
fragment shader.

Marek

On Wed, Jun 18, 2014 at 11:51 AM, 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 | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
> index 9725a43..3b20594 100644
> --- a/src/glsl/link_varyings.cpp
> +++ b/src/glsl/link_varyings.cpp
> @@ -1345,6 +1345,14 @@ assign_varying_locations(struct gl_context *ctx,
>           if (input_var || (prog->SeparateShader && consumer == NULL)) {
>              matches.record(output_var, input_var);
>           }
> +
> +         /* Only stream 0 outputs can be consumed in the next stage */
> +         if (input_var && output_var->data.stream != 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.stream);
> +            return false;
> +         }
>        }
>     } else {
>        /* If there's no producer stage, then this must be a separable program.
> --
> 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