+ auto i = lower_bound_member(resources, binding, &BoundResource::binding);
+ if(i==resources.end() || i->binding!=binding)
+ i = resources.insert(i, BoundResource(binding));
+
+ ResourceType type = (block ? UNIFORM_BLOCK : NO_RESOURCE);
+ const Buffer *buffer = (block ? block->get_buffer() : 0);
+ if(i->type!=type || block!=i->block || buffer!=i->buffer || binding<0)
+ {
+ i->type = type;
+ i->block = block;
+ i->buffer = buffer;
+ i->changed = true;
+ i->used = block;
+ changes |= RESOURCES;
+ }