nir/linker: Fill TOP_LEVEL_ARRAY_SIZE and STRIDE
authorAntia Puentes <apuentes@igalia.com>
Sun, 30 Jun 2019 23:27:59 +0000 (18:27 -0500)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 12 Jul 2019 21:42:41 +0000 (23:42 +0200)
commitbfc5e467467e2accb5f9877e3dbaca35825846ca
tree547a5fe28fb33a3eed9ff22d5e96f9489cfa9c1a
parentae2ea5ec1f6630c2712ad48e8e03737b7efc74e7
nir/linker: Fill TOP_LEVEL_ARRAY_SIZE and STRIDE

From the ARB_program_interface_query specification:

    "For the property TOP_LEVEL_ARRAY_SIZE, a single integer
    identifying the number of active array elements of the top-level
    shader storage block member containing to the active variable is
    written to <params>.  If the top-level block member is not
    declared as an array, the value one is written to <params>.  If
    the top-level block member is an array with no declared size, the
    value zero is written to <params>."

    "For the property TOP_LEVEL_ARRAY_STRIDE, a single integer
    identifying the stride between array elements of the top-level
    shader storage block member containing the active variable is
    written to <params>.  For top-level block members declared as
    arrays, the value written is the difference, in basic machine
    units, between the offsets of the active variable for consecutive
    elements in the top-level array.  For top-level block members not
    declared as an array, zero is written to <params>."

v2: move top_level_array_size and stride into nir_link_uniforms_state
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/glsl/gl_nir_link_uniforms.c