vulkan: import common code for generating extensions
[mesa.git] / .gitlab-ci / container / x86_test-vk.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 export DEBIAN_FRONTEND=noninteractive
7
8 apt-get install -y \
9 ca-certificates \
10 gnupg
11
12 # Upstream LLVM package repository
13 apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key
14 echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list
15
16 sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
17 echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
18
19 apt-get update
20
21 apt-get dist-upgrade -y
22
23 apt-get install -y --no-remove \
24 ccache \
25 cmake \
26 g++ \
27 gcc \
28 git \
29 git-lfs \
30 libexpat1 \
31 libgbm-dev \
32 libgles2-mesa-dev \
33 libllvm9 \
34 liblz4-1 \
35 liblz4-dev \
36 libpng-dev \
37 libpng16-16 \
38 libvulkan-dev \
39 libvulkan1 \
40 libwayland-client0 \
41 libwayland-server0 \
42 libxcb-ewmh-dev \
43 libxcb-ewmh2 \
44 libxcb-keysyms1 \
45 libxcb-keysyms1-dev \
46 libxcb-randr0 \
47 libxcb-xfixes0 \
48 libxkbcommon-dev \
49 libxkbcommon0 \
50 libxrandr-dev \
51 libxrandr2 \
52 libxrender-dev \
53 libxrender1 \
54 meson \
55 p7zip \
56 pkg-config \
57 python \
58 python3-distutils \
59 python3-pil \
60 python3-requests \
61 python3-yaml \
62 vulkan-tools \
63 wget \
64 xauth \
65 xvfb
66
67 # We need multiarch for Wine
68 dpkg --add-architecture i386
69
70 apt-get update
71
72 apt-get install -y --no-remove \
73 wine \
74 wine32 \
75 wine64
76
77 ############### Set up Wine env variables
78
79 export WINEDEBUG="-all"
80 export WINEPREFIX="/dxvk-wine64"
81
82 ############### Install DXVK
83
84 DXVK_VERSION="1.6"
85
86 # We don't want crash dialogs
87 cat >crashdialog.reg <<EOF
88 Windows Registry Editor Version 5.00
89
90 [HKEY_CURRENT_USER\Software\Wine\WineDbg]
91 "ShowCrashDialog"=dword:00000000
92
93 EOF
94
95 # Set the wine prefix and disable the crash dialog
96 wine regedit crashdialog.reg
97 rm crashdialog.reg
98
99 # DXVK's setup often fails with:
100 # "${WINEPREFIX}: Not a valid wine prefix."
101 # and that is just spit because of checking the existance of the
102 # system.reg file, which fails.
103 # Just giving it a bit more of time for it to be created solves the
104 # problem ...
105 test -f "${WINEPREFIX}/system.reg" || sleep 2
106
107 wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
108 tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
109 dxvk-"${DXVK_VERSION}"/setup_dxvk.sh install
110 rm -rf dxvk-"${DXVK_VERSION}"
111 rm dxvk-"${DXVK_VERSION}".tar.gz
112
113 ############### Install Windows' apitrace binaries
114
115 APITRACE_VERSION="9.0"
116 APITRACE_VERSION_DATE="20191126"
117
118 wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
119 7zr x "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z" \
120 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
121 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"
122 mv "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64" /apitrace-msvc-win64
123 rm "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
124
125 # Add the apitrace path to the registry
126 wine \
127 reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" \
128 /v Path \
129 /t REG_EXPAND_SZ \
130 /d "C:\windows\system32;C:\windows;C:\windows\system32\wbem;Z:\apitrace-msvc-win64\bin" \
131 /f
132
133 ############### Building ...
134
135 . .gitlab-ci/container/container_pre_build.sh
136
137 ############### Build dEQP runner
138
139 . .gitlab-ci/build-cts-runner.sh
140
141 ############### Build Fossilize
142
143 . .gitlab-ci/build-fossilize.sh
144
145 ############### Build dEQP VK
146
147 . .gitlab-ci/build-deqp-vk.sh
148
149 ############### Build gfxreconstruct
150
151 . .gitlab-ci/build-gfxreconstruct.sh
152
153 ############### Build VulkanTools
154
155 . .gitlab-ci/build-vulkantools.sh
156
157 ############### Uninstall the build software
158
159 ccache --show-stats
160
161 apt-get purge -y \
162 ccache \
163 cmake \
164 g++ \
165 gcc \
166 gnupg \
167 libgbm-dev \
168 libgles2-mesa-dev \
169 liblz4-dev \
170 libpng-dev \
171 libvulkan-dev \
172 libxcb-ewmh-dev \
173 libxcb-keysyms1-dev \
174 libxkbcommon-dev \
175 libxrandr-dev \
176 libxrender-dev \
177 meson \
178 p7zip \
179 pkg-config \
180 wget
181
182 apt-get autoremove -y --purge