nir: nir_build_deref_follower accept array derefs of vectors
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 15 Jan 2019 00:10:44 +0000 (16:10 -0800)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Sat, 23 Feb 2019 05:00:50 +0000 (21:00 -0800)
Code itself already supports it, just make sure we can use it for
those cases.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_builder.h

index 2a36eb3c91bfd9013a3c8ed6534976f2c0f26342..c6e80e729a85d2725831b1fe066a03e742f8c829 100644 (file)
@@ -928,7 +928,9 @@ nir_build_deref_follower(nir_builder *b, nir_deref_instr *parent,
    case nir_deref_type_array:
    case nir_deref_type_array_wildcard:
       assert(glsl_type_is_matrix(parent->type) ||
-             glsl_type_is_array(parent->type));
+             glsl_type_is_array(parent->type) ||
+             (leader->deref_type == nir_deref_type_array &&
+              glsl_type_is_vector(parent->type)));
       assert(glsl_get_length(parent->type) ==
              glsl_get_length(leader_parent->type));