From a6ca07464e112120fee83e5766973a12ee611f00 Mon Sep 17 00:00:00 2001 From: Yuxiang Qian Date: Fri, 30 Apr 2021 03:22:04 +0000 Subject: [PATCH] Fix crash issue when AHB extension is not supported The Ahb test doesn't check if the vulkan extension VK_ANDROID_external_memory_android_hardware_buffer is supported and called AHB function directly, then it crashes when the extension is not supported. This patch will let the test first check if this extension is supported. Affects: dEQP-VK.draw.ahb.* Components: Vulkan VK-GL-CTS issue: 2915 Change-Id: Id470caef3e034f10d08cfa3bad6e9ec705104b53 --- external/vulkancts/modules/vulkan/draw/vktDrawAhbTests.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawAhbTests.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawAhbTests.cpp index adcb344..47752a3 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawAhbTests.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawAhbTests.cpp @@ -315,6 +315,8 @@ tcu::TestStatus AhbTestInstance::iterate (void) if (!ahbApi) TCU_THROW(NotSupportedError, "Android Hardware Buffer not supported"); + m_context.requireDeviceFunctionality("VK_ANDROID_external_memory_android_hardware_buffer"); + deUint64 requiredAhbUsage = ahbApi->vkUsageToAhbUsage(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); pt::AndroidHardwareBufferPtr ahb = ahbApi->allocate(WIDTH, HEIGHT, targetImageCreateInfo.arrayLayers, ahbApi->vkFormatToAhbFormat(colorAttachmentFormat), requiredAhbUsage); -- 2.7.4