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.
This commit is contained in:
PixelyIon 2021-11-21 13:36:39 +05:30
parent 746af4cb4c
commit def9cedbee
5 changed files with 31 additions and 14 deletions

3
.gitmodules vendored
View File

@ -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

View File

@ -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)

@ -0,0 +1 @@
Subproject commit 26adbfd2f3ab9b39cee64230ef5a6b28d3f28846

View File

@ -132,6 +132,7 @@
<string name="licenses">Licenses</string>
<string name="skyline_license_description">Skyline is licensed under Mozilla Public License 2.0</string>
<string name="ryujinx_description">Ryujinx has been used for reference throughout the project due to their highly accurate implementations\n\n<b>Note: Skyline is not based on Ryujinx</b></string>
<string name="shader_compiler_description">Skyline\'s shader compiler is a <b>fork</b> of <i>yuzu</i>\'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\n<b>Note:</b> Using it in Skyline is only possible due to the licensing exemption granted to Skyline by the <i>yuzu</i> team</string>
<string name="sirit_description">Skyline\'s shader compiler internally uses Sirit to emit SPIR-V in an efficient manner</string>
<string name="vkhpp_description">Vulkan-Hpp provides a C++ API for Vulkan</string>
<string name="vkma_description">Vulkan Memory Allocator provides a high-quality GPU memory allocator with UMA support</string>

View File

@ -139,6 +139,12 @@
app:libraryUrl="https://github.com/Ryujinx/Ryujinx"
app:summary="@string/ryujinx_description"
app:title="Ryujinx" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2021 yuzu Emulator Project\nCopyright © 2021 Skyline Team and Contributors"
app:libraryLicense="@string/mpl2_license"
app:libraryUrl="https://github.com/skyline-emu/shader-compiler"
app:summary="@string/shader_compiler_description"
app:title="yuzu Shader Compiler" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2019, sirit\nAll rights reserved."
app:libraryLicense="@string/bsd_3_clause_license"