From ea32f092131e658e49839822d8702596baaac827 Mon Sep 17 00:00:00 2001 From: Zach Lee Date: Thu, 8 Jun 2023 19:56:26 +0800 Subject: [PATCH] Using the Vulkan backend is prohibited on Android devices running versions below Android 8 (APILevel <= 27). (#15386) --- native/cocos/renderer/GFXDeviceManager.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/native/cocos/renderer/GFXDeviceManager.h b/native/cocos/renderer/GFXDeviceManager.h index c43385a47a..25fdc27326 100644 --- a/native/cocos/renderer/GFXDeviceManager.h +++ b/native/cocos/renderer/GFXDeviceManager.h @@ -28,6 +28,7 @@ #include "gfx-agent/DeviceAgent.h" #include "gfx-validator/DeviceValidator.h" +#include "platform/BasePlatform.h" // #undef CC_USE_NVN // #undef CC_USE_VULKAN @@ -90,7 +91,13 @@ public: #if XR_OEM_PICO Device::isSupportDetachDeviceThread = false; #endif - if (tryCreate(info, &device)) return device; + + bool skipVulkan = false; +#if CC_PLATFORM == CC_PLATFORM_ANDROID + auto sdkVersion = BasePlatform::getPlatform()->getSdkVersion(); + skipVulkan = sdkVersion <= 27; // Android 8 +#endif + if (!skipVulkan && tryCreate(info, &device)) return device; #endif #ifdef CC_USE_METAL