From bb2fc9460b7a831a3f86e70512555dd0f79e90a1 Mon Sep 17 00:00:00 2001 From: Mystro256 Date: Mar 18 2020 13:54:43 +0000 Subject: Unbundle glslang Most of what's left needs to be added to fedora. --- diff --git a/0001-Use-system-headers-for-Vulkan.patch b/0001-Use-system-headers-for-Vulkan.patch new file mode 100644 index 0000000..28989c0 --- /dev/null +++ b/0001-Use-system-headers-for-Vulkan.patch @@ -0,0 +1,82 @@ +From 4a1abddab8201b0f83ba3ef737c2603b5f255063 Mon Sep 17 00:00:00 2001 +From: Mystro256 +Date: Thu, 12 Mar 2020 13:41:58 -0400 +Subject: [PATCH] Use system headers for Vulkan + +This can't be upstreamed, as it should be reworked to allow these bundled +libraries if detected. This will work in the meantime for Fedora though. +--- + CMakeLists.txt | 1 - + .../Core/VideoBackends/Vulkan/CMakeLists.txt | 19 +++++++++---------- + .../VideoBackends/Vulkan/ShaderCompiler.cpp | 9 +++++++++ + 3 files changed, 18 insertions(+), 11 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e6c242ba13..2394740791 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -541,7 +541,6 @@ else() + add_subdirectory(Externals/Bochs_disasm) + endif() + add_subdirectory(Externals/cpp-optparse) +-add_subdirectory(Externals/glslang) + add_subdirectory(Externals/imgui) + + find_package(pugixml) +diff --git a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt +index 87628030e9..a79ce6ddf3 100644 +--- a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt ++++ b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt +@@ -43,20 +43,19 @@ PUBLIC + videocommon + + PRIVATE +- # Link against glslang, the other necessary libraries are referenced by the executable. + glslang ++ OSDependent ++ OGLCompiler ++ glslang ++ HLSL ++ SPIRV ++ SPIRV-Tools-opt ++ SPIRV-Tools + xxhash + ) + +-# Only include the Vulkan headers when building the Vulkan backend +-target_include_directories(videovulkan +-PRIVATE +- ${CMAKE_SOURCE_DIR}/Externals/Vulkan/Include +-) +- +-# Silence warnings on glslang by flagging it as a system include + target_include_directories(videovulkan + SYSTEM PRIVATE +- ${CMAKE_SOURCE_DIR}/Externals/glslang/glslang/Public +- ${CMAKE_SOURCE_DIR}/Externals/glslang/SPIRV ++ /usr/include/glslang/Public ++ /usr/include/SPIRV + ) +diff --git a/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp b/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp +index 7b6beb11b0..2725082a2d 100644 +--- a/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp ++++ b/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp +@@ -342,6 +342,15 @@ const TBuiltInResource* GetCompilerResourceLimits() + /* .MaxCullDistances = */ 8, + /* .MaxCombinedClipAndCullDistances = */ 8, + /* .MaxSamples = */ 4, ++ /* .maxMeshOutputVerticesNV = */ 0, ++ /* .maxMeshOutputPrimitivesNV = */ 0, ++ /* .maxMeshWorkGroupSizeX_NV = */ 0, ++ /* .maxMeshWorkGroupSizeY_NV = */ 0, ++ /* .maxMeshWorkGroupSizeZ_NV = */ 0, ++ /* .maxTaskWorkGroupSizeX_NV = */ 0, ++ /* .maxTaskWorkGroupSizeY_NV = */ 0, ++ /* .maxTaskWorkGroupSizeZ_NV = */ 0, ++ /* .maxMeshViewCountNV = */ 0, + /* .limits = */ + { + /* .nonInductiveForLoops = */ 1, +-- +2.21.1 + diff --git a/dolphin-emu.spec b/dolphin-emu.spec index 4cc9864..4e8011a 100644 --- a/dolphin-emu.spec +++ b/dolphin-emu.spec @@ -11,7 +11,7 @@ Name: dolphin-emu Version: 5.0.%{snapnumber} -Release: 2%{?dist} +Release: 3%{?dist} Summary: GameCube / Wii / Triforce Emulator Url: https://dolphin-emu.org/ @@ -33,6 +33,8 @@ Source1: %{name}.appdata.xml #See upstream pull request: #https://github.com/dolphin-emu/dolphin/pull/8667 Patch0: 0001-Allow-using-shared-minizip.patch +#Not upstream-able for now: +Patch2: 0001-Use-system-headers-for-Vulkan.patch ##Bundled code ahoy #The following isn't in Fedora yet: @@ -42,8 +44,6 @@ Provides: bundled(imgui) = 1.70 Provides: bundled(cpp-argparse) #soundtouch cannot be unbundled easily, as it requires compile time changes: Provides: bundled(soundtouch) = 1.9.2 -#This might take some work to unbundle: -Provides: bundled(glslang) BuildRequires: gcc BuildRequires: gcc-c++ @@ -54,6 +54,7 @@ BuildRequires: bochs-devel %endif BuildRequires: cmake BuildRequires: enet-devel +BuildRequires: glslang-devel BuildRequires: hidapi-devel BuildRequires: libao-devel BuildRequires: libcurl-devel @@ -74,6 +75,9 @@ BuildRequires: pulseaudio-libs-devel BuildRequires: portaudio-devel BuildRequires: SDL2-devel BuildRequires: SFML-devel +BuildRequires: spirv-headers-devel +BuildRequires: spirv-tools +BuildRequires: spirv-tools-devel BuildRequires: systemd-devel BuildRequires: qt5-devel BuildRequires: vulkan-headers @@ -121,9 +125,6 @@ This package provides the data files for dolphin-emu. #Allow building with cmake macro sed -i '/CMAKE_C.*_FLAGS/d' CMakeLists.txt -#Silences a warning -ln -s glslang/MachineIndependent Externals/glslang/MachineIndependent - #Font license, just making things more generic sed 's| this directory | %{name}/Sys/GC |g' \ Data/Sys/GC/font-licenses.txt > font-licenses.txt @@ -131,7 +132,7 @@ sed 's| this directory | %{name}/Sys/GC |g' \ ###Remove Bundled: cd Externals #Keep what we need... -rm -rf `ls | grep -v 'Bochs' | grep -v 'FreeSurround' | grep -v 'cubeb' | grep -v 'imgui' | grep -v 'cpp-optparse' | grep -v 'soundtouch' | grep -v 'glslang' | grep -v 'picojson'` +rm -rf `ls | grep -v 'Bochs' | grep -v 'FreeSurround' | grep -v 'cubeb' | grep -v 'imgui' | grep -v 'cpp-optparse' | grep -v 'soundtouch' | grep -v 'picojson'` #Remove Bundled Bochs source and replace with links (for x86 only): %ifarch x86_64 pushd Bochs_disasm @@ -210,6 +211,9 @@ appstream-util validate-relax --nonet \ %{_udevrulesdir}/51-dolphin-usb-device.rules %changelog +* Wed Mar 18 2020 Jeremy Newton - 5.0.10474-3 +- Unbundle glslang + * Thu Mar 12 2020 Jeremy Newton - 5.0.10474-2 - Unbundle picojson