From: Mikko Rasa Date: Tue, 14 Sep 2021 21:14:34 +0000 (+0300) Subject: Fix valgrind warnings X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;ds=sidebyside;h=f8bf444f26ce0bb392b96317ef3665be0af110aa;hp=73590a7fcd931261d2b9c26fd3a0e53a37aa6e2c;p=libs%2Fgl.git Fix valgrind warnings --- diff --git a/source/core/pipelinestate.cpp b/source/core/pipelinestate.cpp index f855eed6..21cb64f9 100644 --- a/source/core/pipelinestate.cpp +++ b/source/core/pipelinestate.cpp @@ -281,11 +281,10 @@ void PipelineState::apply(unsigned mask) const { const BufferBackedUniformBlock *block = static_cast(i->block); glBindBufferRange(GL_UNIFORM_BUFFER, i->binding, block->get_buffer()->get_id(), block->get_offset(), block->get_data_size()); + bound_uniform_blocks[i->binding] = 1; } else static_cast(i->block)->apply(); - - bound_uniform_blocks[i->binding] = 1; } i->changed = false; diff --git a/source/render/renderer.cpp b/source/render/renderer.cpp index 61eccb3b..5610f30a 100644 --- a/source/render/renderer.cpp +++ b/source/render/renderer.cpp @@ -21,7 +21,8 @@ using namespace std; namespace Msp { namespace GL { -Renderer::Renderer() +Renderer::Renderer(): + changed(0) { state_stack.reserve(16); state_stack.push_back(State()); diff --git a/source/render/scene.cpp b/source/render/scene.cpp index d916def8..3c101b8a 100644 --- a/source/render/scene.cpp +++ b/source/render/scene.cpp @@ -104,6 +104,8 @@ Scene::Loader::Loader(Scene &s, Collection &c, ContentMap &m): void Scene::Loader::init() { + inst_counter = 0; + add("object", &Loader::object); add("object", &Loader::object_tagged); add("scene", &Loader::scene);