Fix crash issue when AHB extension is not supported
authorYuxiang Qian <yuxiang.qian@arm.com>
Fri, 30 Apr 2021 03:22:04 +0000 (03:22 +0000)
committerYuxiang Qian <yuxiang.qian@arm.com>
Sat, 8 May 2021 03:13:54 +0000 (03:13 +0000)
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

index adcb344..47752a3 100644 (file)
@@ -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);