10 enableMoltenVKCompat ? false,
13 stdenv.mkDerivation (finalAttrs: {
17 src = fetchFromGitHub {
20 rev = "v${finalAttrs.version}";
21 hash = "sha256-T93ZylxzJGprrP+j6axZwl2d3hJowMCUOKNjIyNzkmE=";
24 # These patches are required when using DXVK with Wine on Darwin.
27 # Fixes errors building with GCC 13.
29 url = "https://github.com/doitsujin/dxvk/commit/1a5afc77b1859e6c7e31b55e11ece899e3b5295a.patch";
30 hash = "sha256-tTAsQOMAazgH/6laLNTuG2lki257VUR9EBivnD4vCuY=";
33 ++ lib.optionals enableMoltenVKCompat [
34 # Patch DXVK to work with MoltenVK even though it doesn’t support some required features.
35 # Some games work poorly (particularly Unreal Engine 4 games), but others work pretty well.
36 ./darwin-dxvk-compat.patch
37 # Use synchronization primitives from the C++ standard library to avoid deadlocks on Darwin.
38 # See: https://www.reddit.com/r/macgaming/comments/t8liua/comment/hzsuce9/
39 ./darwin-thread-primitives.patch
49 buildInputs = [ windows.pthreads ];
51 mesonBuildType = "release";
53 __structuredAttrs = true;
56 description = "Vulkan-based translation layer for Direct3D 9/10/11";
57 homepage = "https://github.com/doitsujin/dxvk";
58 changelog = "https://github.com/doitsujin/dxvk/releases";
59 maintainers = [ lib.maintainers.reckenrode ];
60 license = lib.licenses.zlib;
61 platforms = lib.platforms.windows;