From 593f88c0db10c31486db872c0eeda0c66ca22afb Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 1 Feb 2016 13:26:59 -0800 Subject: [PATCH] nir/spirv: Fix the UBO loading case of a single row-major matric column --- src/glsl/nir/spirv/vtn_variables.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv/vtn_variables.c b/src/glsl/nir/spirv/vtn_variables.c index ee1e3da2e08..7d44cf4be9e 100644 --- a/src/glsl/nir/spirv/vtn_variables.c +++ b/src/glsl/nir/spirv/vtn_variables.c @@ -490,8 +490,11 @@ _vtn_block_load_store(struct vtn_builder *b, nir_intrinsic_op op, bool load, _vtn_load_store_tail(b, op, load, index, offset, inout, glsl_scalar_type(base_type)); } else { - /* Picking one element off each column */ + /* Grabbing a column; picking one element off each row */ unsigned num_comps = glsl_get_vector_elements(type->type); + const struct glsl_type *column_type = + glsl_get_column_type(type->type); + nir_ssa_def *comps[4]; for (unsigned i = 0; i < num_comps; i++) { nir_ssa_def *elem_offset = @@ -511,7 +514,7 @@ _vtn_block_load_store(struct vtn_builder *b, nir_intrinsic_op op, bool load, if (load) { if (*inout == NULL) - *inout = vtn_create_ssa_value(b, type->type); + *inout = vtn_create_ssa_value(b, column_type); (*inout)->def = nir_vec(&b->nb, comps, num_comps); } -- 2.30.2