From 0125d359545ba2081a899834f80eeca5a721f33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 18 May 2024 01:35:18 +0200 Subject: [PATCH] ci/win32: add Vulkan-Loader vulkan-1.dll is packaged, but is not neccessary in most cases where Vulkan Loader is already instaled by GPU driver. --- .github/workflows/build.yml | 1 + ci/build-win32.ps1 | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d88068a7f2..2d4afe3d48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,6 +168,7 @@ jobs: name: mpv-x86_64-windows-msvc path: | build/mpv.??? + build/vulkan-*.dll !build/mpv.lib macos: diff --git a/ci/build-win32.ps1 b/ci/build-win32.ps1 index 7a36481114..ace54236b3 100644 --- a/ci/build-win32.ps1 +++ b/ci/build-win32.ps1 @@ -100,6 +100,24 @@ spirv_cross_c_dep = declare_dependency(dependencies: [ meson.override_dependency('spirv-cross-c-shared', spirv_cross_c_dep) "@ +# Manually wrap Vulkan-Loader for UPDATE_DEPS option +if (-not (Test-Path "$subprojects/vulkan")) { + New-Item -Path "$subprojects/vulkan" -ItemType Directory | Out-Null +} +Set-Content -Path "$subprojects/vulkan/meson.build" -Value @" +project('vulkan', 'cpp', version: '1.3.285') +cmake = import('cmake') +opts = cmake.subproject_options() +opts.add_cmake_defines({ + 'UPDATE_DEPS': 'ON', + 'USE_GAS': 'ON', +}) +opts.append_link_args(['-lcfgmgr32', '-Wl,/def:../subprojects/vulkan-loader/loader/vulkan-1.def']) +vulkan_proj = cmake.subproject('vulkan-loader', options: opts) +vulkan_dep = vulkan_proj.dependency('vulkan') +meson.override_dependency('vulkan', vulkan_dep) +"@ + $projects = @( @{ Path = "$subprojects/ffmpeg.wrap" @@ -131,6 +149,12 @@ $projects = @( URL = "https://github.com/KhronosGroup/SPIRV-Cross" Revision = "main" Method = "cmake" + }, + @{ + Path = "$subprojects/vulkan-loader.wrap" + URL = "https://github.com/KhronosGroup/Vulkan-Loader" + Revision = "main" + Method = "cmake" } ) @@ -180,6 +204,7 @@ meson setup build ` -Dxxhash:cli=false ` -Dluajit:amalgam=true ` -Dd3d11=enabled ` + -Dvulkan=enabled ` -Djavascript=enabled ` -Dlua=luajit ` -Ddrm=disabled ` @@ -188,4 +213,5 @@ meson setup build ` -Dwayland=disabled ` -Dx11=disabled ninja -C build mpv.exe mpv.com libmpv.a +cp ./build/subprojects/vulkan-loader/vulkan.dll ./build/vulkan-1.dll ./build/mpv.com -v --no-config