From: Jason Ekstrand Date: Mon, 1 Feb 2016 21:26:59 +0000 (-0800) Subject: nir/spirv: Fix the UBO loading case of a single row-major matric column X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=593f88c0db10c31486db872c0eeda0c66ca22afb;p=mesa.git nir/spirv: Fix the UBO loading case of a single row-major matric column --- 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); }