• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 # Compiling deqp
2 
3 $ProgressPreference = "SilentlyContinue"
4 $MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
5 . "$MyPath\mesa_init_msvc.ps1"
6 
7 $source_dir = Join-Path -Path "$PWD" -ChildPath "src"
8 $deqp_source = Join-Path -Path "$source_dir" -ChildPath "VK-GL-CTS"
9 $deqp_build = Join-Path -Path "$PWD" -ChildPath "deqp"
10 
11 Write-Host "Cloning Vulkan and GL Conformance Tests at:"
12 Get-Date
13 New-Item -ItemType Directory -Path "$deqp_source" | Out-Null
14 Push-Location -Path $deqp_source
15 git init
16 git remote add origin https://github.com/KhronosGroup/VK-GL-CTS.git
17 git fetch --depth 1 origin d48899f85b486a70d090af59a1453763458611d9 # of branch vulkan-cts-1.3.8
18 if (!$?) {
19   Write-Host "Failed to fetch deqp repository"
20   Pop-Location
21   Exit 1
22 }
23 git checkout FETCH_HEAD
24 
25 Write-Host "Fetch sources inside $deqp_source at:"
26 Get-Date
27 # --insecure is due to SSL cert failures hitting sourceforge for zlib and
28 # libpng (sigh).  The archives get their checksums checked anyway, and git
29 # always goes through ssh or https.
30 py .\external\fetch_sources.py --insecure
31 Pop-Location
32 
33 Write-Host "Compiling deqp at:"
34 Get-Date
35 New-Item -ItemType Directory -Path "$deqp_build" | Out-Null
36 Push-Location -Path $deqp_build
37 cmake -S $($deqp_source) `
38 -B . `
39 -GNinja `
40 -DCMAKE_BUILD_TYPE=Release `
41 -DDEQP_TARGET=default && `
42 ninja -j32
43 if (!$?) {
44   Write-Host "Failed to compile deqp"
45   Pop-Location
46   Exit 1
47 }
48 Pop-Location
49 
50 # Copy test result templates
51 Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.css" -Destination $deqp_build
52 Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.xsl" -Destination $deqp_build
53 
54 # Copy Vulkan must-pass list
55 $deqp_mustpass = New-Item -ItemType Directory -Path $deqp_build -Name "mustpass"
56 $root_mustpass = Join-Path -Path $deqp_source -ChildPath "external\vulkancts\mustpass\main"
57 $files = Get-Content "$($root_mustpass)\vk-default.txt"
58 foreach($file in $files) {
59   Get-Content "$($root_mustpass)\$($file)" | Add-Content -Path "$($deqp_mustpass)\vk-main.txt"
60 }
61 
62 Write-Host "Installing deqp-runner at:"
63 Get-Date
64 $env:Path += ";$($env:USERPROFILE)\.cargo\bin"
65 cargo install --git https://gitlab.freedesktop.org/anholt/deqp-runner.git --tag v0.16.1
66 
67 $depsInstallPath="C:\mesa-deps"
68 $vk_cts_bin = "$deqp_build\external\vulkancts\modules\vulkan"
69 
70 # Hard link Agility SDK into subfolder of Vulkan CTS
71 $agility_dest = New-Item -ItemType Directory -Path $vk_cts_bin -Name 'D3D12'
72 New-Item -ItemType HardLink -path $agility_dest\D3D12Core.dll -Value $depsInstallPath\bin\D3D12\D3D12Core.dll
73 New-Item -ItemType HardLink -path $agility_dest\d3d12SDKLayers.dll -Value $depsInstallPath\bin\D3D12\d3d12SDKLayers.dll
74 
75 # Hard link WARP next to Vulkan CTS
76 New-Item -ItemType HardLink -path $vk_cts_bin\d3d10warp.dll -Value $depsInstallPath\bin\d3d10warp.dll
77 
78 Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "$source_dir" | Out-Null
79 
80 # Cleanup deqp intermediate files
81 Get-ChildItem -Force -ErrorAction SilentlyContinue -Recurse "$deqp_build" | Where-Object {
82   if($_.FullName -match "CMake|.git|.lib"){
83     Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $_.FullName | Out-Null
84   }
85 }
86 
87 Write-Host "Compiling deqp finished at:"
88 Get-Date
89