diff options
author | Jason Ekstrand <[email protected]> | 2016-02-01 13:26:59 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-02-01 13:26:59 -0800 |
commit | abc0e5c1b8f7a9b5bbe5363156c13ef0c6de17c0 (patch) | |
tree | f2d6cc8b33a6968e4522437fd5eb67e51e6e78a9 /src/glsl | |
parent | 2d2c6fc6bbfe9ecd8b0f6072b0dc29d48a89b92c (diff) |
nir/spirv: Fix the UBO loading case of a single row-major matric column
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/spirv/vtn_variables.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glsl/nir/spirv/vtn_variables.c b/src/glsl/nir/spirv/vtn_variables.c index dd006c355d9..ee1e3da2e08 100644 --- a/src/glsl/nir/spirv/vtn_variables.c +++ b/src/glsl/nir/spirv/vtn_variables.c @@ -498,19 +498,23 @@ _vtn_block_load_store(struct vtn_builder *b, nir_intrinsic_op op, bool load, nir_iadd(&b->nb, offset, nir_imm_int(&b->nb, i * type->stride)); - struct vtn_ssa_value *comp = NULL, temp_val; + struct vtn_ssa_value *comp, temp_val; if (!load) { temp_val.def = nir_channel(&b->nb, (*inout)->def, i); temp_val.type = glsl_scalar_type(base_type); - comp = &temp_val; } + comp = &temp_val; _vtn_load_store_tail(b, op, load, index, elem_offset, &comp, glsl_scalar_type(base_type)); comps[i] = comp->def; } - if (load) + if (load) { + if (*inout == NULL) + *inout = vtn_create_ssa_value(b, type->type); + (*inout)->def = nir_vec(&b->nb, comps, num_comps); + } } } else { /* Column-major with a deref. Fall through to array case. */ |