From 375d9905b59dcb31edca0a83198199449f094eca Mon Sep 17 00:00:00 2001 From: Markus <44006014+minosvasilias@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:12:17 +0200 Subject: [PATCH] Apply S3TC Android/iOS fix to GLES3 (cherry picked from commit 4abe07c81162b0f2b5b8bce548bc7a023f73dc89) --- drivers/gles3/rasterizer_storage_gles3.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index a630b13cd48..14ecb5a40d3 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -8062,6 +8062,12 @@ void RasterizerStorageGLES3::initialize() { config.framebuffer_float_supported = config.extensions.has("GL_EXT_color_buffer_float"); config.framebuffer_half_float_supported = config.extensions.has("GL_EXT_color_buffer_half_float") || config.framebuffer_float_supported; + // If the desktop build is using S3TC, and you export / run from the IDE for android, if the device supports + // S3TC it will crash trying to load these textures, as they are not exported in the APK. This is a simple way + // to prevent Android devices trying to load S3TC, by faking lack of hardware support. +#if defined(ANDROID_ENABLED) || defined(IPHONE_ENABLED) + config.s3tc_supported = false; +#endif #endif // not yet detected on GLES3 (is this mandated?)