-const Program *Material::create_compatible_shader(DataFile::Collection &coll) const
-{
- string source = create_program_source();
- string name = format("_material_%016x.glsl", hash64(source));
- Program *shprog = coll.find<Program>(name);
+ for(const auto &kvp: extra_spec)
+ spec_values[kvp.first] = kvp.second;
+
+ string info = module_name;
+ for(const auto &kvp: spec_values)
+ info += format(",%s:%d", kvp.first, kvp.second);
+
+ Resources &res = Resources::get_global();
+ string name = format("_material_%016x.shader", hash64(info));
+ Program *shprog = res.find<Program>(name);