From 73351c6a18ee0104739b75555f82dc407885a559 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Sat, 4 Jul 2015 15:46:58 -0700 Subject: [PATCH] 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. --- src/glsl/nir/spirv_to_nir.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); } } } -- 2.30.2