From d2d8945eb8618a12ac5457bab54e76d317114775 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 13 Oct 2015 20:00:05 -0700 Subject: [PATCH] nir/spirv: Fix a bug in indirect OpAccessChain handling --- src/glsl/nir/spirv_to_nir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index d0fb6a255a5..6503b2590d7 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -1381,10 +1381,10 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode, deref_arr->base_offset = idx; } else { assert(idx_val->value_type == vtn_value_type_ssa); + assert(glsl_type_is_scalar(idx_val->ssa->type)); deref_arr->deref_array_type = nir_deref_array_type_indirect; deref_arr->base_offset = 0; - deref_arr->indirect = - nir_src_for_ssa(vtn_ssa_value(b, w[1])->def); + deref_arr->indirect = nir_src_for_ssa(idx_val->ssa->def); } tail->child = &deref_arr->deref; break; -- 2.30.2