Fix slow editor load on large projects (v2)

This commit is contained in:
Hilderin 2024-08-16 21:55:03 -04:00
parent 2be730a05b
commit 21f7c8a25f
10 changed files with 233 additions and 127 deletions

View file

@ -740,10 +740,8 @@ String ResourceImporterTexture::get_import_settings_string() const {
return s;
}
bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) const {
Dictionary meta = ResourceFormatImporter::get_singleton()->get_resource_metadata(p_path);
if (meta.has("has_editor_variant")) {
bool ResourceImporterTexture::are_import_settings_valid(const String &p_path, const Dictionary &p_meta) const {
if (p_meta.has("has_editor_variant")) {
String imported_path = ResourceFormatImporter::get_singleton()->get_internal_resource_path(p_path);
if (!FileAccess::exists(imported_path)) {
return false;
@ -760,19 +758,19 @@ bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) co
}
}
if (!meta.has("vram_texture")) {
if (!p_meta.has("vram_texture")) {
return false;
}
bool vram = meta["vram_texture"];
bool vram = p_meta["vram_texture"];
if (!vram) {
return true; // Do not care about non-VRAM.
}
// Will become invalid if formats are missing to import.
Vector<String> formats_imported;
if (meta.has("imported_formats")) {
formats_imported = meta["imported_formats"];
if (p_meta.has("imported_formats")) {
formats_imported = p_meta["imported_formats"];
}
int index = 0;