[Impeller] disable gl ext render to texture on vivante. (#169153)

Found code in ANGLE that seems to indicate there are known crashes with
vivnate drivers using gl_ext_render_to_texture. Landing to see if it
fixes https://github.com/flutter/flutter/issues/167850 which we don't
have a device to test for.
This commit is contained in:
Jonah Williams 2025-05-21 09:53:08 -07:00 committed by GitHub
parent dd671fae53
commit efc27a570e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,8 +7,31 @@
#include "impeller/core/formats.h"
#include "impeller/renderer/backend/gles/proc_table_gles.h"
#ifdef FML_OS_ANDROID
#include <sys/system_properties.h>
#endif // FML_OS_ANDROID
namespace impeller {
namespace {
// Workaround for crashes in Vivante GL driver on Android.
//
// See:
// * https://github.com/flutter/flutter/issues/167850
// * http://crbug.com/141785
#ifdef FML_OS_ANDROID
bool IsVivante() {
char product_model[PROP_VALUE_MAX];
__system_property_get("ro.hardware.egl", product_model);
return strcmp(product_model, "VIVANTE") == 0;
}
#else
bool IsVivante() {
return false;
}
#endif // FML_OS_ANDROID
} // namespace
// https://registry.khronos.org/OpenGL/extensions/EXT/EXT_shader_framebuffer_fetch.txt
static const constexpr char* kFramebufferFetchExt =
"GL_EXT_shader_framebuffer_fetch";
@ -124,7 +147,7 @@ CapabilitiesGLES::CapabilitiesGLES(const ProcTableGLES& gl) {
supports_decal_sampler_address_mode_ = true;
}
if (desc->HasExtension(kMultisampledRenderToTextureExt)) {
if (desc->HasExtension(kMultisampledRenderToTextureExt) && !IsVivante()) {
supports_implicit_msaa_ = true;
if (desc->HasExtension(kMultisampledRenderToTexture2Ext)) {