compiler/nir_types: Handle vectors in glsl_get_array_element
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 24 Aug 2017 00:43:36 +0000 (17:43 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 7 Nov 2017 18:41:24 +0000 (10:41 -0800)
commitdf81b81fb91f45e6da0c504ee672d45829c41d06
tree08909c9aa8ca1db66ab43a3fd184157645e845aa
parentad77775809555bc215f468424215e8dddc7083bf
compiler/nir_types: Handle vectors in glsl_get_array_element

Most of NIR doesn't allow doing array indexing on a vector (though it
does on a matrix).  However, nir_lower_io handles it just fine and this
behavior is needed for shared variables in Vulkan.  This commit makes
glsl_get_array_element do something sensible for vector types and makes
nir_validate happy with them.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/nir_types.cpp