GGP: Check and enable VK_GGP_frame_token

Bug: angleproject:4668
Change-Id: I9ecbdf37e206cb6eb93699091bbff70ad898040f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219032
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Ethan Lee 2020-05-27 16:23:57 -04:00 коммит произвёл Commit Bot
Родитель 2383f3449e
Коммит 209cf8fa40
3 изменённых файлов: 24 добавлений и 1 удалений

Просмотреть файл

@ -108,6 +108,12 @@ struct FeaturesVk : FeatureSetBase
"VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer extension",
&members};
// Whether the VkDevice supports the VK_GGP_frame_token extension, on which
// the EGL_ANGLE_swap_with_frame_token extension can be layered.
Feature supportsGGPFrameToken = {"supports_ggp_frame_token", FeatureCategory::VulkanFeatures,
"VkDevice supports the VK_GGP_frame_token extension",
&members};
// Whether the VkDevice supports the VK_KHR_external_memory_fd extension, on which the
// GL_EXT_memory_object_fd extension can be layered.
Feature supportsExternalMemoryFd = {

Просмотреть файл

@ -228,7 +228,7 @@ void DisplayVk::generateExtensions(egl::DisplayExtensions *outExtensions) const
#if defined(ANGLE_PLATFORM_GGP)
outExtensions->ggpStreamDescriptor = true;
outExtensions->swapWithFrameToken = true;
outExtensions->swapWithFrameToken = getRenderer()->getFeatures().supportsGGPFrameToken.enabled;
#endif // defined(ANGLE_PLATFORM_GGP)
}

Просмотреть файл

@ -1095,6 +1095,17 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF
ASSERT(!getFeatures().supportsAndroidHardwareBuffer.enabled);
#endif
#if defined(ANGLE_PLATFORM_GGP)
if (getFeatures().supportsGGPFrameToken.enabled)
{
enabledDeviceExtensions.push_back(VK_GGP_FRAME_TOKEN_EXTENSION_NAME);
}
ANGLE_VK_CHECK(displayVk, getFeatures().supportsGGPFrameToken.enabled,
VK_ERROR_EXTENSION_NOT_PRESENT);
#else
ASSERT(!getFeatures().supportsGGPFrameToken.enabled);
#endif
if (getFeatures().supportsAndroidHardwareBuffer.enabled ||
getFeatures().supportsExternalMemoryFd.enabled ||
getFeatures().supportsExternalMemoryFuchsia.enabled)
@ -1597,6 +1608,12 @@ void RendererVk::initFeatures(DisplayVk *displayVk, const ExtensionNameList &dev
ExtensionFound(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, deviceExtensionNames));
#endif
#if defined(ANGLE_PLATFORM_GGP)
ANGLE_FEATURE_CONDITION(
&mFeatures, supportsGGPFrameToken,
ExtensionFound(VK_GGP_FRAME_TOKEN_EXTENSION_NAME, deviceExtensionNames));
#endif
ANGLE_FEATURE_CONDITION(
&mFeatures, supportsExternalMemoryFd,
ExtensionFound(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, deviceExtensionNames));