void ProgramData::mark_dirty(Mask bits)
{
if(!dirty)
+ {
+ if(generation && !streaming)
+ {
+ streaming = true;
+ if(buffer && buffer->get_size())
+ recreate_buffer();
+ }
++generation;
+ }
dirty |= bits;
}
prog_begin->masks.dirty = 0;
- if(last_buffer_block!=old_last_block)
+ if(last_buffer_block!=old_last_block || (buffer && !buffer->get_size()))
{
- unsigned required_size = last_buffer_block->get_required_buffer_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();
- buffer->storage(required_size, STREAMING);
+ buffer->storage(required_size, (streaming ? STREAMING : STATIC));
}
}
}
mutable std::vector<ProgramBlock> programs;
mutable UniformBlock *last_buffer_block = 0;
mutable Buffer *buffer = 0;
+ bool streaming = false;
mutable Mask dirty = 0;
std::string debug_name;