if(current_state)
throw invalid_operation("Renderer::begin");
+ ++frame_index;
state_stack.emplace_back();
current_state = &state_stack.back();
RendererBackend::begin();
add_shader_data(standard_shdata);
+ commands.begin_frame(frame_index);
}
void Renderer::end()
{
apply_state();
batch.refresh();
+ pipeline_state.set_primitive_type(batch.get_type());
commands.use_pipeline(&pipeline_state);
commands.draw(batch);
}
{
apply_state();
batch.refresh();
+ pipeline_state.set_primitive_type(batch.get_type());
commands.use_pipeline(&pipeline_state);
commands.draw_instanced(batch, count);
}