Keep allocated debug callbacks until destroy instance
authorCharles Giessen <charles@lunarg.com>
Tue, 24 May 2022 23:30:23 +0000 (17:30 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 27 May 2022 23:14:25 +0000 (17:14 -0600)
commite52b98e356590627fd87f167d767bdbd5c962fdb
treedfdefca61a49cae4685ca4213293d2db27bc1b50
parentb1478c3e731c4793ddd2d56c606f5e7aaf94b909
Keep allocated debug callbacks until destroy instance

Previously the loader would destroy any debug callbacks created during instance creation
to later create new ones during instance destruction. This required a memory allocation
to occur inside vkDestroyInstance, which can cause leaks if an OOM occurs during
instance destruction.

This commit simplifies the logic by keeping around the allocations made during instance
creation by moving them into their own debug node chain. Then during instance destruction
moves them back.

Also renames several functions to better describe their intended purpose.
loader/debug_utils.c
loader/debug_utils.h
loader/gpa_helper.c
loader/loader.c
loader/loader_common.h
loader/trampoline.c
tests/loader_debug_ext_tests.cpp