Capture early errors on instance creation
authorRicardo Garcia <rgarcia@igalia.com>
Wed, 2 Jun 2021 11:34:48 +0000 (13:34 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 10 Jun 2021 09:15:08 +0000 (09:15 +0000)
commit2363e7a2f2eff615d461416d3811be0c6b253970
tree9a61911de2b7d5751c6cabbe4244c339f1bc6844
parent86db851226223476a9e55bd57208730b25a46783
Capture early errors on instance creation

This commit makes CTS pass a VkDebugReportCallbackCreateInfoEXT
structure in the pNext chain of VkInstanceCreateInfo when creating the
default and other custom instances if validation is enabled from the
command line.

To achieve this, the DebugReportRecorder class has been uncoupled from
the instance and it's no longer responsible of owning the debug report
callback object (VkDebugReportCallbackEXT) that can be created using an
instance. That responsibility now falls into the default device or
custom instance wrapping objects.

This makes it possible to use the DebugReportRecorder in a
VkDebugReportCallbackCreateInfoEXT structure chained when creating
instances before they actually exist, and errors reported during the
instance creation process are handled by the recorder together with
other errors like validation errors.

In addition, the enumerate_devices_alloc_leak test has been modified to
use a custom instance (so it has validation enabled if requested) and
the API tooling info tests have been changed to use the custom instance
creation wrapper function createCustomInstanceFromContext().

Custom instance creation has been improved to detect the lack of
installed validation layers in order to avoid crashes.

Due to these changes affecting the default device and how validation is
enabled when requested, all tests are marked as affected.

Affected tests:
dEQP-VK.*

Components: Vulkan
VK-GL-CTS issue: 2952

Change-Id: I27b78e3cb101142416477ee2460283f917f58a4e
external/vulkancts/framework/vulkan/vkDebugReportUtil.cpp
external/vulkancts/framework/vulkan/vkDebugReportUtil.hpp
external/vulkancts/framework/vulkan/vkDeviceUtil.cpp
external/vulkancts/framework/vulkan/vkDeviceUtil.hpp
external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp
external/vulkancts/modules/vulkan/api/vktApiToolingInfoTests.cpp
external/vulkancts/modules/vulkan/vktCustomInstancesDevices.cpp
external/vulkancts/modules/vulkan/vktCustomInstancesDevices.hpp
external/vulkancts/modules/vulkan/vktTestCase.cpp