X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fprogramdata.cpp;h=f6ad56aee13b6dc0ed740180c24e1a4b32dc57e8;hb=6d2e2a0bb28496a8c25b441009bdd2a1a1e72d81;hp=a908284b3abae9de3e8f177b8165daf084ff6eba;hpb=9ec0e018234391efa66cc0f4080bfe470b910288;p=libs%2Fgl.git diff --git a/source/render/programdata.cpp b/source/render/programdata.cpp index a908284b..f6ad56ae 100644 --- a/source/render/programdata.cpp +++ b/source/render/programdata.cpp @@ -656,7 +656,7 @@ vector::const_iterator ProgramData::prepare_program(c #endif } - buffer->storage(required_size); + buffer->storage(required_size, STREAMING); } } } @@ -664,16 +664,17 @@ vector::const_iterator ProgramData::prepare_program(c return prog_begin; } -void ProgramData::apply(const Program &prog, PipelineState &state) const +void ProgramData::apply(const Program &prog, PipelineState &state, unsigned frame) const { auto prog_begin = prepare_program(prog); ReflectData::LayoutHash prog_hash = prog_begin->prog_hash; + for(auto i=prog_begin+1; (i!=programs.end() && i->prog_hash==prog_hash); ++i) if(i->block) { state.set_uniform_block(i->bind_point, i->block); if(i->bind_point>=0) - i->block->refresh(); + i->block->refresh(frame); } }