Merge pull request #131299 from expipiplus1/vulkan-182

This commit is contained in:
Sandro 2021-07-29 11:58:56 +00:00 committed by GitHub
commit f374e8c8dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 112 additions and 81 deletions

View File

@ -1,7 +1,7 @@
{ lib, stdenv, fetchFromGitHub, cmake }:
stdenv.mkDerivation rec {
pname = "vulkan-headers";
version = "1.2.162.0";
version = "1.2.182.0";
nativeBuildInputs = [ cmake ];
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
owner = "KhronosGroup";
repo = "Vulkan-Headers";
rev = "sdk-${version}";
sha256 = "057c49w1138l02v9gqsk1z8wdz0iilp96jblnldycwm9jc1a1ipq";
sha256 = "03j0kzq2qxhy0y82l10m8am26zrms2sjrdb1dcbpv9zh5vkxhcla";
};
meta = with lib; {

View File

@ -1,23 +1,23 @@
{ lib, stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkg-config
, xlibsWrapper, libxcb, libXrandr, libXext, wayland, addOpenGLRunpath }:
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb
, libXrandr, wayland, vulkan-headers, addOpenGLRunpath }:
stdenv.mkDerivation rec {
pname = "vulkan-loader";
version = "1.2.162.0";
version = "1.2.182.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Loader";
rev = "sdk-${version}";
sha256 = "0w9i2pliw4ccmjyfzff4i2f3hxwsfd54jg7ahv2v634qmx59bsbi";
};
src = (assert version == vulkan-headers.version;
fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Loader";
rev = "sdk-${version}";
sha256 = "0gmr9q3a6s8xvaa74fs9zbi9c305i2b3rx768qvl79nhbdj8nc02";
});
nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [ python3 xlibsWrapper libxcb libXrandr libXext wayland ];
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ libX11 libxcb libXrandr vulkan-headers wayland ];
cmakeFlags = [
"-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share"
"-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
"-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include"
];

View File

@ -1,31 +1,30 @@
{ 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
# and https://github.com/KhronosGroup/glslang/blob/master/known_good.json
localSpirvHeaders = spirv-headers.overrideAttrs (_: {
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Headers";
rev = "f027d53ded7e230e008d37c8b47ede7cd308e19d";
sha256 = "12gp2mqcar6jj57jw9isfr62yn72kmvdcl0zga4gvrlyfhnf582q";
rev = "dafead1765f6c1a5f9f8a76387dcb2abe4e54acd"; # pin
sha256 = "1kj6wcx9y7r1xyg8n7ai2pzrg9ira7hbakr45wh5p4zyxh0m45n8";
};
});
localGlslang = (glslang.override {
@ -33,8 +32,8 @@ let
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Tools";
rev = "c9c1f54330d13a0bec1aa3f08d436249d8e35596";
sha256 = "0r5whsw9x8j4199xwxv293ar2ga73pm2s7rngw732ylh6rw3bkly";
rev = "dc72924cb31cd9f3dbc3eb47e9d926cf641e3a07"; # pin
sha256 = "0pxgbq6xapw9hgrzb3rk5cylzgg1y1bkqz5wxzwqls63pwga5912";
};
});
argSpirv-headers = localSpirvHeaders;
@ -42,55 +41,64 @@ let
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
rev = "dd69df7f3dac26362e10b0f38efb9e47990f7537";
sha256 = "1iafbh524avsjg4pjiq156b62pck2rwlfl2pjnml8sjy285506rk";
rev = "18eef33bd7a4bf5ad8c69f99cb72022608cf6e73"; # pin
sha256 = "0wwj7q509pkp8wj7120g1n2ddl4x2r03ljf5czd9794ji6yraidn";
};
});
robin-hood-hashing = fetchFromGitHub {
owner = "martinus";
repo = "robin-hood-hashing";
rev = "3.11.2"; # pin
sha256 = "0103mnqpmka1smy0arnrbihlvi7i8xr5im0px8wn4faw4flikkcm";
};
in
stdenv.mkDerivation rec {
pname = "vulkan-validation-layers";
version = "1.2.162.0";
version = "1.2.182.0";
# If we were to use "dev" here instead of headers, the setupHook would be
# placed in that output instead of "out".
outputs = ["out" "headers"];
outputInclude = "headers";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-ValidationLayers";
rev = "sdk-${version}";
sha256 = "1mpqmxh9zm20jdar59lp4yjpqfzxn2pwds6bkvnzihfy0pymf15k";
};
src = (assert version == vulkan-headers.version;
fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-ValidationLayers";
rev = "sdk-${version}";
sha256 = "1fnmb7vbm7y1x67bf1xiwdrpj9j4lkvhk9xhb6hp6x2aryvcyrnc";
});
# 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";

View File

@ -2,14 +2,15 @@
stdenv.mkDerivation rec {
pname = "vulkan-extension-layer";
version = "2020-11-20";
version = "1.2.182.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-ExtensionLayer";
rev = "7474cb8e1f70e9f4a8bf382708a7f15465453af5";
sha256 = "1lxkgcnv32wqk4hlckv13xy84g38jzgc4qxp9vsbkrgz87hkdvwj";
};
src = (assert version == vulkan-headers.version;
fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-ExtensionLayer";
rev = "sdk-${version}";
sha256 = "0by2kp48jbd55xk26rmlvc4wm77g1zvidx8czn1587ng2yzi7acr";
});
nativeBuildInputs = [ cmake jq ];

View File

@ -1,26 +1,44 @@
{ stdenv, cmake, expat, fetchFromGitHub, jq, lib, libXdmcp, libXrandr, libffi
, libxcb, pkg-config, python3, symlinkJoin, vulkan-headers, vulkan-loader
, vulkan-validation-layers, wayland, writeText, xcbutilkeysyms, xcbutilwm
, xlibsWrapper }:
{ lib
, stdenv
, fetchFromGitHub
, cmake
, python3
, jq
, expat
, libX11
, libXdmcp
, libXrandr
, libffi
, libxcb
, wayland
, xcbutilkeysyms
, xcbutilwm
, vulkan-headers
, vulkan-loader
, symlinkJoin
, vulkan-validation-layers
, writeText
}:
stdenv.mkDerivation rec {
pname = "vulkan-tools-lunarg";
# The version must match that in vulkan-headers
version = "1.2.162.0";
version = "1.2.182.0";
src = (assert version == vulkan-headers.version;
fetchFromGitHub {
owner = "LunarG";
repo = "VulkanTools";
rev = "sdk-${version}";
sha256 = "13v4202bfd7d7nwi8w12ja9k1vi10p9xxypzkpi063hmsgzxm5k5";
sha256 = "1b7762fcbakfvj2b2l68qj25pc7pz9jhfabf1x80b9w3q205hl2f";
fetchSubmodules = true;
});
nativeBuildInputs = [ cmake pkg-config python3 jq ];
nativeBuildInputs = [ cmake python3 jq ];
buildInputs = [
expat
libX11
libXdmcp
libXrandr
libffi
@ -28,7 +46,6 @@ stdenv.mkDerivation rec {
wayland
xcbutilkeysyms
xcbutilwm
xlibsWrapper
];
cmakeFlags = [
@ -40,6 +57,8 @@ stdenv.mkDerivation rec {
paths = [ vulkan-validation-layers.headers vulkan-validation-layers ];
}
}"
# Hide dev warnings that are useless for packaging
"-Wno-dev"
];
preConfigure = ''
@ -63,7 +82,6 @@ stdenv.mkDerivation rec {
'';
# Same as vulkan-validation-layers
libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ];
dontPatchELF = true;
# Help vulkan-loader find the validation layers

View File

@ -1,20 +1,23 @@
{ stdenv, lib, fetchFromGitHub, cmake, python3, vulkan-loader,
vulkan-headers, glslang, pkg-config, xlibsWrapper, libxcb,
libXrandr, wayland }:
{ stdenv, lib, fetchFromGitHub, cmake, glslang, libX11, libxcb
, libXrandr, vulkan-headers, vulkan-loader, wayland }:
stdenv.mkDerivation rec {
pname = "vulkan-tools";
version = "1.2.162.0";
version = "1.2.182.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Tools";
rev = "sdk-${version}";
sha256 = "088vqh956zma3p1qc3p6rsygf5s395b6cv8b1x0whp2a0a1y81xz";
};
# It's not strictly necessary to have matching versions here, however
# since we're using the SDK version we may as well be consistent with
# the rest of nixpkgs.
src = (assert version == vulkan-headers.version;
fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Tools";
rev = "sdk-${version}";
sha256 = "028l2l7jx4443k8207q8jmjq1mnnm9kgyl2417jrkrvylcbv8ji9";
});
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ python3 vulkan-headers vulkan-loader xlibsWrapper libxcb libXrandr wayland ];
nativeBuildInputs = [ cmake ];
buildInputs = [ glslang libX11 libxcb libXrandr vulkan-headers vulkan-loader wayland ];
libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ];
@ -23,9 +26,10 @@ stdenv.mkDerivation rec {
cmakeFlags = [
# Don't build the mock ICD as it may get used instead of other drivers, if installed
"-DBUILD_ICD=OFF"
"-DGLSLANG_INSTALL_DIR=${glslang}"
# vulkaninfo loads libvulkan using dlopen, so we have to add it manually to RPATH
"-DCMAKE_INSTALL_RPATH=${libraryPath}"
# Hide dev warnings that are useless for packaging
"-Wno-dev"
];
meta = with lib; {