]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/programdata.cpp
Multiplex streaming buffer contents on Vulkan
[libs/gl.git] / source / render / programdata.cpp
index a908284b3abae9de3e8f177b8165daf084ff6eba..f6ad56aee13b6dc0ed740180c24e1a4b32dc57e8 100644 (file)
@@ -656,7 +656,7 @@ vector<ProgramData::ProgramBlock>::const_iterator ProgramData::prepare_program(c
 #endif
                                }
 
-                               buffer->storage(required_size);
+                               buffer->storage(required_size, STREAMING);
                        }
                }
        }
@@ -664,16 +664,17 @@ vector<ProgramData::ProgramBlock>::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);
                }
 }