]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix valgrind warnings
authorMikko Rasa <tdb@tdb.fi>
Tue, 14 Sep 2021 21:14:34 +0000 (00:14 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 14 Sep 2021 21:14:34 +0000 (00:14 +0300)
source/core/pipelinestate.cpp
source/render/renderer.cpp
source/render/scene.cpp

index f855eed61e012c35d86775c32e5a8f1c6ce51a16..21cb64f9f51bb88c5f7ccd02b4a5f65fb4006daf 100644 (file)
@@ -281,11 +281,10 @@ void PipelineState::apply(unsigned mask) const
                                        {
                                                const BufferBackedUniformBlock *block = static_cast<const BufferBackedUniformBlock *>(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<const DefaultUniformBlock *>(i->block)->apply();
-
-                                       bound_uniform_blocks[i->binding] = 1;
                                }
 
                                i->changed = false;
index 61eccb3b367ab4540e48bd40768c56beec966163..5610f30a7e4a863c1afb11f043903e0e0314c6d8 100644 (file)
@@ -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());
index d916def84a95448a2dcababd938f3de16bc89322..3c101b8a172cdba1fc421eecc5a182946bb3f308 100644 (file)
@@ -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);