+TypeDeclaration *TypeResolver::get_or_create_image_type(ImageTypeDeclaration &type, const std::string &texel_format)
+{
+ if(texel_format.empty())
+ return &type;
+
+ auto key = make_pair(&type, texel_format);
+ auto i = image_types.find(key);
+ if(i!=image_types.end())
+ return i->second;
+
+ ImageTypeDeclaration *image = new ImageTypeDeclaration(type);
+ image->source = INTERNAL_SOURCE;
+ image->name = format("%s_%s", type.name, texel_format);
+ image->format = texel_format;
+ image->base_image = &type;
+ stage->content.body.insert(type_insert_point, image);
+ image_types[key] = image;
+ return image;
+}
+
+void TypeResolver::resolve_type(TypeDeclaration *&type, const string &name, bool array, const Layout *layout)