Run Nintendo Switch homebrew & games on your Android device!
Go to file
Billy Laws 98c0cc3e7f Impl preserve attached buffers/textures to avoid GPFIFO lock thrashing
When profiling SMO, it became obvious that the constant locking of textures and buffers in SyncDescriptors took up a large amount of CPU time (3-5%), a precious resource in intensive areas like Metro. This commit implements somewhat of a workaround to avoid constant relocking, if a buffer is frequently attached on the GPU and almost never used on the CPU we can keep the lock held between executions. Of course it's not that simple though, if the guest tries to lock a texture for the first time which has already been locked as preserve on the GPFIFO we need to avoid a deadlock. This is acheived through a combination of two things: first we periodically clear the locked attachments every 2*SlotCount submissions, preventing a complete deadlock on the CPU (just a long wait instead) and meaning that the next time the resource is attached on the GPU it will not be marked for preservation due to having been locked on the guest before; second, we always need to unlock everything when the GPU thread runs out of work, as the perioding clearing will not execute in this case which would otherwise leave the textures locked on the GPFIFO thread forever (if guest was waiting on a lock to submit work). It should be noted that we don't clear preserve attached resources in the latter scenario, only unlock them and then relock when more work is available.
2022-11-02 17:46:07 +00:00
.github Create FUNDING.yml 2022-10-26 23:17:38 +02:00
.idea Update codeStyles for Android Studio Electric Eel 2022-08-31 22:16:53 +05:30
app Impl preserve attached buffers/textures to avoid GPFIFO lock thrashing 2022-11-02 17:46:07 +00:00
gradle/wrapper Update Kotlin, AGP, Gradle and Build Tools 2022-04-27 14:00:36 +05:30
.gitignore Add .trace files to .gitignore 2022-04-25 20:59:53 +05:30
.gitmodules Remove PugiXML submodule 2022-07-26 20:16:24 +05:30
build.gradle Update Kotlin (1.7.10), NDK (25.0.8775105), AGP (7.2.2) and Kotlin deps 2022-08-17 12:28:31 +02:00
BUILDING.md Create a BUILDING.md file with building instructions 2022-04-14 13:54:51 +05:30
CONTRIBUTING.md Add rules on semantic wrapping and bracketed initalisation to contrib 2021-11-10 21:35:36 +05:30
gradle.properties Upgrade Gradle (7.4), AGP (7.1.2) and Kotlin Dependencies 2022-04-14 14:14:52 +05:30
gradlew Redesign UI 2021-06-17 20:30:22 +05:30
gradlew.bat add files, cannot figure out why native lib is broken 2019-06-28 20:35:14 -04:00
LICENSE.md Move to MPL-2.0 2020-04-23 22:26:27 +05:30
README.md Update README.md 2022-04-14 13:54:51 +05:30
settings.gradle add files, cannot figure out why native lib is broken 2019-06-28 20:35:14 -04:00



Contributing GuideBuilding Guide

Skyline is an experimental emulator that runs on ARMv8 Android™ devices and emulates the functionality of a Nintendo Switch™ system, licensed under Mozilla Public License 2.0


Contact

You can contact the core developers of Skyline at our Discord. If you have any questions, feel free to ask. It's also a good place to just keep up with the emulator, as most talk regarding development goes on over there.


Special Thanks

A few noteworthy teams/projects who've helped us along the way are:

  • Ryujinx: We've used Ryujinx for reference throughout the project, the accuracy of their HLE implementations of Switch subsystems make it an amazing reference. The team behind the project has been extremely helpful with any queries we've had and have constantly helped us with any issues we've come across. It should be noted that Skyline is not based on Ryujinx.

  • yuzu: Skyline's shader compiler is a fork of yuzu's shader compiler with Skyline-specific changes, using it allowed us to focus on the parts of GPU emulation that we could specifically optimize for mobile while having a high-quality shader compiler implementation as a base. The team behind yuzu has also often helped us and have graciously provided us with a license exemption.

  • Switchbrew: We've extensively used Switchbrew whether that be their wiki with its colossal amount of information on the Switch that has saved us countless hours of time or libnx which was crucial to initial development of the emulator to ensure that our HLE kernel and sysmodule implementations were accurate.


Disclaimer

  • Nintendo Switch is a trademark of Nintendo Co., Ltd
  • Android is a trademark of Google LLC