From f8bf444f26ce0bb392b96317ef3665be0af110aa Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 15 Sep 2021 00:14:34 +0300 Subject: [PATCH] Fix valgrind warnings --- source/core/pipelinestate.cpp | 3 +-- source/render/renderer.cpp | 3 ++- source/render/scene.cpp | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) 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); -- 2.45.2