@@ -1,23 +1,84 @@
1−{ stdenv, fetchFromGitHub, cmake, writeText, python3
2−, vulkan-headers, vulkan-loader, glslang
3−, pkgconfig, xlibsWrapper, libxcb, libXrandr, wayland }:
1+{ stdenv
2+, fetchFromGitHub
3+, cmake
4+, writeText
5+, python3
6+, spirv-headers
7+, spirv-tools
8+, vulkan-headers
9+, vulkan-loader
10+, glslang
11+, pkgconfig
12+, xlibsWrapper
13+, libxcb
14+, libXrandr
15+, wayland
16+}:
17+# vulkan-validation-layers requires a custom glslang version, while glslang requires
18+# custom versions for spirv-tools and spirv-headers. The git hashes required for all
19+# of these deps is documented upstream here:
20+# https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/scripts/known_good.json
21+
22+let
23+ localGlslang = (glslang.override {
24+ argSpirv-tools = spirv-tools.overrideAttrs (_: {
25+ src = fetchFromGitHub {
26+ owner = "KhronosGroup";
27+ repo = "SPIRV-Tools";
28+ rev = "e128ab0d624ce7beb08eb9656bb260c597a46d0a";
29+ sha256 = "0jj8zrl3dh9fq71jc8msx3f3ifb2vjcb37nl0w4sa8sdhfff74pv";
30+ };
31+ });
32+ argSpirv-headers = spirv-headers.overrideAttrs (_: {
33+ src = fetchFromGitHub {
34+ owner = "KhronosGroup";
35+ repo = "SPIRV-Headers";
36+ rev = "ac638f1815425403e946d0ab78bac71d2bdbf3be";
37+ sha256 = "1lkhs7pxcrfkmiizcxl0w5ajx6swwjv7w3iq586ipgh571fc75gx";
38+ };
39+ });
40+ }).overrideAttrs (_: {
41+ src = fetchFromGitHub {
42+ owner = "KhronosGroup";
43+ repo = "glslang";
44+ rev = "e00d27c6d65b7d3e72506a311d7f053da4051295";
45+ sha256 = "00lzvzk613gpm1vsdxffmx52z3c52ijwvzk4sfhh95p71kdydhgv";
46+ };
47+ });
48+in
449
550stdenv.mkDerivation rec {
651 pname = "vulkan-validation-layers";
7− version = "1.2.131.2";
52+ version = "1.2.141.0";
853
954 src = fetchFromGitHub {
1055 owner = "KhronosGroup";
1156 repo = "Vulkan-ValidationLayers";
1257 rev = "sdk-${version}";
13− sha256 = "1sz0388cr018ldx6ziplvk4v3zbg44pww77kv6kv5wxl69plwfcn";
58+ sha256 = "1yfas7q122kx74nbjk3wxlyacysgncvlvq081a5dp238m88vkmbj";
1459 };
1560
16− nativeBuildInputs = [ pkgconfig cmake python3 ];
17− buildInputs = [ vulkan-headers vulkan-loader libxcb libXrandr wayland ];
61+ nativeBuildInputs = [
62+ pkgconfig
63+ cmake
64+ python3
65+ ];
66+
67+ buildInputs = [
68+ localGlslang
69+ localGlslang.spirv-headers
70+ vulkan-headers
71+ vulkan-loader
72+ libxcb
73+ libXrandr
74+ wayland
75+ ];
76+
1877 enableParallelBuilding = true;
1978
20− cmakeFlags = [ "-DGLSLANG_INSTALL_DIR=${glslang}" ];
79+ cmakeFlags = [
80+ "-DGLSLANG_INSTALL_DIR=${localGlslang}"
81+ ];
2182
2283 # Help vulkan-loader find the validation layers
2384 setupHook = writeText "setup-hook" ''