[Mesa-dev] [PATCH 11/16] glsl: Track matrix layout of structure fields using two bits

Jordan Justen jljusten at gmail.com
Tue Jul 29 17:36:02 PDT 2014


On Wed, Jul 23, 2014 at 2:39 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 07/21/2014 03:17 PM, Matt Turner wrote:
>> On Mon, Jul 21, 2014 at 2:04 PM, Ian Romanick <idr at freedesktop.org> wrote:
>>> +enum glsl_matrix_layout {
>>> +   GLSL_MATRIX_LAYOUT_DEFAULT,
>>
>> Does this mean language-default, or does it really means the inherited
>> layout? E.g., for
>>
>> layout(row_major) uniform a {
>>    mat4 m;
>> };
>>
>> m's .matrix_layout is GLSL_MATRIX_LAYOUT_DEFAULT, so we look to the
>> outer row_major qualifier on uniform a?
>
> Correct.  If some entity inside a block has GLSL_MATRIX_LAYOUT_DEFAULT
> then it either is not (or cannot contain) a matrix, or its layout is
> inherited from the next outer container.  The interface type itself will
> never have GLSL_MATRIX_LAYOUT_DEFAULT.
>
>> If so, could we name it _INHERITED or something?
>
> That works.  I think I like that better than _NOT_SET.  The layout may
> not be set for the interface type, but it will always have a layout of
> either GLSL_MATRIX_LAYOUT_COLUMN_MAJOR or GLSL_MATRIX_LAYOUT_ROW_MAJOR.

Patch Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

_DEFAULT=>_INHERITED seems like a good change to.


More information about the mesa-dev mailing list