-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;
+
+ uint64_t info_hash = hash<64>(module_name);
+ for(const auto &kvp: spec_values)
+ {
+ info_hash = hash_update<64>(info_hash, kvp.first);
+ info_hash = hash_update<64>(info_hash, kvp.second);
+ }
+
+ Resources &res = Resources::get_global();
+ string name = format("_material_%016x.shader", info_hash);
+ Program *shprog = res.find<Program>(name);