From b0f782a0e323434df36276c87dfc4def1a93eade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 5 Mar 2019 13:46:51 +0100 Subject: Disable driver fallback to GLES2 by default GLES2 is not designed to be a drop-in replacement for the GLES3 backend, so the fallback mode has to be used knowingly. It *can* make sense for simple projects which make sure to handle the differences between both rendering backends, but most users should stick to one supported backend. By making it opt-in, we can now use this parameter to define whether to export ETC textures to Android and iOS when using GLES3 + Fallback. When using GLES3 without Fallback on Android, set the proper min GLES version in the AndroidManifest. Also made the option boolean and renamed it for clarity and to avoid conflict with the previous String option (which would always evaluate as "true" otherwise). Fixes #26569. --- platform/android/export/export.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'platform/android/export') diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 8ffd355219..aab4bc3883 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -658,6 +658,8 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { int orientation = p_preset->get("screen/orientation"); + bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES3" && + !ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2"); bool screen_support_small = p_preset->get("screen/support_small"); bool screen_support_normal = p_preset->get("screen/support_normal"); bool screen_support_large = p_preset->get("screen/support_large"); @@ -815,6 +817,11 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { } } + if (tname == "uses-feature" && attrname == "glEsVersion") { + + encode_uint32(min_gles3 ? 0x00030000 : 0x00020000, &p_manifest.write[iofs + 16]); + } + iofs += 20; } @@ -1119,6 +1126,9 @@ public: r_features->push_back("etc"); } else if (driver == "GLES3") { r_features->push_back("etc2"); + if (ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2")) { + r_features->push_back("etc"); + } } Vector abis = get_enabled_abis(p_preset); -- cgit v1.2.3