id = glCreateProgram();
module = 0;
- bindings = 0;
+ transient = 0;
linked = false;
}
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)
{
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;
}
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)
}
}
- delete bindings;
- bindings = 0;
+ delete transient;
+ transient = 0;
}
}
else if(module->get_format()==Module::SPIR_V)
};
private:
- struct Bindings
+ struct TransientData
{
std::map<std::string, unsigned> textures;
std::map<std::string, unsigned> blocks;
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;