aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dadap <ddadap@nvidia.com>2015-09-30 12:09:49 -0500
committerjon <jon@lunarg.com>2015-10-29 14:41:42 -0600
commit6b62285c4a10a337db5eefdfcf659ac201600632 (patch)
tree78bd2b0680abed084a872d6a2edd447b7c3f667a
parent23797aa908c36dab75d7dc83791ec44a39128448 (diff)
downloadusermoji-6b62285c4a10a337db5eefdfcf659ac201600632.tar.xz
loader: set DEFAULT_VK_{DRIVER,LAYER}S_PATH to "" on Linux
When loader_get_fullpath() gets an empty string as the 'dir' parameter, it immediately writes out the original, unexpanded filename. Setting the default drivers and layers paths to an empty string on Linux will allow the unmodified filenames to be passed to dlopen(3) without having to maintain a separate code path for Windows. Now that there is no longer a default path for drivers or layers on Linux, ${CMAKE_INSTALL_LIBDIR} no longer needs to be baked into the loader binary. Note that any ICDs or layers that are currently getting installed to the previous default paths (e.g. /usr/lib/vulkan/icd or /usr/lib/vulkanlayer) will not be discoverable when specified as plain filenames, unless these directories happen to be configured in the loader's search path on the system in question.
-rw-r--r--CMakeLists.txt1
-rw-r--r--loader/vk_loader_platform.h14
2 files changed, 2 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32d75333..112fd571 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,6 @@ endif()
if(NOT WIN32)
include(GNUInstallDirs)
- add_definitions(-DLIBDIR="${CMAKE_INSTALL_LIBDIR}")
add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_SYSCONFDIR}")
add_definitions(-DDATADIR="${CMAKE_INSTALL_DATADIR}")
if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
index ced2fd28..ef5a19f1 100644
--- a/loader/vk_loader_platform.h
+++ b/loader/vk_loader_platform.h
@@ -62,38 +62,28 @@
#define LOCAL_DRIVERS_INFO \
LOCALPREFIX "/" SYSCONFDIR VULKAN_ICDCONF_DIR ":" \
LOCALPREFIX "/" DATADIR VULKAN_ICDCONF_DIR ":"
-#define LOCAL_DRIVERS_PATH \
- LOCALPREFIX "/" LIBDIR VULKAN_ICD_DIR ":"
#define LOCAL_LAYERS_INFO \
LOCALPREFIX "/" SYSCONFDIR VULKAN_ELAYERCONF_DIR ":" \
LOCALPREFIX "/" SYSCONFDIR VULKAN_ILAYERCONF_DIR ":" \
LOCALPREFIX "/" DATADIR VULKAN_ELAYERCONF_DIR ":" \
LOCALPREFIX "/" DATADIR VULKAN_ILAYERCONF_DIR ":"
-#define LOCAL_LAYERS_PATH \
- LOCALPREFIX "/" LIBDIR VULKAN_LAYER_DIR ":"
#else
#define LOCAL_DRIVERS_INFO
-#define LOCAL_DRIVERS_PATH
#define LOCAL_LAYERS_INFO
-#define LOCAL_LAYERS_PATH
#endif
#define DEFAULT_VK_DRIVERS_INFO \
LOCAL_DRIVERS_INFO \
"/" SYSCONFDIR VULKAN_ICDCONF_DIR ":" \
"/usr/" DATADIR VULKAN_ICDCONF_DIR
-#define DEFAULT_VK_DRIVERS_PATH \
- LOCAL_DRIVERS_PATH \
- "/usr/" LIBDIR VULKAN_ICD_DIR
+#define DEFAULT_VK_DRIVERS_PATH ""
#define DEFAULT_VK_LAYERS_INFO \
LOCAL_LAYERS_INFO \
"/" SYSCONFDIR VULKAN_ELAYERCONF_DIR ":" \
"/" SYSCONFDIR VULKAN_ILAYERCONF_DIR ":" \
"/usr/" DATADIR VULKAN_ELAYERCONF_DIR ":" \
"/usr/" DATADIR VULKAN_ILAYERCONF_DIR
-#define DEFAULT_VK_LAYERS_PATH \
- LOCAL_LAYERS_PATH \
- "/usr/" LIBDIR VULKAN_LAYER_DIR
+#define DEFAULT_VK_LAYERS_PATH ""
#define LAYERS_PATH_ENV "VK_LAYER_PATH"
// C99: