X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fprogram.cpp;h=e4250b6c05739b52d8f1e339db7c188ffac35aad;hb=3efe3bab1c8290bd49a957ebec0ad97e58a35fcf;hp=533dca610c9585f649420edadd34bf4f5e858617;hpb=58c5647c775e38dd08a64ad435dfe0673a62fcd1;p=libs%2Fgl.git diff --git a/source/core/program.cpp b/source/core/program.cpp index 533dca61..e4250b6c 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -33,14 +33,13 @@ void Program::add_stages(const Module &mod, const map &spec_values) reflect_data = ReflectData(); const Module *final_module = &mod; - TransientData transient; switch(mod.get_format()) { case Module::GLSL: - add_glsl_stages(static_cast(mod), spec_values, transient); + add_glsl_stages(static_cast(mod), spec_values); break; case Module::SPIR_V: - if(!spec_values.empty()) + if(static_cast(mod).is_specializable()) { specialized_spirv = static_cast(mod).specialize(spec_values); final_module = specialized_spirv; @@ -51,8 +50,6 @@ void Program::add_stages(const Module &mod, const map &spec_values) throw invalid_argument("Program::add_stages"); } - finalize(*final_module, transient); - if(final_module->get_format()==Module::SPIR_V) { const SpirVModule &spirv_mod = *static_cast(final_module); @@ -63,12 +60,7 @@ void Program::add_stages(const Module &mod, const map &spec_values) finalize_uniforms(); - for(const ReflectData::UniformInfo &u: reflect_data.uniforms) - if(u.binding>=0) - reflect_data.used_bindings.push_back(u.binding); - for(const ReflectData::UniformBlockInfo &b: reflect_data.uniform_blocks) - reflect_data.used_bindings.push_back(b.bind_point); - sort(reflect_data.used_bindings); + reflect_data.update_used_bindings(); for(const ReflectData::UniformInfo &u: reflect_data.uniforms) require_type(u.type);