main: consider that unsized arrays have at least one active element
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Thu, 1 Oct 2015 13:05:00 +0000 (15:05 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Fri, 9 Oct 2015 06:13:55 +0000 (08:13 +0200)
commit66ca8e6632b2623425f848b9efc16edbed56f306
treebb2f437a113682d3535cd9f6114624549d5619bd
parent77c0b64ce335c7013de5da3b9ac497cb400ef8ce
main: consider that unsized arrays have at least one active element

From ARB_shader_storage_buffer_object:

"When using the ARB_program_interface_query extension to enumerate the
 set of active buffer variables, only the first element of arrays (sized
 or unsized) will be enumerated"

_mesa_program_resource_array_size() is used when getting the name (and
name length) of the active variables. When it is an unsized array,
we want to indicate it has one active element so the returned name
would have "[0]" at the end.

v2:
- Use array_stride > 0 and array_elements == 0 to detect unsized
  arrays. Because of that, we don't need 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