From: Jason Ekstrand Date: Wed, 14 Oct 2015 03:00:05 +0000 (-0700) Subject: nir/spirv: Fix a bug in indirect OpAccessChain handling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d2d8945eb8618a12ac5457bab54e76d317114775;p=mesa.git nir/spirv: Fix a bug in indirect OpAccessChain handling --- 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;