OSDN Git Service

main: buffer array variables can have array size of 0 if they are unsized
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Thu, 1 Oct 2015 12:46:01 +0000 (14:46 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Fri, 9 Oct 2015 06:13:55 +0000 (08:13 +0200)
commitd0992fa15a4bfaff59de50e6084a0a14882d3bdb
tree4f4d2254ffaecb046d2fe83048e4079bebcbe38a
parent66ca8e6632b2623425f848b9efc16edbed56f306
main: buffer array variables can have array size of 0 if they are unsized

From ARB_program_query_interface:

  For the property ARRAY_SIZE, a single integer identifying the number of
  active array elements of an active variable is written to <params>. The
  array size returned is in units of the type associated with the property
  TYPE. For active variables not corresponding to an array of basic types,
  the value one is written to <params>. If the variable is a shader
  storage block member in an array with no declared size, the value zero
  is written to <params>.

v2:
- Unsized arrays of arrays have an array size different than zero

v3:
- Arrays and unsized arrays will have an array_stride > 0. Use it
  instead of is_unsized_array flag (Timothy).

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
src/mesa/main/shader_query.cpp