From f59c1f08d7c621d8d6d7ae34a11e81d3dc1d81d6 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 24 Jun 2024 09:54:00 +0200 Subject: [PATCH] [Web] Add "threads"/"nothreads" feature tags to export presets Following the "variant/thread_support" preset option. --- platform/web/export/export_plugin.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index 8941c26ec04..bd327f6f914 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -334,10 +334,14 @@ void EditorExportPlatformWeb::get_preset_features(const Ref if (p_preset->get("vram_texture_compression/for_desktop")) { r_features->push_back("s3tc"); } - if (p_preset->get("vram_texture_compression/for_mobile")) { r_features->push_back("etc2"); } + if (p_preset->get("variant/thread_support").operator bool()) { + r_features->push_back("threads"); + } else { + r_features->push_back("nothreads"); + } r_features->push_back("wasm32"); } @@ -345,7 +349,7 @@ void EditorExportPlatformWeb::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "variant/extensions_support"), false)); // Export type. + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "variant/extensions_support"), false)); // GDExtension support. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "variant/thread_support"), false)); // Thread support (i.e. run with or without COEP/COOP headers). r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_desktop"), true)); // S3TC r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_mobile"), false)); // ETC or ETC2, depending on renderer