UniformBlock *old_last_block = last_buffer_block;
auto prog_begin = get_program(prog);
+ bool check_buffer = (buffer && !buffer->get_size());
Mask force_dirty = (dirty==ALL_ONES ? ALL_ONES : 0U);
Mask affected = (dirty&prog_begin->masks.used) | force_dirty;
if(affected|prog_begin->masks.dirty)
prog_begin->masks.dirty = 0;
- if(last_buffer_block!=old_last_block || (buffer && !buffer->get_size()))
+ if(last_buffer_block!=old_last_block)
+ check_buffer = true;
+ }
+
+ if(check_buffer)
+ {
+ unsigned required_size = last_buffer_block->get_required_buffer_size(streaming);
+ if(last_buffer_block->get_required_buffer_size()>buffer->get_size())
{
- unsigned required_size = last_buffer_block->get_required_buffer_size(streaming);
- if(last_buffer_block->get_required_buffer_size()>buffer->get_size())
- {
- if(buffer->get_size()>0)
- recreate_buffer();
+ if(buffer->get_size()>0)
+ recreate_buffer();
- buffer->storage(required_size, (streaming ? STREAMING : STATIC));
- }
+ buffer->storage(required_size, (streaming ? STREAMING : STATIC));
}
}