nir/spirv: fix a bad assertion in the decoration handling
authorConnor Abbott <connor.w.abbott@intel.com>
Sat, 4 Jul 2015 22:46:58 +0000 (15:46 -0700)
committerConnor Abbott <connor.w.abbott@intel.com>
Mon, 6 Jul 2015 22:00:37 +0000 (15:00 -0700)
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

index a7f0837e67f0c6b906e0059777536e76321044cb..ed23a9cb747e3eaa092d643a80e7c3523ba14d03 100644 (file)
@@ -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);
       }
    }
 }