Replace skyline-emu/VkHpp with KhronosGroup/Vulkan-Hpp

We used a custom version of Vulkan-Hpp which split the files a lot prior to avoid any developers needing to manually set IDE settings for IntelliJ to work but this wasn't practical due to how it required modifications to Vulkan-Hpp's generator which would make maintenance extremely difficult. It was determined that we should just add the requirement for changing the IDE settings and use Vulkan-Hpp directly.
This commit is contained in:
PixelyIon 2021-03-26 23:42:19 +05:30 committed by ◱ Mark
parent 7a5684e57f
commit 0c29f982d5
7 changed files with 66 additions and 56 deletions

View File

@ -1,6 +1,6 @@
name: CI name: CI
on: [push, pull_request] on: [ push, pull_request ]
jobs: jobs:
build: build:
@ -9,61 +9,61 @@ jobs:
JVM_OPTS: -Xmx6G JVM_OPTS: -Xmx6G
steps: steps:
- name: Git Checkout - name: Git Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: true submodules: recursive
- name: Restore Gradle Cache - name: Restore Gradle Cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /root/.gradle/ path: /root/.gradle/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }} key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}
restore-keys: | restore-keys: |
${{ runner.os }}-gradle- ${{ runner.os }}-gradle-
- name: Restore CXX Cache - name: Restore CXX Cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: app/.cxx/ path: app/.cxx/
key: ${{ runner.os }}-cxx-${{ hashFiles('**/CMakeLists.txt') }} key: ${{ runner.os }}-cxx-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-cxx- ${{ runner.os }}-cxx-
- name: Setup Environment for Gradle & Ninja Build - name: Setup Environment for Gradle & Ninja Build
run: | run: |
chmod +x gradlew chmod +x gradlew
sudo apt-get install -y ninja-build sudo apt-get install -y ninja-build
- name: Android Lint - name: Android Lint
run: ./gradlew --stacktrace lint run: ./gradlew --stacktrace lint
- name: Upload Lint Report - name: Upload Lint Report
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: lint-result.html name: lint-result.html
path: app/build/reports/lint-results.html path: app/build/reports/lint-results.html
- name: Android Assemble - name: Android Assemble
run: ./gradlew assemble run: ./gradlew assemble
- name: Upload Debug APK - name: Upload Debug APK
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: app-debug.apk name: app-debug.apk
path: app/build/outputs/apk/debug/ path: app/build/outputs/apk/debug/
- name: Upload Release APK - name: Upload Release APK
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: app-release.apk name: app-release.apk
path: app/build/outputs/apk/release/ path: app/build/outputs/apk/release/
- name: Upload R8 Mapping - name: Upload R8 Mapping
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: mapping.txt name: mapping.txt
path: app/build/outputs/mapping/release/ path: app/build/outputs/mapping/release/
- name: Delete Build Folder - name: Delete Build Folder
run: rm -rf app/build/ run: rm -rf app/build/

6
.gitmodules vendored
View File

@ -5,9 +5,6 @@
path = app/libraries/oboe path = app/libraries/oboe
url = https://github.com/google/oboe url = https://github.com/google/oboe
branch = 1.3-stable branch = 1.3-stable
[submodule "app/libraries/vkhpp"]
path = app/libraries/vkhpp
url = https://github.com/skyline-emu/vkhpp
[submodule "app/libraries/lz4"] [submodule "app/libraries/lz4"]
path = app/libraries/lz4 path = app/libraries/lz4
url = https://github.com/lz4/lz4.git url = https://github.com/lz4/lz4.git
@ -25,3 +22,6 @@
path = app/libraries/perfetto path = app/libraries/perfetto
url = https://android.googlesource.com/platform/external/perfetto url = https://android.googlesource.com/platform/external/perfetto
branch = releases/v12.x branch = releases/v12.x
[submodule "app/libraries/vkhpp"]
path = app/libraries/vkhpp
url = https://github.com/KhronosGroup/Vulkan-Hpp

View File

@ -9,6 +9,7 @@
<mapping directory="$PROJECT_DIR$/app/libraries/perfetto" vcs="Git" /> <mapping directory="$PROJECT_DIR$/app/libraries/perfetto" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/libraries/pugixml" vcs="Git" /> <mapping directory="$PROJECT_DIR$/app/libraries/pugixml" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/libraries/tzcode" vcs="Git" /> <mapping directory="$PROJECT_DIR$/app/libraries/tzcode" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/libraries/vk-headers" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/libraries/vkhpp" vcs="Git" /> <mapping directory="$PROJECT_DIR$/app/libraries/vkhpp" vcs="Git" />
</component> </component>
</project> </project>

View File

@ -225,6 +225,9 @@ In addition, try to `constexpr` as much as possible including constructors and f
We should also mention that this isn't promoting the usage of `const`, it's use is actually discouraged out of references, in which case it is extremely encouraged. In addition, pointers are a general exception to this, using `const` with them isn't encouraged nor discouraged. Another exception are class functions, they can be made `const` if used from a `const` reference/pointer and don't We should also mention that this isn't promoting the usage of `const`, it's use is actually discouraged out of references, in which case it is extremely encouraged. In addition, pointers are a general exception to this, using `const` with them isn't encouraged nor discouraged. Another exception are class functions, they can be made `const` if used from a `const` reference/pointer and don't
modify any members but do not do this preemptively. modify any members but do not do this preemptively.
### Vulkan.hpp Header Size
The size of the header imported for [Vulkan-Hpp](https://github.com/KhronosGroup/Vulkan-Hpp) is extremely large and exceeds the CLion default analysis limit, it is required to run for properly annotating any code which uses components from it. To override this limit, refer to this [article from JetBrains](https://www.jetbrains.com/help/objc/configuring-file-size-limit.html#file-size-limit) or navigate to Help -> Edit Custom Properties and add `idea.max.intellisense.filesize=20000` to set the maximum limit to 20MB which should be adequate for it.
## Kotlin ## Kotlin
### Naming rules ### Naming rules
* Enumerator: `PascalCase` **(1)** * Enumerator: `PascalCase` **(1)**

View File

@ -25,10 +25,16 @@ add_subdirectory("libraries/oboe")
include_directories("libraries/oboe/include") include_directories("libraries/oboe/include")
set(LZ4_BUILD_CLI OFF CACHE BOOL "Build LZ4 CLI" FORCE) set(LZ4_BUILD_CLI OFF CACHE BOOL "Build LZ4 CLI" FORCE)
set(LZ4_BUILD_LEGACY_LZ4C OFF CACHE BOOL "Build lz4c progam with legacy argument support" FORCE)
add_subdirectory("libraries/lz4/build/cmake") add_subdirectory("libraries/lz4/build/cmake")
include_directories("libraries/lz4/lib") include_directories("libraries/lz4/lib")
include_directories("libraries/vkhpp/include") add_compile_definitions(VULKAN_HPP_NO_SPACESHIP_OPERATOR) # libcxx doesn't implement operator<=> for std::array which breaks this
add_compile_definitions(VULKAN_HPP_NO_STRUCT_CONSTRUCTORS) # We want to use designated initializers in Vulkan-Hpp
add_compile_definitions(VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1) # We use the dynamic loader rather than the static one
include_directories("libraries/vkhpp")
include_directories("libraries/vkhpp/Vulkan-Headers/include") # We use base Vulkan headers from this to ensure version parity with Vulkan-Hpp
include_directories("libraries/pugixml/src") # We use PugiXML in header-only mode include_directories("libraries/pugixml/src") # We use PugiXML in header-only mode
include_directories("libraries/frozen/include") include_directories("libraries/frozen/include")
@ -188,5 +194,5 @@ add_library(skyline SHARED
${source_DIR}/skyline/services/prepo/IPrepoService.cpp ${source_DIR}/skyline/services/prepo/IPrepoService.cpp
) )
# target_precompile_headers(skyline PRIVATE ${source_DIR}/skyline/common.h) # PCH will currently break Intellisense # target_precompile_headers(skyline PRIVATE ${source_DIR}/skyline/common.h) # PCH will currently break Intellisense
target_link_libraries(skyline vulkan android perfetto fmt lz4_static tzcode oboe mbedtls::mbedcrypto) target_link_libraries(skyline android perfetto fmt lz4_static tzcode oboe mbedtls::mbedcrypto)
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) 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)

@ -1 +1 @@
Subproject commit a4b8f74942a932ea191dc95cc4a210fea524508f Subproject commit 32188df57b217b5658bdf74e11c966fb84d7287d

View File

@ -4,7 +4,7 @@
#pragma once #pragma once
#include <common.h> #include <common.h>
#include <vulkan/vulkan.hpp> #include <vulkan/vulkan_raii.hpp>
namespace skyline { namespace skyline {
namespace service::hosbinder { namespace service::hosbinder {