mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-18 00:49:52 +00:00
vulkan-validation-layers: 1.2.162.0 → 1.2.176.0
This commit is contained in:
parent
16f50144f4
commit
3fd04aa807
|
@ -1,31 +1,29 @@
|
|||
{ lib, stdenv
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, writeText
|
||||
, python3
|
||||
, glslang
|
||||
, libX11
|
||||
, libxcb
|
||||
, libXrandr
|
||||
, spirv-headers
|
||||
, spirv-tools
|
||||
, vulkan-headers
|
||||
, vulkan-loader
|
||||
, glslang
|
||||
, pkg-config
|
||||
, xlibsWrapper
|
||||
, libxcb
|
||||
, libXrandr
|
||||
, wayland
|
||||
}:
|
||||
# vulkan-validation-layers requires a custom glslang version, while glslang requires
|
||||
# custom versions for spirv-tools and spirv-headers. The git hashes required for all
|
||||
# of these deps is documented upstream here:
|
||||
# https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/scripts/known_good.json
|
||||
|
||||
let
|
||||
# vulkan-validation-layers requires a custom glslang & robin-hood-hashing
|
||||
# version, while glslang requires custom versions for spirv-tools and spirv-headers.
|
||||
#
|
||||
# The git hashes required for all of these deps is documented upstream here:
|
||||
# https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/scripts/known_good.json
|
||||
localSpirvHeaders = spirv-headers.overrideAttrs (_: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "KhronosGroup";
|
||||
repo = "SPIRV-Headers";
|
||||
rev = "f027d53ded7e230e008d37c8b47ede7cd308e19d";
|
||||
sha256 = "12gp2mqcar6jj57jw9isfr62yn72kmvdcl0zga4gvrlyfhnf582q";
|
||||
rev = "75b30a659c8a4979104986652c54cc421fc51129";
|
||||
sha256 = "1yzdp3m50zxabkg93j1lmazs45wjp20szvxiv8ifgcdjxmyzi5ji";
|
||||
};
|
||||
});
|
||||
localGlslang = (glslang.override {
|
||||
|
@ -33,8 +31,8 @@ let
|
|||
src = fetchFromGitHub {
|
||||
owner = "KhronosGroup";
|
||||
repo = "SPIRV-Tools";
|
||||
rev = "c9c1f54330d13a0bec1aa3f08d436249d8e35596";
|
||||
sha256 = "0r5whsw9x8j4199xwxv293ar2ga73pm2s7rngw732ylh6rw3bkly";
|
||||
rev = "c79edd260c2b503f0eca57310057b4a100999cc5";
|
||||
sha256 = "01qq5g2a8c5ljn1j6yqh3v90kbhavibh45dcnasixvpf5q7k2ary";
|
||||
};
|
||||
});
|
||||
argSpirv-headers = localSpirvHeaders;
|
||||
|
@ -42,15 +40,20 @@ let
|
|||
src = fetchFromGitHub {
|
||||
owner = "KhronosGroup";
|
||||
repo = "glslang";
|
||||
rev = "dd69df7f3dac26362e10b0f38efb9e47990f7537";
|
||||
sha256 = "1iafbh524avsjg4pjiq156b62pck2rwlfl2pjnml8sjy285506rk";
|
||||
rev = "e56beaee736863ce48455955158f1839e6e4c1a1";
|
||||
sha256 = "062v3zq88dvgpy3xlb86lj4skk9472jh7hv835d8gs8zbyy0s3aw";
|
||||
};
|
||||
});
|
||||
robin-hood-hashing = fetchFromGitHub {
|
||||
owner = "martinus";
|
||||
repo = "robin-hood-hashing";
|
||||
rev = "eee46f9985c3c65a05b35660c6866f8f8f1a3ba3";
|
||||
sha256 = "0h2ljqxnc1gr3p3iqk627n65c7pixpzxhd9vaybr24f90f069lmw";
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "vulkan-validation-layers";
|
||||
version = "1.2.162.0";
|
||||
version = "1.2.176.0";
|
||||
|
||||
# If we were to use "dev" here instead of headers, the setupHook would be
|
||||
# placed in that output instead of "out".
|
||||
|
@ -61,36 +64,39 @@ stdenv.mkDerivation rec {
|
|||
owner = "KhronosGroup";
|
||||
repo = "Vulkan-ValidationLayers";
|
||||
rev = "sdk-${version}";
|
||||
sha256 = "1mpqmxh9zm20jdar59lp4yjpqfzxn2pwds6bkvnzihfy0pymf15k";
|
||||
sha256 = "1mp110a686lwl6wfplg79vwnlrvbz2pd5mjkgyg9i3jyfs65lr33";
|
||||
};
|
||||
|
||||
# Include absolute paths to layer libraries in their associated
|
||||
# layer definition json files.
|
||||
postPatch = ''
|
||||
sed "s|\([[:space:]]*set(INSTALL_DEFINES \''${INSTALL_DEFINES} -DRELATIVE_LAYER_BINARY=\"\)\(\$<TARGET_FILE_NAME:\''${TARGET_NAME}>\")\)|\1$out/lib/\2|" -i layers/CMakeLists.txt
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
cmake
|
||||
python3
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
localGlslang
|
||||
localGlslang.spirv-headers
|
||||
vulkan-headers
|
||||
vulkan-loader
|
||||
libX11
|
||||
libxcb
|
||||
libXrandr
|
||||
vulkan-headers
|
||||
wayland
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DGLSLANG_INSTALL_DIR=${localGlslang}"
|
||||
"-DSPIRV_HEADERS_INSTALL_DIR=${localSpirvHeaders}"
|
||||
"-DROBIN_HOOD_HASHING_INSTALL_DIR=${robin-hood-hashing}"
|
||||
"-DBUILD_LAYER_SUPPORT_FILES=ON"
|
||||
# Hide dev warnings that are useless for packaging
|
||||
"-Wno-dev"
|
||||
];
|
||||
|
||||
# Include absolute paths to layer libraries in their associated
|
||||
# layer definition json files.
|
||||
patchPhase = ''
|
||||
sed "s|\([[:space:]]*set(INSTALL_DEFINES \''${INSTALL_DEFINES} -DRELATIVE_LAYER_BINARY=\"\)\(\$<TARGET_FILE_NAME:\''${TARGET_NAME}>\")\)|\1$out/lib/\2|" -i layers/CMakeLists.txt
|
||||
'';
|
||||
# Tests require access to vulkan-compatible GPU, which isn't
|
||||
# available in Nix sandbox. Fails with VK_ERROR_INCOMPATIBLE_DRIVER.
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "The official Khronos Vulkan validation layers";
|
||||
|
|
Loading…
Reference in a new issue