From e457f41f9b20aa90b43ab0af500d0f4dff5e7e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 14 Feb 2024 14:43:10 +0100 Subject: [PATCH] Remove code relative to obsoleted ETC texture format Co-authored-by: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com> --- drivers/gles3/storage/utilities.cpp | 5 +---- editor/editor_property_name_processor.cpp | 1 - editor/export/editor_export_platform_pc.cpp | 4 ---- editor/project_settings_editor.cpp | 1 - modules/basis_universal/register_types.cpp | 4 ++-- modules/ktx/texture_loader_ktx.cpp | 2 +- .../linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml | 3 --- platform/windows/doc_classes/EditorExportPlatformWindows.xml | 3 --- servers/rendering/dummy/storage/utilities.h | 2 +- servers/rendering/renderer_rd/storage_rd/utilities.cpp | 2 +- 10 files changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/gles3/storage/utilities.cpp b/drivers/gles3/storage/utilities.cpp index 8a9e61c7256..793b3f64f0f 100644 --- a/drivers/gles3/storage/utilities.cpp +++ b/drivers/gles3/storage/utilities.cpp @@ -355,19 +355,16 @@ bool Utilities::has_os_feature(const String &p_feature) const { if (p_feature == "rgtc") { return config->rgtc_supported; } - if (p_feature == "s3tc") { return config->s3tc_supported; } - if (p_feature == "bptc") { return config->bptc_supported; } if (p_feature == "astc") { return config->astc_supported; } - - if (p_feature == "etc" || p_feature == "etc2") { + if (p_feature == "etc2") { return config->etc2_supported; } diff --git a/editor/editor_property_name_processor.cpp b/editor/editor_property_name_processor.cpp index f7a48d4c5b3..836187ffb5c 100644 --- a/editor/editor_property_name_processor.cpp +++ b/editor/editor_property_name_processor.cpp @@ -159,7 +159,6 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { capitalize_string_remaps["dtls"] = "DTLS"; capitalize_string_remaps["eol"] = "EOL"; capitalize_string_remaps["erp"] = "ERP"; - capitalize_string_remaps["etc"] = "ETC"; capitalize_string_remaps["etc2"] = "ETC2"; capitalize_string_remaps["fabrik"] = "FABRIK"; capitalize_string_remaps["fbx"] = "FBX"; diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp index 42df0d93f62..613a1372ead 100644 --- a/editor/export/editor_export_platform_pc.cpp +++ b/editor/export/editor_export_platform_pc.cpp @@ -40,9 +40,6 @@ void EditorExportPlatformPC::get_preset_features(const Ref & if (p_preset->get("texture_format/s3tc")) { r_features->push_back("s3tc"); } - if (p_preset->get("texture_format/etc")) { - r_features->push_back("etc"); - } if (p_preset->get("texture_format/etc2")) { r_features->push_back("etc2"); } @@ -62,7 +59,6 @@ void EditorExportPlatformPC::get_export_options(List *r_options) c r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/bptc"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), true)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), false)); } diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index e59bb76ff43..b7f28068b7b 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -280,7 +280,6 @@ void ProjectSettingsEditor::_add_feature_overrides() { presets.insert("bptc"); presets.insert("s3tc"); - presets.insert("etc"); presets.insert("etc2"); presets.insert("editor"); presets.insert("template_debug"); diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp index f538fc66760..c9ea67cb096 100644 --- a/modules/basis_universal/register_types.cpp +++ b/modules/basis_universal/register_types.cpp @@ -190,9 +190,9 @@ static Ref basis_universal_unpacker_ptr(const uint8_t *p_data, int p_size } else if (RS::get_singleton()->has_os_feature("s3tc")) { format = basist::transcoder_texture_format::cTFBC1; // get this from renderer imgfmt = Image::FORMAT_DXT1; - } else if (RS::get_singleton()->has_os_feature("etc")) { + } else if (RS::get_singleton()->has_os_feature("etc2")) { format = basist::transcoder_texture_format::cTFETC1; // get this from renderer - imgfmt = Image::FORMAT_ETC; + imgfmt = Image::FORMAT_ETC2_RGB8; } else { format = basist::transcoder_texture_format::cTFBGR565; // get this from renderer imgfmt = Image::FORMAT_RGB565; diff --git a/modules/ktx/texture_loader_ktx.cpp b/modules/ktx/texture_loader_ktx.cpp index 155ed56bd08..026c0ce510b 100644 --- a/modules/ktx/texture_loader_ktx.cpp +++ b/modules/ktx/texture_loader_ktx.cpp @@ -287,7 +287,7 @@ static Ref load_from_file_access(Ref f, Error *r_error) { ktxfmt = KTX_TTF_BC7_RGBA; } else if (RS::get_singleton()->has_os_feature("s3tc")) { ktxfmt = KTX_TTF_BC1_RGB; - } else if (RS::get_singleton()->has_os_feature("etc")) { + } else if (RS::get_singleton()->has_os_feature("etc2")) { ktxfmt = KTX_TTF_ETC1_RGB; } else { ktxfmt = KTX_TTF_RGBA32; diff --git a/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml index 07378566c3d..6034f414e22 100644 --- a/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml +++ b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml @@ -60,9 +60,6 @@ If [code]true[/code], project textures are exported in the BPTC format. - - If [code]true[/code], project textures are exported in the ETC format. - If [code]true[/code], project textures are exported in the ETC2 format. diff --git a/platform/windows/doc_classes/EditorExportPlatformWindows.xml b/platform/windows/doc_classes/EditorExportPlatformWindows.xml index 2a286de100b..1d845d7b2f2 100644 --- a/platform/windows/doc_classes/EditorExportPlatformWindows.xml +++ b/platform/windows/doc_classes/EditorExportPlatformWindows.xml @@ -126,9 +126,6 @@ If [code]true[/code], project textures are exported in the BPTC format. - - If [code]true[/code], project textures are exported in the ETC format. - If [code]true[/code], project textures are exported in the ETC2 format. diff --git a/servers/rendering/dummy/storage/utilities.h b/servers/rendering/dummy/storage/utilities.h index 4a640f9594f..6e8af9afac1 100644 --- a/servers/rendering/dummy/storage/utilities.h +++ b/servers/rendering/dummy/storage/utilities.h @@ -108,7 +108,7 @@ public: virtual void set_debug_generate_wireframes(bool p_generate) override {} virtual bool has_os_feature(const String &p_feature) const override { - return p_feature == "rgtc" || p_feature == "bptc" || p_feature == "s3tc" || p_feature == "etc" || p_feature == "etc2"; + return p_feature == "rgtc" || p_feature == "bptc" || p_feature == "s3tc" || p_feature == "etc2"; } virtual void update_memory_info() override {} diff --git a/servers/rendering/renderer_rd/storage_rd/utilities.cpp b/servers/rendering/renderer_rd/storage_rd/utilities.cpp index cb035c494c2..8b780a6f7b1 100644 --- a/servers/rendering/renderer_rd/storage_rd/utilities.cpp +++ b/servers/rendering/renderer_rd/storage_rd/utilities.cpp @@ -278,7 +278,7 @@ bool Utilities::has_os_feature(const String &p_feature) const { return true; } - if ((p_feature == "etc" || p_feature == "etc2") && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { + if (p_feature == "etc2" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { return true; }