VKD3D-Proton-3.0b

#### Gaming Linux® From Scratch - Version 13.0

### Chapter 23. Wine

- Prev

  DXVK-2.7.1

- Next

  Quality of Life

- Up
- Home

# VKD3D-Proton-3.0b

## Introduction to VKD3D-Proton

The VKD3D-Proton package contains DLL files which converts Direct3D 12 calls to Vulkan. By default in Wine, Direct3D 12 calls are also converted to Vulkan; however, this package makes more aggressive optimizations geared towards gaming and replaces the default implementation provided by Wine, VKD3D.

### VKD3D-Proton Dependencies

Required
DXVK-2.7.1 (for `dxgi` and the configuration section), MinGW-w64-GCC-15.2.0 (compiled with POSIX thread support), Vulkan-SDK-1.4.341.0, and Wine-11.2

## Downloading VKD3D-Proton

This package depends on submodules and multiple of them will need to be downloaded. Create a list of the needed tarballs that will be downloaded:

    cat > vkd3d-proton-3.0b-list << "EOF"
    HansKristian-Work/vkd3d-proton/archive/v3.0b/vkd3d-proton-3.0b.tar.gz
    KhronosGroup/SPIRV-Headers/archive/3b9447dc98371e96b59a6225bd062a9867e1d203.tar.gz
    KhronosGroup/Vulkan-Headers/archive/b39ab380a44b6c8df462c34e976ea9ce2d2c336b.tar.gz
    HansKristian-Work/dxil-spirv/archive/4e36bab794afdb7d78f56b866971009ca894fe9c.tar.gz
    KhronosGroup/SPIRV-Cross/archive/4b7bcb7e5cf71015b3299088d22004bfe4e13a5e.tar.gz
    KhronosGroup/SPIRV-Tools/archive/e9a8ceeddbf7e3aaadac2ab6f8a6ab6437872e88.tar.gz
    doitsujin/dxbc-spirv/archive/a38b5d78ed29f5fe44c2a2e157d5f7c2516df6e5.tar.gz
    KhronosGroup/SPIRV-Headers/archive/c8ad050fcb29e42a2f57d9f59e97488f465c436d.tar.gz
    EOF

Download the tarballs using Wget-1.25.0:

    mkdir vkd3d-proton &&
    cd    vkd3d-proton &&
    grep -v '^#' ../vkd3d-proton-3.0b-list | wget -i- -c \
        -B https://github.com/

## Installation of VKD3D-Proton

Extract all the tarballs:

    for i in *.tar.?z*; do
      echo "Extracting $i..."
      tar -xf $i
    done

Now that the tarballs have been extracted, the submodules need to be moved in place. Do so now:

    cp -RT SPIRV-Headers-3b9447dc98371e96b59a6225bd062a9867e1d203             \
           vkd3d-proton-3.0b/khronos/SPIRV-Headers                            &&
    mv -T  Vulkan-Headers-*                                                   \
           vkd3d-proton-3.0b/khronos/Vulkan-Headers                           &&
    mv -T  dxil-spirv-*                                                       \
           vkd3d-proton-3.0b/subprojects/dxil-spirv                           &&
    mv -T  SPIRV-Cross-*                                                      \
           vkd3d-proton-3.0b/subprojects/dxil-spirv/third_party/SPIRV-Cross   &&
    mv -T  SPIRV-Headers-3b9447dc98371e96b59a6225bd062a9867e1d203             \
           vkd3d-proton-3.0b/subprojects/dxil-spirv/third_party/spirv-headers &&
    mv -T  SPIRV-Tools-*                                                      \
           vkd3d-proton-3.0b/subprojects/dxil-spirv/third_party/SPIRV-Tools   &&
    mv -T  dxbc-spirv-*                                                       \
           vkd3d-proton-3.0b/subprojects/dxil-spirv/subprojects/dxbc-spirv    &&
    mv -T  SPIRV-Headers-c8ad050fcb29e42a2f57d9f59e97488f465c436d             \
           vkd3d-proton-3.0b/subprojects/dxil-spirv/subprojects/dxbc-spirv/submodules/spirv_headers

Go into the `vkd3d-proton-3.0b` directory:

    cd vkd3d-proton-3.0b

### Note

If you are doing multilib, it is up to you if you want to install the 32-bit DLL files from this package. Direct3D 12 released in mid-2015, so there are less 32-bit D3D12 applications than 64-bit ones. If you wish to stay on the safe side, it would be prudent to install the 32-bit DLL files as well.

### 64-bit Installation

Install 64-bit VKD3D-Proton by running the following commands:

    mkdir build-win64 &&
    cd    build-win64 &&

    meson setup --cross-file=../build-win64.txt \
                --buildtype=release             \
                --prefix=$PWD/DESTDIR           \
                .. &&
    ninja

Now as the `root` user:

    ninja install &&
    cd ..         &&

    mkdir   -pv     /usr/lib/vkd3d-proton/win64 &&
    install -vDm755 build-win64/DESTDIR/bin/*.dll \
                 -t /usr/lib/vkd3d-proton/win64/

### 32-bit Installation

Install 32-bit VKD3D-Proton by running the following commands:

    mkdir build-win32 &&
    cd    build-win32 &&

    meson setup --cross-file=../build-win32.txt \
                --buildtype=release             \
                --prefix=$PWD/DESTDIR           \
                .. &&
    ninja

Now as the `root` user:

    ninja install &&
    cd ..         &&

    mkdir   -pv     /usr/lib/vkd3d-proton/win32 &&
    install -vDm755 build-win32/DESTDIR/bin/*.dll \
                 -t /usr/lib/vkd3d-proton/win32/

## Setting Up VKD3D-Proton

While the VKD3D-Proton DLL files have been installed, they are not yet in the Wine prefix. Create symlinks so that they can be found by Wine, whilst allowing updating of this package without having to copy everything over again. Along with this, the registry must be updated to use the new DLLs. Do this for each architecture you have installed.

### 64-bit Setup

For 64-bit:

    for DLL_FILE in /usr/lib/vkd3d-proton/win64/*.dll; do
        ln -sfv $DLL_FILE ~/.wine/drive_c/windows/system32/$(basename $DLL_FILE) &&
        DLL_FILE=$(basename $DLL_FILE | sed s/.dll//g) &&
        wine reg add \
            'HKEY_CURRENT_USER\Software\Wine\DllOverrides' \
            /v "$DLL_FILE" /d native /f
    done

### 32-bit Setup

For 32-bit:

    for DLL_FILE in /usr/lib/vkd3d-proton/win32/*.dll; do
        if [ ! -d ~/.wine/drive_c/windows/syswow64 ]; then
            ln -sfv $DLL_FILE ~/.wine/drive_c/windows/system32/$(basename $DLL_FILE)
        else
            ln -sfv $DLL_FILE ~/.wine/drive_c/windows/syswow64/$(basename $DLL_FILE)
        fi
        DLL_FILE=$(basename $DLL_FILE | sed s/.dll//g) &&
        wine reg add \
            'HKEY_CURRENT_USER\Software\Wine\DllOverrides' \
            /v "$DLL_FILE" /d native /f
    done

## Command Explanations

### Note

Inspect `meson_options.txt` or `meson.options` for a full list of options.

`--cross-file=../build-win{32,64}.txt`: This parameter changes what Win architecture to build for.

`--buildtype=release`: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

wine reg add ...: This command overrides the registry so that Wine will use the new DLL files instead of the old ones.

## Contents

Installed Programs: None
Installed Libraries: d3d12core and d3d12 (all DLLs)
Installed Directories: /usr/lib/vkd3d-proton/{win32,win64}

### Short Descriptions

`d3d12core` | contains the core Direct3D 12 API functions
`d3d12` | converts Direct3D 12 calls to Vulkan

- Prev

  DXVK-2.7.1

- Next

  Quality of Life

- Up
- Home