Skip to content

Commit d64db52

Browse files
author
Jonah Williams
authored
[Impeller] Enable mediatek on API 34+. (flutter#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.
1 parent 6039810 commit d64db52

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

engine/src/flutter/shell/platform/android/flutter_main.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
namespace flutter {
3333

3434
constexpr int kMinimumAndroidApiLevelForImpeller = 29;
35+
constexpr int kMinimumAndroidApiLevelForMediaTekVulkan = 34;
3536

3637
extern "C" {
3738
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
@@ -324,8 +325,10 @@ AndroidRenderingAPI FlutterMain::SelectedRenderingAPI(
324325
return kVulkanUnsupportedFallback;
325326
}
326327

327-
if (__system_property_find("ro.vendor.mediatek.platform") != nullptr) {
328-
// Probably MediaTek. Avoid Vulkan.
328+
if (api_level < kMinimumAndroidApiLevelForMediaTekVulkan &&
329+
__system_property_find("ro.vendor.mediatek.platform") != nullptr) {
330+
// Probably MediaTek. Avoid Vulkan if older than 34 to work around
331+
// crashes when importing AHB.
329332
return kVulkanUnsupportedFallback;
330333
}
331334

0 commit comments

Comments
 (0)