Commit b08457df by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Make flushAfterVertexConversion workaround Nexus5X-specific

Workaround added in 611bbaab is likely Nexus5X-specific. This commit detects the phone and enables the workaround only on that. Bug: angleproject:2958, angleproject:3009 Change-Id: I9ab230d4aa690fd92e3d2d84ad98c159128c1093 Reviewed-on: https://chromium-review.googlesource.com/c/1372445Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 64f62f4a
......@@ -25,24 +25,47 @@ enum VendorID : uint32_t
VENDOR_ID_QUALCOMM = 0x5143,
};
inline bool IsAMD(uint32_t vendor_id)
enum AndroidDeviceID : uint32_t
{
return vendor_id == VENDOR_ID_AMD;
ANDROID_DEVICE_ID_UNKNOWN = 0x0,
ANDROID_DEVICE_ID_NEXUS5X = 0x4010800,
ANDROID_DEVICE_ID_PIXEL1XL = 0x5040001,
ANDROID_DEVICE_ID_PIXEL2 = 0x5030004,
};
inline bool IsAMD(uint32_t vendorId)
{
return vendorId == VENDOR_ID_AMD;
}
inline bool IsIntel(uint32_t vendorId)
{
return vendorId == VENDOR_ID_INTEL;
}
inline bool IsNvidia(uint32_t vendorId)
{
return vendorId == VENDOR_ID_NVIDIA;
}
inline bool IsQualcomm(uint32_t vendorId)
{
return vendorId == VENDOR_ID_QUALCOMM;
}
inline bool IsIntel(uint32_t vendor_id)
inline bool IsNexus5X(uint32_t vendorId, uint32_t deviceId)
{
return vendor_id == VENDOR_ID_INTEL;
return IsQualcomm(vendorId) && deviceId == ANDROID_DEVICE_ID_NEXUS5X;
}
inline bool IsNvidia(uint32_t vendor_id)
inline bool IsPixel1XL(uint32_t vendorId, uint32_t deviceId)
{
return vendor_id == VENDOR_ID_NVIDIA;
return IsQualcomm(vendorId) && deviceId == ANDROID_DEVICE_ID_PIXEL1XL;
}
inline bool IsQualcomm(uint32_t vendor_id)
inline bool IsPixel2(uint32_t vendorId, uint32_t deviceId)
{
return vendor_id == VENDOR_ID_QUALCOMM;
return IsQualcomm(vendorId) && deviceId == ANDROID_DEVICE_ID_PIXEL2;
}
const char *GetVendorString(uint32_t vendorId);
......
......@@ -793,10 +793,11 @@ void RendererVk::initFeatures()
}
#if defined(ANGLE_PLATFORM_ANDROID)
// Work around ineffective compute-graphics barrier in android.
// TODO(syoussefi): Figure out which vendors and driver versions are affected.
// http://anglebug.com/3009
mFeatures.flushAfterVertexConversion = true;
// Work around ineffective compute-graphics barriers on Nexus 5X.
// TODO(syoussefi): Figure out which other vendors and driver versions are affected.
// http://anglebug.com/3019
mFeatures.flushAfterVertexConversion =
IsNexus5X(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID);
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment