From 452ba4db2badced650555f8af2359d928a63c5be Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 23 Dec 2015 13:17:00 -0800 Subject: [PATCH] nir/spirv: Create the correct type if a matrix-vector multiply produces a vector --- src/glsl/nir/spirv_to_nir.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index d258f23d0ed..91667e11225 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -2369,9 +2369,14 @@ vtn_matrix_multiply(struct vtn_builder *b, unsigned src0_columns = glsl_get_matrix_columns(src0->type); unsigned src1_columns = glsl_get_matrix_columns(src1->type); - struct vtn_ssa_value *dest = - vtn_create_ssa_value(b, glsl_matrix_type(glsl_get_base_type(src0->type), - src0_rows, src1_columns)); + const struct glsl_type *dest_type; + if (src1_columns > 1) { + dest_type = glsl_matrix_type(glsl_get_base_type(src0->type), + src0_rows, src1_columns); + } else { + dest_type = glsl_vector_type(glsl_get_base_type(src0->type), src0_rows); + } + struct vtn_ssa_value *dest = vtn_create_ssa_value(b, dest_type); dest = vtn_wrap_matrix(b, dest); -- 2.30.2