[Mesa-dev] [PATCH] glsl/linker: Allow unused in blocks which are not declated on previous stage

Vadym Shovkoplias vadym.shovkoplias at globallogic.com
Tue Aug 28 07:23:04 UTC 2018


Hi Andreas,

Similar patch for varyings linking was pushed 4 years ago, so I think this
patch should be also stable.


On Tue, Aug 28, 2018 at 12:20 AM, Andres Gomez <agomez at igalia.com> wrote:

> Vadym, should we also include this in the stable queues ?
>
>
> On Mon, 2018-08-20 at 16:31 +0300, vadym.shovkoplias wrote:
> > From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:
> >
> >     "Only the input variables that are actually read need to be written
> >      by the previous stage; it is allowed to have superfluous
> >      declarations of input variables."
> >
> > Fixes:
> >     * interstage-multiple-shader-objects.shader_test
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101247
> > Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias at globallogic.com>
> > ---
> >  src/compiler/glsl/link_interface_blocks.cpp | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/compiler/glsl/link_interface_blocks.cpp
> b/src/compiler/glsl/link_interface_blocks.cpp
> > index e5eca9460e..801fbcd5d9 100644
> > --- a/src/compiler/glsl/link_interface_blocks.cpp
> > +++ b/src/compiler/glsl/link_interface_blocks.cpp
> > @@ -417,9 +417,15 @@ validate_interstage_inout_blocks(struct
> gl_shader_program *prog,
> >         * write to any of the pre-defined outputs (e.g. if the vertex
> shader
> >         * does not write to gl_Position, etc), which is allowed and
> results in
> >         * undefined behavior.
> > +       *
> > +       * From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:
> > +       *
> > +       *    "Only the input variables that are actually read need to be
> written
> > +       *     by the previous stage; it is allowed to have superfluous
> > +       *     declarations of input variables."
> >         */
> >        if (producer_def == NULL &&
> > -          !is_builtin_gl_in_block(var, consumer->Stage)) {
> > +          !is_builtin_gl_in_block(var, consumer->Stage) &&
> var->data.used) {
> >           linker_error(prog, "Input block `%s' is not an output of "
> >                        "the previous stage\n",
> var->get_interface_type()->name);
> >           return;
> --
> Br,
>
> Andres
>



-- 

Vadym Shovkoplias | Senior Software Engineer
GlobalLogic
P +380.57.766.7667  M +3.8050.931.7304  S vadym.shovkoplias
www.globallogic.com
<http://www.globallogic.com/>
http://www.globallogic.com/email_disclaimer.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180828/af2b51ea/attachment-0001.html>


More information about the mesa-dev mailing list