if(changed_sets)
{
descriptor_set_slots.resize(self.shprog->get_n_descriptor_sets());
+ first_changed_desc_set = descriptor_set_slots.size();
for(unsigned i=0; i<descriptor_set_slots.size(); ++i)
if(changed_sets&(1<<i))
+ {
descriptor_set_slots[i] = device.get_descriptor_pool().get_descriptor_set_slot(self, i);
+ first_changed_desc_set = min(first_changed_desc_set, i);
+ }
+
unapplied |= PipelineState::UNIFORMS;
}
}
const PipelineState &self = *static_cast<const PipelineState *>(this);
const VulkanFunctions &vk = device.get_functions();
- unsigned first_changed_desc_set = 0;
if(!last)
+ {
unapplied = ~0U;
+ first_changed_desc_set = 0;
+ }
else if(last!=this)
{
const PipelineState &last_ps = *static_cast<const PipelineState *>(last);
unapplied |= PipelineState::SHPROG;
if(self.vertex_setup!=last_ps.vertex_setup)
unapplied |= PipelineState::VERTEX_SETUP;
- for(unsigned i=0; (i<descriptor_set_slots.size() && i<last->descriptor_set_slots.size()); ++i)
- if(descriptor_set_slots[i]!=last->descriptor_set_slots[i])
+ for(unsigned i=0; i<descriptor_set_slots.size(); ++i)
+ if(i>=last->descriptor_set_slots.size() || descriptor_set_slots[i]!=last->descriptor_set_slots[i])
{
unapplied |= PipelineState::UNIFORMS;
- first_changed_desc_set = i;
+ first_changed_desc_set = min(first_changed_desc_set, i);
break;
}
if(self.viewport!=last_ps.viewport)
}
unapplied = 0;
+ first_changed_desc_set = descriptor_set_slots.size();
}
} // namespace GL