class VkDebugUtilsMessageCollector

Defined at line 26 of file ../../src/ui/lib/escher/test/common/vk/vk_debug_utils_message_collector.h

Collects Vulkan debug reports and provides functions used by validation debug report checking

macros.

A test fixture which has an instance of |VkDebugUtilsMessengerCallbackRegistry| and

|VkDebugUtilsMessageCollector| will be able to store all validation debug reports by setting

|HandleDebugUtilsMessage| with |pUserData| pointing to this instance, as its callback function.

NOTE: Users may want to use the test fixture class |TestWithVkValidationLayer| directly if they

only need the basic unit tests with Vulkan validation layer enabled.

Public Methods

uint32_t HandleDebugUtilsMessage (VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, VkDebugUtilsMessageTypeFlagsEXT message_types, const VkDebugUtilsMessengerCallbackDataEXT * callback_data, void * user_data)

Default Validation layer debug handler which stores all debug reports to the

std::vector

<VkDebugUtilsMessage

> object which |pUserData|points to.

The callback function is specified in

https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/

PFN_vkDebugUtilsMessengerEXT.html

Defined at line 12 of file ../../src/ui/lib/escher/test/common/vk/vk_debug_utils_message_collector.cc

bool PrintDebugUtilsMessagesWithFlags (const vk::DebugUtilsMessageSeverityFlagsEXT & severity, const vk::DebugUtilsMessageTypeFlagsEXT & types, const char * file, size_t line)

Print all debug reports with given flags. If there is no debug reports with that given flags

it will do nothing and return false; otherwise it returns true.

|file| and |line| are passed by macros using __FILE__ and __LINE__ to print error position.

Defined at line 35 of file ../../src/ui/lib/escher/test/common/vk/vk_debug_utils_message_collector.cc

void VkDebugUtilsMessageCollector ()

Default constructor.

Defined at line 47 of file ../../src/ui/lib/escher/test/common/vk/vk_debug_utils_message_collector.h

bool PrintDebugUtilsMessagesOnFalsePredicate (const vk::DebugUtilsMessageSeverityFlagsEXT & severity, const vk::DebugUtilsMessageTypeFlagsEXT & types, size_t num_threshold, const std::function<bool (size_t, size_t)> & predicate, const char * file, size_t line)

Helper function which prints out the debug reports if

|predicate|(number of debug reports with |flags|, |num_threshold|) == false.

|file| and |line| are passed by macros using __FILE__ and __LINE__ to print error position.

Used only by |EXPECT/ASSERT_VULKAN_VALIDATION_LAYER_ERRORS_[PREDICATE]()| macros and should

only be called within test scope.

Defined at line 47 of file ../../src/ui/lib/escher/test/common/vk/vk_debug_utils_message_collector.cc

void RemoveDebugUtilsMessagesWithFlag (const vk::DebugUtilsMessageSeverityFlagsEXT & severity, const vk::DebugUtilsMessageTypeFlagsEXT & types)

Removes debug reports with certain debug report flag from |debug_utils_messages_| list to

suppress test failure.

Used by REMOVE_VK_VALIDATION_[WARNINGS/ERRORS/PERFORMANCE_WARNINGS]() macros and should

only be called within test scope..

Defined at line 76 of file ../../src/ui/lib/escher/test/common/vk/vk_debug_utils_message_collector.cc

void RemoveAllDebugUtilsMessages ()

Removes all debug reports from |debug_utils_messages_| list to suppress test failure.

Used by REMOVE_VK_VALIDATION_DEBUG_UTILS_MESSAGES() macro and should only be called within

test scope.

Defined at line 88 of file ../../src/ui/lib/escher/test/common/vk/vk_debug_utils_message_collector.h

Records