The OpenGL-specific query calls are now done from the OpenGL backend.
glSpecializeShader(stage_ids[i], j->name.c_str(), spec_id_array.size(), &spec_id_array[0], &spec_value_array[0]);
}
-void OpenGLProgram::finalize(const Module &mod)
+void OpenGLProgram::finalize(const Module &mod, TransientData &transient)
{
glLinkProgram(id);
int status = 0;
if(!info_log.empty())
IO::print("Program link info log:\n%s", info_log);
#endif
+
+ if(mod.get_format()==Module::GLSL)
+ {
+ query_uniforms();
+ query_attributes();
+ apply_bindings(transient);
+ }
}
void OpenGLProgram::query_uniforms()
void compile_glsl_stage(const GlslModule &, unsigned);
void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &, TransientData &);
- void finalize(const Module &);
+ void finalize(const Module &, TransientData &);
void query_uniforms();
void query_uniform_blocks(const std::vector<ReflectData::UniformInfo *> &);
void query_attributes();
throw invalid_argument("Program::add_stages");
}
- finalize(mod);
+ finalize(mod, transient);
- if(mod.get_format()==Module::GLSL)
- {
- query_uniforms();
- query_attributes();
- apply_bindings(transient);
- }
- else if(mod.get_format()==Module::SPIR_V)
+ if(mod.get_format()==Module::SPIR_V)
{
collect_uniforms(static_cast<const SpirVModule &>(mod), transient.spec_values);
collect_attributes(static_cast<const SpirVModule &>(mod));