From def9cedbeeb2a141021502c715147bbe3b53506b Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Sun, 21 Nov 2021 13:36:39 +0530 Subject: [PATCH] Add yuzu Shader Compiler as a submodule We plan to use our fork of yuzu's shader compiler for GPU shader compilation so it's been added as a submodule. --- .gitmodules | 3 +++ app/CMakeLists.txt | 34 ++++++++++++++++------------ app/libraries/shader-compiler | 1 + app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/preferences.xml | 6 +++++ 5 files changed, 31 insertions(+), 14 deletions(-) create mode 160000 app/libraries/shader-compiler diff --git a/.gitmodules b/.gitmodules index c919b4ba..4dd238f3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,3 +48,6 @@ [submodule "Sirit"] path = app/libraries/sirit url = https://github.com/ReinUsesLisp/sirit +[submodule "Shader Compiler"] + path = app/libraries/shader-compiler + url = https://github.com/skyline-emu/shader-compiler.git diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 767aca97..6a90a5f5 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -107,6 +107,25 @@ add_subdirectory("libraries/sirit") # Build Skyline with full debugging data and -Og for debug builds set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -glldb -gdwarf-5") +# Include headers from libraries as system headers to silence warnings from them +function(target_link_libraries_system target) + set(libraries ${ARGN}) + foreach (library ${libraries}) + if (TARGET ${library}) + get_target_property(library_include_directories ${library} INTERFACE_INCLUDE_DIRECTORIES) + if (NOT "${library_include_directories}" STREQUAL "library_include_directories-NOTFOUND") + target_include_directories(${target} SYSTEM PRIVATE ${library_include_directories}) + endif () + endif () + target_link_libraries(${target} PRIVATE ${library}) + endforeach (library) +endfunction(target_link_libraries_system) + +# yuzu Shader Compiler +add_subdirectory("libraries/shader-compiler") +target_include_directories(shader_recompiler PUBLIC "libraries/shader-compiler/include") +target_link_libraries_system(shader_recompiler Boost::intrusive Boost::container range-v3) + # Skyline add_library(skyline SHARED ${source_DIR}/emu_jni.cpp @@ -281,18 +300,5 @@ target_include_directories(skyline PRIVATE ${source_DIR}/skyline) # target_precompile_headers(skyline PRIVATE ${source_DIR}/skyline/common.h) # PCH will currently break Intellisense target_compile_options(skyline PRIVATE -Wall -Wno-unknown-attributes -Wno-c++20-extensions -Wno-c++17-extensions -Wno-c99-designator -Wno-reorder -Wno-missing-braces -Wno-unused-variable -Wno-unused-private-field -Wno-dangling-else -Wconversion) -# Include headers from libraries as system headers to silence warnings from them -function(target_link_libraries_system target) - set(libraries ${ARGN}) - foreach (library ${libraries}) - if (TARGET ${library}) - get_target_property(library_include_directories ${library} INTERFACE_INCLUDE_DIRECTORIES) - if (NOT "${library_include_directories}" STREQUAL "library_include_directories-NOTFOUND") - target_include_directories(${target} SYSTEM PRIVATE ${library_include_directories}) - endif () - endif () - target_link_libraries(${target} ${library}) - endforeach (library) -endfunction(target_link_libraries_system) - +target_link_libraries(skyline PRIVATE shader_recompiler) target_link_libraries_system(skyline android perfetto fmt lz4_static tzcode oboe vkma mbedcrypto opus Boost::container) diff --git a/app/libraries/shader-compiler b/app/libraries/shader-compiler new file mode 160000 index 00000000..26adbfd2 --- /dev/null +++ b/app/libraries/shader-compiler @@ -0,0 +1 @@ +Subproject commit 26adbfd2f3ab9b39cee64230ef5a6b28d3f28846 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8d844eb6..e5bda038 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -132,6 +132,7 @@ Licenses Skyline is licensed under Mozilla Public License 2.0 Ryujinx has been used for reference throughout the project due to their highly accurate implementations\n\nNote: Skyline is not based on Ryujinx + Skyline\'s shader compiler is a fork of yuzu\'s shader compiler with Skyline-specific changes while other changes are shared between them allowing both projects to benefit from the development of it\n\nNote: Using it in Skyline is only possible due to the licensing exemption granted to Skyline by the yuzu team Skyline\'s shader compiler internally uses Sirit to emit SPIR-V in an efficient manner Vulkan-Hpp provides a C++ API for Vulkan Vulkan Memory Allocator provides a high-quality GPU memory allocator with UMA support diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index dc8deb1c..1128be35 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -139,6 +139,12 @@ app:libraryUrl="https://github.com/Ryujinx/Ryujinx" app:summary="@string/ryujinx_description" app:title="Ryujinx" /> +