[Impeller] Enable mediatek on API 34+. (#165156)

Most of the reported Mediatek issues are API 29/30, maybe up to 31. By
34 it should work, and the mokey device we have works fine with Vulkan
and runs on CI. This is necessary to allow MediaTek devices to use HCPP
without us having to write a new rendering surface abstraction for GL.

This does _not_ enable PowerVR, which is still denylisted in the vulkan
backend.
This commit is contained in:
Jonah Williams 2025-03-13 18:27:29 -07:00 committed by GitHub
parent 603981008e
commit d64db52438
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,7 @@
namespace flutter {
constexpr int kMinimumAndroidApiLevelForImpeller = 29;
constexpr int kMinimumAndroidApiLevelForMediaTekVulkan = 34;
extern "C" {
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
@ -324,8 +325,10 @@ AndroidRenderingAPI FlutterMain::SelectedRenderingAPI(
return kVulkanUnsupportedFallback;
}
if (__system_property_find("ro.vendor.mediatek.platform") != nullptr) {
// Probably MediaTek. Avoid Vulkan.
if (api_level < kMinimumAndroidApiLevelForMediaTekVulkan &&
__system_property_find("ro.vendor.mediatek.platform") != nullptr) {
// Probably MediaTek. Avoid Vulkan if older than 34 to work around
// crashes when importing AHB.
return kVulkanUnsupportedFallback;
}