loader: Do not remove duplicated layers
authorLudovico de Nittis <ludovico.denittis@collabora.com>
Tue, 1 Dec 2020 16:03:03 +0000 (17:03 +0100)
committerLenny Komow <lenny@lunarg.com>
Mon, 18 Jan 2021 09:03:20 +0000 (02:03 -0700)
commitaed40d52837dba3850a27c61529de6fa25979d19
tree0a29da49da4cb9ce2d61752c50b1075369e5c025
parent9ba835885ffe6007c2e6d40c216a087fdd495d0e
loader: Do not remove duplicated layers

Linux can support multiple ABIs, but Vulkan Layer manifest does not
allow to specify different library paths, based on the ABI.

As a solution, for ICDs, we can simply create multiple manifests, one
per ABI, and the Loader will try them one by one until it finds the
library that is compatible with the executable class.

Instead, for Vulkan Layers, this method doesn't work because the Loader
will discard the manifests that have a duplicated layer name.

To add support for multiple ABIs to Vulkan Layers, and to make the
behavior similar to the ICDs, with this commit we remove the duplicated
layer name check.
Instead we add to the output list all the Vulkan Layers that we find,
and only when we are actually going to dlopen them, we discard the
layers with the same name that we already successfully opened.

Fixes: #155

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
loader/loader.c