Commit dbbdf563 by Yuly Novikov Committed by Commit Bot

Require VK_EXT_queue_family_foreign for EGL_ANDROID_image_native_buffer support

Even though VK_EXT_queue_family_foreign is required by VK_ANDROID_external_memory_android_hardware_buffer, Pixel 2 PQ2A.190205.002 supports the latter but not the former. Also print the names of unsupported extensions to ease debugging in the future. Bug: angleproject:3121, chromium:857138 Change-Id: Ib1195153cfb74f079a93ee9ce93b9b78e6f6e00a Reviewed-on: https://chromium-review.googlesource.com/c/1493114Reviewed-by: 's avatarJamie Madill <jmadill@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 5de69e91
...@@ -79,21 +79,30 @@ bool StrLess(const char *a, const char *b) ...@@ -79,21 +79,30 @@ bool StrLess(const char *a, const char *b)
return strcmp(a, b) < 0; return strcmp(a, b) < 0;
} }
VkResult VerifyExtensionsPresent(const RendererVk::ExtensionNameList &haystack,
const RendererVk::ExtensionNameList &needles)
{
// NOTE: The lists must be sorted.
return std::includes(haystack.begin(), haystack.end(), needles.begin(), needles.end(), StrLess)
? VK_SUCCESS
: VK_ERROR_EXTENSION_NOT_PRESENT;
}
bool ExtensionFound(const char *needle, const RendererVk::ExtensionNameList &haystack) bool ExtensionFound(const char *needle, const RendererVk::ExtensionNameList &haystack)
{ {
// NOTE: The list must be sorted. // NOTE: The list must be sorted.
return std::binary_search(haystack.begin(), haystack.end(), needle, StrLess); return std::binary_search(haystack.begin(), haystack.end(), needle, StrLess);
} }
VkResult VerifyExtensionsPresent(const RendererVk::ExtensionNameList &haystack,
const RendererVk::ExtensionNameList &needles)
{
// NOTE: The lists must be sorted.
if (std::includes(haystack.begin(), haystack.end(), needles.begin(), needles.end(), StrLess))
{
return VK_SUCCESS;
}
for (const char *needle : needles)
{
if (!ExtensionFound(needle, haystack))
{
ERR() << "Extension not supported: " << needle;
}
}
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
// Array of Validation error/warning messages that will be ignored, should include bugID // Array of Validation error/warning messages that will be ignored, should include bugID
constexpr const char *kSkippedMessages[] = { constexpr const char *kSkippedMessages[] = {
// http://anglebug.com/2866 // http://anglebug.com/2866
...@@ -1199,8 +1208,10 @@ void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames) ...@@ -1199,8 +1208,10 @@ void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames)
} }
#if defined(ANGLE_PLATFORM_ANDROID) #if defined(ANGLE_PLATFORM_ANDROID)
mFeatures.supportsAndroidHardwareBuffer = ExtensionFound( mFeatures.supportsAndroidHardwareBuffer =
VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME, deviceExtensionNames); ExtensionFound(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME,
deviceExtensionNames) &&
ExtensionFound(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, deviceExtensionNames);
#endif #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