[Mesa-dev] [PATCH 11/19] glsl: Track explicitly set location independent from the actual location

Eric Anholt eric at anholt.net
Fri Apr 11 16:35:44 PDT 2014


Ian Romanick <idr at freedesktop.org> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Almost all of the time the location set by layout(location=...) is the
> location that will be used for the variable.  Vertex shader inputs and
> fragment shader outputs, for example, are visible to the API.  We just
> use those actual settings.
>
> Locations set for varyings, however, are a different story.  In those
> cases, the locations set in the shader are just used to facilitate
> matching outputs to inputs.  We need to track the value so that we can
> ensure that
>
>    layout(location=2) out float foo;
>
> will be assigned the same resource as
>
>    layout(location=2) in float bar;
>
> but we probably don't want to use 2 as the actual location in the set of
> varyings.

I assumed that layout(location=2) would be using VARYING_SLOT_VARx -- I
don't know of any reason to try and pack these, and it sucks to see
another field in our already-bloated ir_variables.  It looks like other
code in the series would go away if we just mapped things directly to
VARYING_SLOTs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140411/c718c872/attachment.sig>


More information about the mesa-dev mailing list