vulkan-loader: 1.0.26.0 -> 1.0.39.1

Changed files
+318 -137
pkgs
development
compilers
libraries
tools
spirv-tools
+3 -3
pkgs/development/compilers/glslang/default.nix
···
stdenv.mkDerivation rec {
name = "glslang-git-${version}";
-
version = "2016-08-26";
# `vulkan-loader` requires a specific version of `glslang` as specified in
# `<vulkan-loader-repo>/glslang_revision`.
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
-
rev = "81cd764b5ffc475bc73f1fb35f75fd1171bb2343";
-
sha256 = "1vfwl6lzkjh9nh29q32b7zca4q1abf3q4nqkahskijgznw5lr59g";
};
patches = [ ./install-headers.patch ];
···
stdenv.mkDerivation rec {
name = "glslang-git-${version}";
+
version = "2016-12-21";
# `vulkan-loader` requires a specific version of `glslang` as specified in
# `<vulkan-loader-repo>/glslang_revision`.
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
+
rev = "807a0d9e2f4e176f75d62ac3c179c81800ec2608";
+
sha256 = "02jckgihqhagm73glipb4c6ri5fr3pnbxb5vrznn2vppyfdfghbj";
};
patches = [ ./install-headers.patch ];
+17 -8
pkgs/development/compilers/glslang/install-headers.patch
···
diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
-
index 48a6c46..593d941 100755
--- a/SPIRV/CMakeLists.txt
+++ b/SPIRV/CMakeLists.txt
-
@@ -42,3 +42,8 @@ endif(WIN32)
install(TARGETS SPIRV SPVRemapper
ARCHIVE DESTINATION lib)
+
-
+foreach(file ${HEADERS} ${SPVREMAP_HEADERS})
-
+ get_filename_component(dir ${file} DIRECTORY)
-
+ install(FILES ${file} DESTINATION include/SPIRV/${dir})
-
+endforeach()
diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
-
index ff91135..4318279 100644
--- a/glslang/CMakeLists.txt
+++ b/glslang/CMakeLists.txt
-
@@ -90,3 +90,8 @@ endif(WIN32)
install(TARGETS glslang
ARCHIVE DESTINATION lib)
···
diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
+
index c538e84..6ece1ab 100755
--- a/SPIRV/CMakeLists.txt
+++ b/SPIRV/CMakeLists.txt
+
@@ -34,8 +34,9 @@ if(ENABLE_AMD_EXTENSIONS)
+
endif(ENABLE_AMD_EXTENSIONS)
+
+
if(ENABLE_NV_EXTENSIONS)
+
- set(HEADERS
+
- GLSL.ext.NV.h)
+
+ list(APPEND
+
+ HEADERS
+
+ GLSL.ext.NV.h)
+
endif(ENABLE_NV_EXTENSIONS)
+
+
add_library(SPIRV STATIC ${SOURCES} ${HEADERS})
+
@@ -51,3 +52,5 @@ endif(WIN32)
install(TARGETS SPIRV SPVRemapper
ARCHIVE DESTINATION lib)
+
+
+install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION include/SPIRV/)
diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
+
index 95d4bdd..e7fda90 100644
--- a/glslang/CMakeLists.txt
+++ b/glslang/CMakeLists.txt
+
@@ -93,3 +93,8 @@ endif(WIN32)
install(TARGETS glslang
ARCHIVE DESTINATION lib)
+9 -17
pkgs/development/libraries/vulkan-loader/default.nix
···
{ stdenv, fetchgit, fetchFromGitHub, cmake, pkgconfig, git, python3,
-
python3Packages, glslang, spirv-tools, x11, libxcb, wayland }:
let
-
version = "1.0.26.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-LoaderAndValidationLayers";
rev = "sdk-${version}";
-
sha256 = "157m746hc76xrxd3qq0f44f5dy7pjbz8cx74ykqrlbc7rmpjpk58";
};
in
···
name = "vulkan-loader-${version}";
inherit version src;
-
prePatch = ''
-
if [ "$(cat '${src}/spirv-tools_revision')" != '${spirv-tools.src.rev}' ] \
-
|| [ "$(cat '${src}/spirv-headers_revision')" != '${spirv-tools.headers.rev}' ] \
-
|| [ "$(cat '${src}/glslang_revision')" != '${glslang.src.rev}' ]
-
then
-
echo "Version mismatch, aborting!"
-
false
-
fi
-
'';
-
buildInputs = [ cmake pkgconfig git python3 python3Packages.lxml
-
glslang spirv-tools x11 libxcb wayland
];
enableParallelBuilding = true;
cmakeFlags = [
-
"-DBUILD_WSI_WAYLAND_SUPPORT=ON" # XLIB/XCB supported by default
];
patches = [ ./use-xdg-paths.patch ];
···
preConfigure = ''
checkRev() {
-
[ "$2" = $(cat "$1_revision") ] || (echo "ERROR: dependency $1 is revision $2 but should be revision" $(cat "$1_revision") && exit 1)
}
checkRev spirv-tools "${spirv-tools.src.rev}"
checkRev spirv-headers "${spirv-tools.headers.rev}"
···
mkdir -p $dev/include
cp -rv ../include $dev/
mkdir -p $demos/bin
-
cp demos/smoketest demos/tri demos/cube demos/*.spv demos/*.ppm $demos/bin
'';
meta = with stdenv.lib; {
···
{ stdenv, fetchgit, fetchFromGitHub, cmake, pkgconfig, git, python3,
+
python3Packages, glslang, spirv-tools, x11, libxcb, libXrandr,
+
libXext, wayland }:
let
+
version = "1.0.39.1";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-LoaderAndValidationLayers";
rev = "sdk-${version}";
+
sha256 = "0y9zzrnjjjza2kkf5jfsdqhn98md6rsq0hb7jg62z2dipzky7zdp";
};
in
···
name = "vulkan-loader-${version}";
inherit version src;
buildInputs = [ cmake pkgconfig git python3 python3Packages.lxml
+
glslang spirv-tools x11 libxcb libXrandr libXext wayland
];
enableParallelBuilding = true;
cmakeFlags = [
+
"-DBUILD_WSI_MIR_SUPPORT=OFF"
];
patches = [ ./use-xdg-paths.patch ];
···
preConfigure = ''
checkRev() {
+
[ "$2" = $(cat "external_revisions/$1_revision") ] || (echo "ERROR: dependency $1 is revision $2 but should be revision" $(cat "external_revisions/$1_revision") && exit 1)
}
checkRev spirv-tools "${spirv-tools.src.rev}"
checkRev spirv-headers "${spirv-tools.headers.rev}"
···
mkdir -p $dev/include
cp -rv ../include $dev/
mkdir -p $demos/bin
+
cp demos/*.spv demos/*.ppm $demos/bin
+
find demos -type f -executable -not -name vulkaninfo -exec cp {} $demos/bin \;
'';
meta = with stdenv.lib; {
+284 -104
pkgs/development/libraries/vulkan-loader/use-xdg-paths.patch
···
diff --git a/loader/loader.c b/loader/loader.c
-
index a950ea1..9462d05 100644
--- a/loader/loader.c
+++ b/loader/loader.c
-
@@ -2671,6 +2671,94 @@ static VkResult loader_get_manifest_files(
-
}
}
+#if !defined(_WIN32)
-
+ if (home_location && override == NULL) {
-
+ char *xdgconfdirs = secure_getenv("XDG_CONFIG_DIRS");
-
+ char *xdgdatadirs = secure_getenv("XDG_DATA_DIRS");
-
+ char *cur, *src = loc;
-
+ size_t src_size = strlen(src), rel_size = strlen(home_location);
-
+ size_t size = 0;
-
+
-
+ if (src_size > 0)
-
+ size += src_size + 1;
-
+
-
+ if (xdgconfdirs == NULL)
+ xdgconfdirs = "/etc/xdg";
-
+ if (xdgdatadirs == NULL)
+ xdgdatadirs = "/usr/local/share:/usr/share";
-
+
-
+ for (char *x = xdgconfdirs; *x; ++x)
-
+ if (*x == PATH_SEPERATOR) size += rel_size;
-
+ size += strlen(xdgconfdirs) + rel_size + 1;
-
+ for (char *x = xdgdatadirs; *x; ++x)
-
+ if (*x == PATH_SEPERATOR) size += rel_size;
-
+ size += strlen(xdgdatadirs) + rel_size + 1;
-
+
-
+#if defined(LOCALPREFIX)
-
+ size += strlen(LOCALPREFIX "/" SYSCONFDIR) + rel_size + 1;
-
+ size += strlen(LOCALPREFIX "/" DATADIR) + rel_size + 1;
+#endif
-
+
-
+ loc = cur = loader_stack_alloc(size);
-
+ if (cur == NULL) {
-
+ loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
-
+ "Out of memory can't get manifest files");
-
+ res = VK_ERROR_OUT_OF_HOST_MEMORY;
-
+ goto out;
-
+ }
+
-
+ if (src_size > 0) {
-
+ memcpy(cur, src, src_size);
-
+ cur += src_size;
-
+ *cur++ = PATH_SEPERATOR;
-
+ }
-
+
-
+ src = xdgconfdirs;
-
+ for (char *x = src;; ++x) {
-
+ if (*x == PATH_SEPERATOR || *x == 0) {
-
+ size_t s = x - src;
-
+ memcpy(cur, src, s); cur += s;
-
+ memcpy(cur, home_location, rel_size); cur += rel_size;
-
+ *cur++ = PATH_SEPERATOR;
+ if (*x == 0)
+ break;
-
+ src = ++x;
+ }
+ }
+
-
+#if defined(LOCALPREFIX)
-
+ strcpy(cur, LOCALPREFIX "/" SYSCONFDIR);
-
+ cur += strlen(cur);
-
+ memcpy(cur, home_location, rel_size); cur += rel_size;
-
+ *cur++ = PATH_SEPERATOR;
+#endif
+
-
+ src = xdgdatadirs;
-
+ for (char *x = src;; ++x) {
-
+ if (*x == PATH_SEPERATOR || *x == 0) {
-
+ size_t s = x - src;
-
+ memcpy(cur, src, s); cur += s;
-
+ memcpy(cur, home_location, rel_size); cur += rel_size;
-
+ *cur++ = PATH_SEPERATOR;
+ if (*x == 0)
+ break;
-
+ src = ++x;
+ }
+ }
-
+
-
+#if defined(LOCALPREFIX)
-
+ strcpy(cur, LOCALPREFIX "/" DATADIR);
-
+ cur += strlen(cur);
-
+ memcpy(cur, home_location, rel_size); cur += rel_size;
-
+ *cur++ = PATH_SEPERATOR;
-
+#endif
-
+
-
+ loc[size - 1] = 0;
-
+ assert(cur == loc + size);
-
+ list_is_dirs = true;
-
+ }
+#endif
+
-
// Print out the paths being searched if debugging is enabled
-
loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0,
-
"Searching the following paths for manifest files: %s\n", loc);
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
-
index 3a02640..70a2652 100644
--- a/loader/vk_loader_platform.h
+++ b/loader/vk_loader_platform.h
-
@@ -57,35 +57,10 @@
#define VULKAN_ILAYERCONF_DIR "implicit_layer.d"
#define VULKAN_LAYER_DIR "layer"
-
-#if defined(LOCALPREFIX)
-
-#define LOCAL_DRIVERS_INFO \
-
- LOCALPREFIX "/" SYSCONFDIR VULKAN_DIR VULKAN_ICDCONF_DIR ":" \
-
- LOCALPREFIX "/" DATADIR VULKAN_DIR VULKAN_ICDCONF_DIR ":"
-
-#define LOCAL_ELAYERS_INFO \
-
- LOCALPREFIX "/" SYSCONFDIR VULKAN_DIR VULKAN_ELAYERCONF_DIR ":" \
-
- LOCALPREFIX "/" DATADIR VULKAN_DIR VULKAN_ELAYERCONF_DIR ":"
-
-#define LOCAL_ILAYERS_INFO \
-
- LOCALPREFIX "/" SYSCONFDIR VULKAN_DIR VULKAN_ILAYERCONF_DIR ":" \
-
- LOCALPREFIX "/" DATADIR VULKAN_DIR VULKAN_ILAYERCONF_DIR ":"
-#else
-
-#define LOCAL_DRIVERS_INFO
-
-#define LOCAL_ELAYERS_INFO
-
-#define LOCAL_ILAYERS_INFO
-#endif
-
-#define DEFAULT_VK_DRIVERS_INFO \
-
- LOCAL_DRIVERS_INFO \
-
- "/" SYSCONFDIR VULKAN_DIR VULKAN_ICDCONF_DIR ":" \
-
- "/usr/" DATADIR VULKAN_DIR VULKAN_ICDCONF_DIR
-
+#define DEFAULT_VK_DRIVERS_INFO ""
-
#define DEFAULT_VK_DRIVERS_PATH ""
-#define DEFAULT_VK_ELAYERS_INFO \
-
- LOCAL_ELAYERS_INFO \
-
- "/" SYSCONFDIR VULKAN_DIR VULKAN_ELAYERCONF_DIR ":" \
-
- "/usr/" DATADIR VULKAN_DIR VULKAN_ELAYERCONF_DIR
-#define DEFAULT_VK_ILAYERS_INFO \
-
- LOCAL_ILAYERS_INFO \
-
- "/" SYSCONFDIR VULKAN_DIR VULKAN_ILAYERCONF_DIR ":" \
-
- "/usr/" DATADIR VULKAN_DIR VULKAN_ILAYERCONF_DIR
+#define DEFAULT_VK_ELAYERS_INFO ""
+#define DEFAULT_VK_ILAYERS_INFO ""
-
#define DEFAULT_VK_LAYERS_PATH ""
-
#if !defined(LAYERS_SOURCE_PATH)
#define LAYERS_SOURCE_PATH NULL
···
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
+
index 27ab6e5..e59256e 100644
+
--- a/CMakeLists.txt
+
+++ b/CMakeLists.txt
+
@@ -256,17 +256,10 @@ if(NOT WIN32)
+
include(GNUInstallDirs)
+
+
add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
+
- add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
+
-
+
# Make sure /etc is searched by the loader
+
- if (NOT (CMAKE_INSTALL_FULL_SYSCONFDIR STREQUAL "/etc"))
+
+ if(NOT (CMAKE_INSTALL_FULL_SYSCONFDIR STREQUAL "/etc"))
+
add_definitions(-DEXTRASYSCONFDIR="/etc")
+
endif()
+
-
+
- # Make sure /usr/share is searched by the loader
+
- if (NOT (CMAKE_INSTALL_FULL_DATADIR STREQUAL "/usr/share"))
+
- add_definitions(-DEXTRADATADIR="/usr/share")
+
- endif()
+
endif()
+
+
if(UNIX)
diff --git a/loader/loader.c b/loader/loader.c
+
index 24758f4..af7cc85 100644
--- a/loader/loader.c
+++ b/loader/loader.c
+
@@ -2909,7 +2909,7 @@ static VkResult
+
loader_get_manifest_files(const struct loader_instance *inst,
+
const char *env_override, const char *source_override,
+
bool is_layer, bool warn_if_not_present,
+
- const char *location, const char *home_location,
+
+ const char *location, const char *relative_location,
+
struct loader_manifest_files *out_files) {
+
const char * override = NULL;
+
char *override_getenv = NULL;
+
@@ -2941,9 +2941,9 @@ loader_get_manifest_files(const struct loader_instance *inst,
}
+
#if !defined(_WIN32)
+
- if (location == NULL && home_location == NULL) {
+
+ if (location == NULL && relative_location == NULL) {
+
#else
+
- home_location = NULL;
+
+ relative_location = NULL;
+
if (location == NULL) {
+
#endif
+
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
+
@@ -2962,16 +2962,89 @@ loader_get_manifest_files(const struct loader_instance *inst,
+
// Make a copy of the input we are using so it is not modified
+
// Also handle getting the location(s) from registry on Windows
+
if (override == NULL) {
+
- loc = loader_stack_alloc(strlen(location) + 1);
+
+ size_t loc_size = strlen(location) + 1;
+#if !defined(_WIN32)
+
+ const char *xdgconfdirs = secure_getenv("XDG_CONFIG_DIRS");
+
+ const char *xdgdatadirs = secure_getenv("XDG_DATA_DIRS");
+
+ if (xdgconfdirs == NULL || xdgconfdirs[0] == '\0')
+ xdgconfdirs = "/etc/xdg";
+
+ if (xdgdatadirs == NULL || xdgdatadirs[0] == '\0')
+ xdgdatadirs = "/usr/local/share:/usr/share";
+
+ const size_t rel_size = strlen(relative_location);
+
+ // Leave space for trailing separators
+
+ loc_size += strlen(xdgconfdirs) + strlen(xdgdatadirs) + 2*rel_size + 2;
+
+ for (const char *x = xdgconfdirs; *x; ++x)
+
+ if (*x == PATH_SEPARATOR) loc_size += rel_size;
+
+ for (const char *x = xdgdatadirs; *x; ++x)
+
+ if (*x == PATH_SEPARATOR) loc_size += rel_size;
+
+ loc_size += strlen(SYSCONFDIR) + rel_size + 1;
+
+#ifdef EXTRASYSCONFDIR
+
+ loc_size += strlen(EXTRASYSCONFDIR) + rel_size + 1;
+#endif
+
+#endif
+
+ loc = loader_stack_alloc(loc_size);
+
if (loc == NULL) {
+
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
+
"loader_get_manifest_files: Failed to allocate "
+
"%d bytes for manifest file location.",
+
- strlen(location));
+
+ loc_size);
+
res = VK_ERROR_OUT_OF_HOST_MEMORY;
+
goto out;
+
}
+
- strcpy(loc, location);
+
+ char *loc_write = loc;
+
+#if !defined(_WIN32)
+
+ const char *loc_read;
+
+
+ loc_read = &xdgconfdirs[0];
+
+ for (const char *x = loc_read;; ++x) {
+
+ if (*x == PATH_SEPARATOR || *x == '\0') {
+
+ const size_t s = x - loc_read;
+
+ memcpy(loc_write, loc_read, s);
+
+ loc_write += s;
+
+ memcpy(loc_write, relative_location, rel_size);
+
+ loc_write += rel_size;
+
+ *loc_write++ = PATH_SEPARATOR;
+ if (*x == 0)
+ break;
+
+ loc_read = ++x;
+ }
+ }
+
+
+ memcpy(loc_write, SYSCONFDIR, strlen(SYSCONFDIR));
+
+ loc_write += strlen(SYSCONFDIR);
+
+ memcpy(loc_write, relative_location, rel_size);
+
+ loc_write += rel_size;
+
+ *loc_write++ = PATH_SEPARATOR;
+
+
+
+#ifdef EXTRASYSCONFDIR
+
+ memcpy(loc_write, EXTRASYSCONFDIR, strlen(EXTRASYSCONFDIR));
+
+ loc_write += strlen(EXTRASYSCONFDIR);
+
+ memcpy(loc_write, relative_location, rel_size);
+
+ loc_write += rel_size;
+
+ *loc_write++ = PATH_SEPARATOR;
+#endif
+
+
+ loc_read = &xdgdatadirs[0];
+
+ for (const char *x = loc_read;; ++x) {
+
+ if (*x == PATH_SEPARATOR || *x == '\0') {
+
+ const size_t s = x - loc_read;
+
+ memcpy(loc_write, loc_read, s);
+
+ loc_write += s;
+
+ memcpy(loc_write, relative_location, rel_size);
+
+ loc_write += rel_size;
+
+ *loc_write++ = PATH_SEPARATOR;
+ if (*x == 0)
+ break;
+
+ loc_read = ++x;
+ }
+ }
+
+ --loc_write;
+
+ *loc_write = '\0';
+
+#else
+
+ memcpy(loc_write, location, loc_size);
+
+ loc[loc_size-1] = '\0';
+#endif
+
+
#if defined(_WIN32)
+
VkResult reg_result = loaderGetRegistryFiles(inst, loc, &reg);
+
if (VK_SUCCESS != reg_result || NULL == reg) {
+
@@ -3122,14 +3195,14 @@ loader_get_manifest_files(const struct loader_instance *inst,
+
}
+
file = next_file;
+
#if !defined(_WIN32)
+
- if (home_location != NULL &&
+
+ if (relative_location != NULL &&
+
(next_file == NULL || *next_file == '\0') && override == NULL) {
+
char *xdgdatahome = secure_getenv("XDG_DATA_HOME");
+
size_t len;
+
if (xdgdatahome != NULL) {
+
+
char *home_loc = loader_stack_alloc(strlen(xdgdatahome) + 2 +
+
- strlen(home_location));
+
+ strlen(relative_location));
+
if (home_loc == NULL) {
+
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
+
"loader_get_manifest_files: Failed to allocate "
+
@@ -3139,15 +3212,15 @@ loader_get_manifest_files(const struct loader_instance *inst,
+
}
+
strcpy(home_loc, xdgdatahome);
+
// Add directory separator if needed
+
- if (home_location[0] != DIRECTORY_SYMBOL) {
+
+ if (relative_location[0] != DIRECTORY_SYMBOL) {
+
len = strlen(home_loc);
+
home_loc[len] = DIRECTORY_SYMBOL;
+
home_loc[len + 1] = '\0';
+
}
+
- strcat(home_loc, home_location);
+
+ strcat(home_loc, relative_location);
+
file = home_loc;
+
next_file = loader_get_next_path(file);
+
- home_location = NULL;
+
+ relative_location = NULL;
+
+
loader_log(
+
inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0,
+
@@ -3160,7 +3233,7 @@ loader_get_manifest_files(const struct loader_instance *inst,
+
char *home = secure_getenv("HOME");
+
if (home != NULL) {
+
char *home_loc = loader_stack_alloc(strlen(home) + 16 +
+
- strlen(home_location));
+
+ strlen(relative_location));
+
if (home_loc == NULL) {
+
loader_log(
+
inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
+
@@ -3178,15 +3251,15 @@ loader_get_manifest_files(const struct loader_instance *inst,
+
}
+
strcat(home_loc, ".local/share");
+
+
- if (home_location[0] != DIRECTORY_SYMBOL) {
+
+ if (relative_location[0] != DIRECTORY_SYMBOL) {
+
len = strlen(home_loc);
+
home_loc[len] = DIRECTORY_SYMBOL;
+
home_loc[len + 1] = '\0';
+
}
+
- strcat(home_loc, home_location);
+
+ strcat(home_loc, relative_location);
+
file = home_loc;
+
next_file = loader_get_next_path(file);
+
- home_location = NULL;
+
+ relative_location = NULL;
+
+
loader_log(
+
inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0,
+
@@ -3263,7 +3336,7 @@ VkResult loader_icd_scan(const struct loader_instance *inst,
+
// Get a list of manifest files for ICDs
+
res = loader_get_manifest_files(inst, "VK_ICD_FILENAMES", NULL, false, true,
+
DEFAULT_VK_DRIVERS_INFO,
+
- HOME_VK_DRIVERS_INFO, &manifest_files);
+
+ RELATIVE_VK_DRIVERS_INFO, &manifest_files);
+
if (VK_SUCCESS != res || manifest_files.count == 0) {
+
goto out;
+
}
+
@@ -3490,7 +3563,7 @@ void loader_layer_scan(const struct loader_instance *inst,
+
if (VK_SUCCESS !=
+
loader_get_manifest_files(inst, LAYERS_PATH_ENV, LAYERS_SOURCE_PATH,
+
true, true, DEFAULT_VK_ELAYERS_INFO,
+
- HOME_VK_ELAYERS_INFO, &manifest_files[0])) {
+
+ RELATIVE_VK_ELAYERS_INFO, &manifest_files[0])) {
+
goto out;
+
}
+
+
@@ -3499,7 +3572,7 @@ void loader_layer_scan(const struct loader_instance *inst,
+
// overridden by LAYERS_PATH_ENV
+
if (VK_SUCCESS != loader_get_manifest_files(inst, NULL, NULL, true, false,
+
DEFAULT_VK_ILAYERS_INFO,
+
- HOME_VK_ILAYERS_INFO,
+
+ RELATIVE_VK_ILAYERS_INFO,
+
&manifest_files[1])) {
+
goto out;
+
}
+
@@ -3569,7 +3642,7 @@ void loader_implicit_layer_scan(const struct loader_instance *inst,
+
// overridden by LAYERS_PATH_ENV
+
VkResult res = loader_get_manifest_files(
+
inst, NULL, NULL, true, false, DEFAULT_VK_ILAYERS_INFO,
+
- HOME_VK_ILAYERS_INFO, &manifest_files);
+
+ RELATIVE_VK_ILAYERS_INFO, &manifest_files);
+
if (VK_SUCCESS != res || manifest_files.count == 0) {
+
return;
+
}
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
+
index dc4ac10..50a7966 100644
--- a/loader/vk_loader_platform.h
+++ b/loader/vk_loader_platform.h
+
@@ -57,47 +57,9 @@
#define VULKAN_ILAYERCONF_DIR "implicit_layer.d"
#define VULKAN_LAYER_DIR "layer"
+
-#if defined(EXTRASYSCONFDIR)
+
-#define EXTRA_DRIVERS_SYSCONFDIR_INFO ":" \
+
- EXTRASYSCONFDIR VULKAN_DIR VULKAN_ICDCONF_DIR
+
-#define EXTRA_ELAYERS_SYSCONFDIR_INFO ":" \
+
- EXTRASYSCONFDIR VULKAN_DIR VULKAN_ELAYERCONF_DIR
+
-#define EXTRA_ILAYERS_SYSCONFDIR_INFO ":" \
+
- EXTRASYSCONFDIR VULKAN_DIR VULKAN_ILAYERCONF_DIR
+
-#else
+
-#define EXTRA_DRIVERS_SYSCONFDIR_INFO
+
-#define EXTRA_ELAYERS_SYSCONFDIR_INFO
+
-#define EXTRA_ILAYERS_SYSCONFDIR_INFO
+
-#endif
+
-
+
-#if defined(EXTRADATADIR)
+
-#define EXTRA_DRIVERS_DATADIR_INFO ":" \
+
- EXTRADATADIR VULKAN_DIR VULKAN_ICDCONF_DIR
+
-#define EXTRA_ELAYERS_DATADIR_INFO ":" \
+
- EXTRADATADIR VULKAN_DIR VULKAN_ELAYERCONF_DIR
+
-#define EXTRA_ILAYERS_DATADIR_INFO ":" \
+
- EXTRADATADIR VULKAN_DIR VULKAN_ILAYERCONF_DIR
-#else
+
-#define EXTRA_DRIVERS_DATADIR_INFO
+
-#define EXTRA_ELAYERS_DATADIR_INFO
+
-#define EXTRA_ILAYERS_DATADIR_INFO
-#endif
-
-#define DEFAULT_VK_DRIVERS_INFO \
+
- SYSCONFDIR VULKAN_DIR VULKAN_ICDCONF_DIR ":" \
+
- DATADIR VULKAN_DIR VULKAN_ICDCONF_DIR \
+
- EXTRA_DRIVERS_SYSCONFDIR_INFO \
+
- EXTRA_DRIVERS_DATADIR_INFO
-#define DEFAULT_VK_ELAYERS_INFO \
+
- SYSCONFDIR VULKAN_DIR VULKAN_ELAYERCONF_DIR ":" \
+
- DATADIR VULKAN_DIR VULKAN_ELAYERCONF_DIR \
+
- EXTRA_ELAYERS_SYSCONFDIR_INFO \
+
- EXTRA_ELAYERS_DATADIR_INFO
-#define DEFAULT_VK_ILAYERS_INFO \
+
- SYSCONFDIR VULKAN_DIR VULKAN_ILAYERCONF_DIR ":" \
+
- DATADIR VULKAN_DIR VULKAN_ILAYERCONF_DIR \
+
- EXTRA_ILAYERS_SYSCONFDIR_INFO \
+
- EXTRA_ILAYERS_DATADIR_INFO
+
+#define DEFAULT_VK_DRIVERS_INFO ""
+#define DEFAULT_VK_ELAYERS_INFO ""
+#define DEFAULT_VK_ILAYERS_INFO ""
+
+
#define DEFAULT_VK_DRIVERS_PATH ""
+
#if !defined(DEFAULT_VK_LAYERS_PATH)
+
@@ -109,9 +71,9 @@
+
#endif
+
#define LAYERS_PATH_ENV "VK_LAYER_PATH"
+
+
-#define HOME_VK_DRIVERS_INFO VULKAN_DIR VULKAN_ICDCONF_DIR
+
-#define HOME_VK_ELAYERS_INFO VULKAN_DIR VULKAN_ELAYERCONF_DIR
+
-#define HOME_VK_ILAYERS_INFO VULKAN_DIR VULKAN_ILAYERCONF_DIR
+
+#define RELATIVE_VK_DRIVERS_INFO VULKAN_DIR VULKAN_ICDCONF_DIR
+
+#define RELATIVE_VK_ELAYERS_INFO VULKAN_DIR VULKAN_ELAYERCONF_DIR
+
+#define RELATIVE_VK_ILAYERS_INFO VULKAN_DIR VULKAN_ILAYERCONF_DIR
+
+
// C99:
+
#define PRINTF_SIZE_T_SPECIFIER "%zu"
+
@@ -251,9 +213,9 @@ loader_platform_thread_cond_broadcast(loader_platform_thread_cond *pCond) {
#define LAYERS_SOURCE_PATH NULL
+
#endif
+
#define LAYERS_PATH_ENV "VK_LAYER_PATH"
+
-#define HOME_VK_DRIVERS_INFO ""
+
-#define HOME_VK_ELAYERS_INFO ""
+
-#define HOME_VK_ILAYERS_INFO ""
+
+#define RELATIVE_VK_DRIVERS_INFO ""
+
+#define RELATIVE_VK_ELAYERS_INFO ""
+
+#define RELATIVE_VK_ILAYERS_INFO ""
+
#define PRINTF_SIZE_T_SPECIFIER "%Iu"
+
+
// File IO
+5 -5
pkgs/development/tools/spirv-tools/default.nix
···
tools = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Tools";
-
rev = "923a4596b44831a07060df45caacb522613730c9";
-
sha256 = "0hmgng2sv34amfsag3ya09prnv1w535djwlzfn8h2vh430vgawxa";
};
headers = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Headers";
-
rev = "33d41376d378761ed3a4c791fc4b647761897f26";
-
sha256 = "1s103bpi3g6hhq453qa4jbabfkyxxpf9vn213j8k4vm26lsi8hs2";
};
};
···
stdenv.mkDerivation rec {
name = "spirv-tools-${version}";
-
version = "2016-07-18";
src = spirv_sources.tools;
patchPhase = ''ln -sv ${spirv_sources.headers} external/spirv-headers'';
···
tools = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Tools";
+
rev = "37422e9dba1a3a8cb8028b779dd546d43add6ef8";
+
sha256 = "0sp2p4wg902clq0fr94vj19vyv43cq333jjxr0mjzay8dw2h4yzk";
};
headers = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Headers";
+
rev = "c470b68225a04965bf87d35e143ae92f831e8110";
+
sha256 = "18jgcpmm0ixp6314r5w144l3wayxjkmwqgx8dk5jgyw36dammkwd";
};
};
···
stdenv.mkDerivation rec {
name = "spirv-tools-${version}";
+
version = "2016-12-19";
src = spirv_sources.tools;
patchPhase = ''ln -sv ${spirv_sources.headers} external/spirv-headers'';