[Mesa-dev] [PATCH 00/13] st/mesa: finally finish ARB_enhanced_layouts

Ilia Mirkin imirkin at alum.mit.edu
Sun Oct 9 04:56:24 UTC 2016


On Sat, Oct 8, 2016 at 8:04 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Fri, Oct 7, 2016 at 3:55 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
>> Hi everybody,
>>
>> this series implements the missing piece of ARB_enhanced_layouts, which is
>> the component numbers part of the extension.  You can find the full series
>> here: https://cgit.freedesktop.org/~nh/mesa/log/?h=ARB_enhanced_layouts
>>
>> The series follows the approach sketched by Ilia a few months back.  The
>> UsageMask part of input and output declarations is put to use, translating
>>
>> layout(location = 0, component = 1) in vec2 a[4];
>> layout(location = 2, component = 3) in float b[4];
>> layout(location = 1, component = 3) in float c;
>> layout(location = 2, component = 0) in float d;
>>
>> into
>>
>> DCL IN[0..3].yz, ARRAY(1), GENERIC[0], PERSPECTIVE
>> DCL IN[2..5].w, ARRAY(2), GENERIC[2], PERSPECTIVE
>> DCL IN[1].w, GENERIC[1], PERSPECTIVE
>> DCL IN[2].x, GENERIC[2], PERSPECTIVE
>
> Hmmm... this seems potentially fragile wrt existing implementations.
> Are there any tests where IN[1].w (for example) would be
> flat-qualified? In order for that to be supported properly, an
> implementation would almost certainly have to look at the UsageMask. I
> think in my original proposal, I was suggesting that there would be no
> overlapping like this for the inputs, i.e. the above would be
>
> IN[0..3].yz -> GENERIC[0]
> IN[4..7].w -> GENERIC[2]
> etc
>
> Although your approach has the advantage of not having to futz with
> the input/output mapping logic too much. So ultimately I think it's
> fine, but tests need to be added for having different interpolation
> settings for different components of a "shared" slot.

Ah nevermind. Looks like this is illegal:

"""
        Further, when location aliasing, the aliases
        sharing the location must have the same underlying numerical type
        (floating-point or integer) and the same auxiliary storage and
        interpolation qualification.
"""

Well that sure makes things a little simpler.

  -ilia


More information about the mesa-dev mailing list