[Impeller] disable older xclipse gpu driver. (#161981)
Fixes https://github.com/flutter/flutter/issues/161334 The first version of the Xclipse series GPU has reported bugs, unfortunately all versions of this GPU report the same driver version. Instead we use the Vulkan version as a proxy, assuming that any newer devices would not lower the supported Vulkan API level. https://vulkan.gpuinfo.org/listreports.php?devicename=samsung+SM-S906B&platform=android
This commit is contained in:
parent
299e157227
commit
b4a81cb6da
@ -166,6 +166,8 @@ constexpr VendorVK IdentifyVendor(uint32_t vendor) {
|
||||
return VendorVK::kApple;
|
||||
case 0x19E5:
|
||||
return VendorVK::kHuawei;
|
||||
case 0x144D:
|
||||
return VendorVK::kSamsung;
|
||||
}
|
||||
// Check if the ID is a known Khronos vendor.
|
||||
switch (vendor) {
|
||||
@ -201,6 +203,8 @@ constexpr const char* VendorToString(VendorVK vendor) {
|
||||
return "Apple";
|
||||
case VendorVK::kHuawei:
|
||||
return "Huawei";
|
||||
case VendorVK::kSamsung:
|
||||
return "Samsung";
|
||||
}
|
||||
FML_UNREACHABLE();
|
||||
}
|
||||
@ -334,6 +338,19 @@ bool DriverInfoVK::IsKnownBadDriver() const {
|
||||
if (vendor_ == VendorVK::kHuawei) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (vendor_ == VendorVK::kSamsung) {
|
||||
// The first version of the Xclipse series GPU has reported
|
||||
// bugs, unfortunately all versions of this GPU report the
|
||||
// same driver version. Instead we use the Vulkan version
|
||||
// as a proxy, assuming that any newer devices would not
|
||||
// lower the supported Vulkan API level.
|
||||
// See
|
||||
// https://vulkan.gpuinfo.org/listreports.php?devicename=samsung+SM-S906B&platform=android
|
||||
// https://github.com/flutter/flutter/issues/161334
|
||||
return !api_version_.IsAtLeast(Version{1, 3, 0});
|
||||
}
|
||||
|
||||
// https://github.com/flutter/flutter/issues/161122
|
||||
// https://github.com/flutter/flutter/issues/160960
|
||||
// https://github.com/flutter/flutter/issues/160866
|
||||
|
@ -122,6 +122,7 @@ enum class VendorVK {
|
||||
kNvidia,
|
||||
kIntel,
|
||||
kHuawei,
|
||||
kSamsung,
|
||||
//----------------------------------------------------------------------------
|
||||
/// Includes the LLVM Pipe CPU implementation.
|
||||
///
|
||||
|
@ -222,6 +222,34 @@ TEST(DriverInfoVKTest, CanUseFramebufferFetch) {
|
||||
EXPECT_TRUE(CanUseFramebufferFetch("Mali-G51", false));
|
||||
}
|
||||
|
||||
TEST(DriverInfoVKTest, DisableOldXclipseDriver) {
|
||||
auto context =
|
||||
MockVulkanContextBuilder()
|
||||
.SetPhysicalPropertiesCallback(
|
||||
[](VkPhysicalDevice device, VkPhysicalDeviceProperties* prop) {
|
||||
prop->vendorID = 0x144D; // Samsung
|
||||
prop->deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
|
||||
// Version 1.1.0
|
||||
prop->apiVersion = (1 << 22) | (1 << 12);
|
||||
})
|
||||
.Build();
|
||||
|
||||
EXPECT_TRUE(context->GetDriverInfo()->IsKnownBadDriver());
|
||||
|
||||
context =
|
||||
MockVulkanContextBuilder()
|
||||
.SetPhysicalPropertiesCallback(
|
||||
[](VkPhysicalDevice device, VkPhysicalDeviceProperties* prop) {
|
||||
prop->vendorID = 0x144D; // Samsung
|
||||
prop->deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
|
||||
// Version 1.3.0
|
||||
prop->apiVersion = (1 << 22) | (3 << 12);
|
||||
})
|
||||
.Build();
|
||||
|
||||
EXPECT_FALSE(context->GetDriverInfo()->IsKnownBadDriver());
|
||||
}
|
||||
|
||||
TEST(DriverInfoVKTest, AllPowerVRDisabled) {
|
||||
auto const context =
|
||||
MockVulkanContextBuilder()
|
||||
@ -231,8 +259,6 @@ TEST(DriverInfoVKTest, AllPowerVRDisabled) {
|
||||
prop->deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
|
||||
})
|
||||
.Build();
|
||||
|
||||
EXPECT_TRUE(context->GetDriverInfo()->IsKnownBadDriver());
|
||||
}
|
||||
|
||||
} // namespace impeller::testing
|
||||
|
Loading…
x
Reference in New Issue
Block a user