AHardwareBuffer make the system API dynamic
authorTony Zlatinski <tzlatinski@nvidia.com>
Fri, 25 May 2018 21:57:20 +0000 (16:57 -0500)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 2 Jul 2018 12:01:18 +0000 (08:01 -0400)
commit193a466b20a0c627c97da5bbf2583144c6205153
treede07b74f92703f37c92e1bc1df70b3e271e74cd2
parent6fe64a7c70d556f740b677c4c2a5c70376d241a2
AHardwareBuffer make the system API dynamic

Instead of asserting and crashing the tests, when
the AHardwareBuffer handle is not supported, throw an exception:
"Platform doesn't support Android Hardware Buffer handles"

Move all of the AHB system APIs from implicit to dynamically loaded
and encapsuate those within the AndroidHardwareBufferExternalApi class.
Dynmaically probing and loading the AHB related API allows for run-time
selection of the symbols and to determine if AHB APIs are supported or not.
This, also, allows for the CTS to always be built against NDK API26/28.
After this change, we can make the default NDK API as API26, since
this change would allow for the CTS to work on Android APIs 21-25,
as well as the newer API versions of the NDK.

In addition, moved all of the AHB related interfaces to one place:
vktExternalMemoryUtil.cpp.

Affects:
dEQP-VK.api.external.memory.android_hardware_buffer.*

Components: Vulkan
VK-GL-CTS issue: 1192

Change-Id: I5145eff2fbcf084bfc8ff42751102979f9a28d72
external/vulkancts/modules/vulkan/vktExternalMemoryUtil.cpp
external/vulkancts/modules/vulkan/vktExternalMemoryUtil.hpp