]> git.tdb.fi Git - libs/gl.git/commitdiff
Give Program::Bindings a more generic name
authorMikko Rasa <tdb@tdb.fi>
Sat, 24 Apr 2021 15:58:53 +0000 (18:58 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 24 Apr 2021 16:00:43 +0000 (19:00 +0300)
source/core/program.cpp
source/core/program.h

index 9b5400a38122073af034eb05a17cdef434ad5820..39184bbd3b9b18304cc969ffd955cf8e3ed6f4eb 100644 (file)
@@ -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<string, int> &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<uniform_blocks.size(); ++i)
                        {
-                               map<string, unsigned>::const_iterator j = bindings->blocks.find(uniform_blocks[i].name);
-                               if(j!=bindings->blocks.end())
+                               map<string, unsigned>::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<BindRestore> _bind(!ARB_separate_shader_objects, this);
-                       for(map<string, unsigned>::const_iterator i=bindings->textures.begin(); i!=bindings->textures.end(); ++i)
+                       for(map<string, unsigned>::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)
index 666cfd3eeda8f6a00449b9ab4d899ff64aa0af78..6ed2f5716e7e50e0e20371204bb1eb32035a2aa5 100644 (file)
@@ -101,7 +101,7 @@ public:
        };
 
 private:
-       struct Bindings
+       struct TransientData
        {
                std::map<std::string, unsigned> textures;
                std::map<std::string, unsigned> blocks;
@@ -110,7 +110,7 @@ private:
        unsigned id;
        std::vector<unsigned> stage_ids;
        const Module *module;
-       Bindings *bindings;
+       TransientData *transient;
        bool linked;
        std::vector<UniformBlockInfo> uniform_blocks;
        std::vector<UniformInfo> uniforms;