From: Mikko Rasa Date: Sat, 24 Apr 2021 15:58:53 +0000 (+0300) Subject: Give Program::Bindings a more generic name X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c5366b68add58fbc4889186125f15205e093e310;p=libs%2Fgl.git Give Program::Bindings a more generic name --- diff --git a/source/core/program.cpp b/source/core/program.cpp index 9b5400a3..39184bbd 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -71,7 +71,7 @@ void Program::init() id = glCreateProgram(); module = 0; - bindings = 0; + transient = 0; linked = false; } @@ -160,10 +160,10 @@ void Program::add_glsl_stages(const GlslModule &mod, const map &spe compile_glsl_stage(stage_id); } - if(!bindings) - bindings = new Bindings; - bindings->textures = compiler.get_texture_bindings(); - bindings->blocks = compiler.get_uniform_block_bindings(); + if(!transient) + transient = new TransientData; + transient->textures = compiler.get_texture_bindings(); + transient->blocks = compiler.get_uniform_block_bindings(); } void Program::compile_glsl_stage(unsigned stage_id) @@ -309,12 +309,12 @@ void Program::link() { query_uniforms(); query_attributes(); - if(bindings) + if(transient) { for(unsigned i=0; i::const_iterator j = bindings->blocks.find(uniform_blocks[i].name); - if(j!=bindings->blocks.end()) + map::const_iterator j = transient->blocks.find(uniform_blocks[i].name); + if(j!=transient->blocks.end()) { glUniformBlockBinding(id, i, j->second); uniform_blocks[i].bind_point = j->second; @@ -322,7 +322,7 @@ void Program::link() } Conditional _bind(!ARB_separate_shader_objects, this); - for(map::const_iterator i=bindings->textures.begin(); i!=bindings->textures.end(); ++i) + for(map::const_iterator i=transient->textures.begin(); i!=transient->textures.end(); ++i) { int location = get_uniform_location(i->first); if(location>=0) @@ -334,8 +334,8 @@ void Program::link() } } - delete bindings; - bindings = 0; + delete transient; + transient = 0; } } else if(module->get_format()==Module::SPIR_V) diff --git a/source/core/program.h b/source/core/program.h index 666cfd3e..6ed2f571 100644 --- a/source/core/program.h +++ b/source/core/program.h @@ -101,7 +101,7 @@ public: }; private: - struct Bindings + struct TransientData { std::map textures; std::map blocks; @@ -110,7 +110,7 @@ private: unsigned id; std::vector stage_ids; const Module *module; - Bindings *bindings; + TransientData *transient; bool linked; std::vector uniform_blocks; std::vector uniforms;