loader: Remove trampoline/terminator dependency in vkEnumeratePhysicalDevices
authorPiers Daniell <pdaniell@nvidia.com>
Tue, 29 Mar 2016 17:51:11 +0000 (11:51 -0600)
committerJon Ashburn <jon@lunarg.com>
Fri, 1 Apr 2016 17:24:31 +0000 (11:24 -0600)
commit8bc0c51ef3c01a3964f3bcf16ef639aaedf259f7
tree0d5886ba11f8ded12654d170647a0a56b79845ee
parent62cef16bdf6155f136202daae711a80a1deb0351
loader: Remove trampoline/terminator dependency in vkEnumeratePhysicalDevices

There was a dependency between the trampoline vkEnumeratePhysicalDevices
and the terminator vkEnumeratePhysicalDevices via the
loader_instance.phys_devs_term array which may break layers that
manipulate the enumerated VkPhysicalDevice list. This dependency assumed
the devices in loader_instance.phys_devs_term and
loader_instance.phys_devs were in the same order and that it could
assume the index of one corresponding to the same VkPhysicalDevice of
the other.

Breaking this dependency allows layers to modify or reorder the
VkPhysicalDevice list by intercepting the vkEnumeratePhysicalDevices
function without causing the loader to crash. In general, there should
never be a dependency between the trampoline code and the terminator
code because it has the potential to break unknown layers between them.

Conflicts:
loader/loader.c
loader/trampoline.c

Change-Id: Iafefd6e8b7dd58d398a76533f957123242c01b56
loader/loader.c
loader/loader.h
loader/trampoline.c