From: Connor Abbott Date: Sat, 4 Jul 2015 22:46:58 +0000 (-0700) Subject: nir/spirv: fix a bad assertion in the decoration handling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=73351c6a18ee0104739b75555f82dc407885a559;p=mesa.git nir/spirv: fix a bad assertion in the decoration handling We should be asserting that the parent decoration didn't hand us a member if the child decoration did, but different child decorations may obviously have different members. --- diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index a7f0837e67f..ed23a9cb747 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -184,17 +184,20 @@ _foreach_decoration_helper(struct vtn_builder *b, struct vtn_value *value, vtn_decoration_foreach_cb cb, void *data) { + int new_member = member; + for (struct vtn_decoration *dec = value->decoration; dec; dec = dec->next) { if (dec->member >= 0) { assert(member == -1); - member = dec->member; + new_member = dec->member; } if (dec->group) { assert(dec->group->value_type == vtn_value_type_decoration_group); - _foreach_decoration_helper(b, base_value, member, dec->group, cb, data); + _foreach_decoration_helper(b, base_value, new_member, dec->group, + cb, data); } else { - cb(b, base_value, member, dec, data); + cb(b, base_value, new_member, dec, data); } } }