]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/renderer.cpp
Multiplex streaming buffer contents on Vulkan
[libs/gl.git] / source / render / renderer.cpp
index 946f0100bbbf0a5467877e451343d643a0f13670..d3124f0da334c7439e630266db0eef7c8c4654cf 100644 (file)
@@ -247,7 +247,7 @@ void Renderer::clear(const ClearValue *values)
 void Renderer::draw(const Batch &batch)
 {
        apply_state();
-       batch.refresh();
+       batch.refresh(frame_index);
        pipeline_state.set_primitive_type(batch.get_type());
        commands.use_pipeline(&pipeline_state);
        commands.draw(batch);
@@ -256,7 +256,7 @@ void Renderer::draw(const Batch &batch)
 void Renderer::draw_instanced(const Batch &batch, unsigned count)
 {
        apply_state();
-       batch.refresh();
+       batch.refresh(frame_index);
        pipeline_state.set_primitive_type(batch.get_type());
        commands.use_pipeline(&pipeline_state);
        commands.draw_instanced(batch, count);
@@ -323,7 +323,7 @@ void Renderer::apply_state()
                        shdata_stack.erase(shdata_stack.begin()+state.shdata_count, shdata_stack.end());
                for(const BoundProgramData &d: shdata_stack)
                {
-                       d.shdata->apply(*state.shprog, pipeline_state);
+                       d.shdata->apply(*state.shprog, pipeline_state, frame_index);
                        d.generation = d.shdata->get_generation();
                }
                changed &= ~SHADER_DATA;
@@ -332,9 +332,9 @@ void Renderer::apply_state()
        if(state.vertex_setup)
        {
                if(const VertexArray *array = state.vertex_setup->get_vertex_array())
-                       array->refresh();
+                       array->refresh(frame_index);
                if(const VertexArray *array = state.vertex_setup->get_instance_array())
-                       array->refresh();
+                       array->refresh(frame_index);
        }
        pipeline_state.set_vertex_setup(state.vertex_setup);