c3c41fa4bb
* Periodically Flush Commands for Vulkan NVIDIA's OpenGL driver has a built-in mechanism to automatically flush commands to GPU when a lot have been queued. It's also pretty inconsistent, but we'll ignore that for now. Our Vulkan implementation only submits a command buffer (flush equivalent) when it needs to. This is typically when another command buffer needs to be sequenced after it, presenting a frame, or an edge case where we flush around GPU queries to get results sooner. This difference in flush behaviour causes a notable difference between Vulkan and OpenGL when we have to wait for commands. In the worst case, we will wait for a sync point that has just been created. In Vulkan, this sync point is created by flushing the command buffer, and storing a waitable fence that signals its completion. Our command buffer contains _every command that we queued since the last submit_, which could be an entire frame's worth of draws. This has a huge effect on CPU <-> GPU latency. The more commands in a command buffer, the longer we have to wait for it to complete, which results in wasted time. Because we don't know when the guest will force us to wait, we always want the smallest possible latency. By periodically flushing, we ensure that each command buffer takes a more consistent, smaller amount of time to execute, and that the back of the GPU queue isn't as far away when we need to wait for something to happen. This also might reduce time that the GPU is left inactive while commands are being built. The main affected game is Pokemon Sword, which got significantly faster in overworld areas due to reduced waiting time when it flushes a shadow map from the main GPU thread. Another affected game is BOTW, which gets faster depending on the area. This game flushes textures/buffers from its game thread, which is the bottleneck. Flush latency and throughput may be improved on other games that are inexplicably slower than OpenGL. It's possible that certain games could have their performance _decreased_ slightly due to flushes not being free, but it is unlikely. Also, flushing to get query results sooner has been tweaked to improve the number of full draw skips that can be done. (tested in SMO) * Remove unused variable * Fix possible issue with early query flush |
||
---|---|---|
.github | ||
ARMeilleure | ||
distribution | ||
Ryujinx | ||
Ryujinx.Audio | ||
Ryujinx.Audio.Backends.OpenAL | ||
Ryujinx.Audio.Backends.SDL2 | ||
Ryujinx.Audio.Backends.SoundIo | ||
Ryujinx.Ava | ||
Ryujinx.Common | ||
Ryujinx.Cpu | ||
Ryujinx.Graphics.Device | ||
Ryujinx.Graphics.GAL | ||
Ryujinx.Graphics.Gpu | ||
Ryujinx.Graphics.Host1x | ||
Ryujinx.Graphics.Nvdec | ||
Ryujinx.Graphics.Nvdec.FFmpeg | ||
Ryujinx.Graphics.Nvdec.Vp9 | ||
Ryujinx.Graphics.OpenGL | ||
Ryujinx.Graphics.Shader | ||
Ryujinx.Graphics.Texture | ||
Ryujinx.Graphics.Vic | ||
Ryujinx.Graphics.Video | ||
Ryujinx.Graphics.Vulkan | ||
Ryujinx.Headless.SDL2 | ||
Ryujinx.HLE | ||
Ryujinx.Horizon.Generators | ||
Ryujinx.Input | ||
Ryujinx.Input.SDL2 | ||
Ryujinx.Memory | ||
Ryujinx.Memory.Tests | ||
Ryujinx.SDL2.Common | ||
Ryujinx.ShaderTools | ||
Ryujinx.Tests | ||
Ryujinx.Tests.Unicorn | ||
Ryujinx.Ui.Common | ||
Spv.Generator | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
global.json | ||
LICENSE.txt | ||
README.md | ||
Ryujinx.sln | ||
Ryujinx.sln.DotSettings |
Ryujinx
(REE-YOU-JINX)
Ryujinx is an open-source Nintendo Switch emulator, created by gdkchan, written in C#.
This emulator aims at providing excellent accuracy and performance, a user-friendly interface and consistent builds.
It was written from scratch and development on the project began in September 2017. Ryujinx is available on Github under the MIT license.
Compatibility
As of September 2022, Ryujinx has been tested on approximately 3,600 titles; over 3,400 boot past menus and into gameplay, with roughly 2,700 of those being considered playable. You can check out the compatibility list here.
Anyone is free to submit a new game test or update an existing game test entry; simply follow the new issue template and testing guidelines, or post as a reply to the applicable game issue. Use the search function to see if a game has been tested already!
Usage
To run this emulator, your PC must be equipped with at least 8GB of RAM; failing to meet this requirement may result in a poor gameplay experience or unexpected crashes.
See our Setup & Configuration Guide on how to set up the emulator.
For our Local Wireless and LAN builds, see our Multiplayer: Local Play/Local Wireless Guide .
Latest build
These builds are compiled automatically for each commit on the master branch. While we strive to ensure optimal stability and performance prior to pushing an update, our automated builds may be unstable or completely broken.
If you want to see details on updates to the emulator, you can visit our Changelog.
The latest automatic build for Windows, macOS, and Linux can be found on the Official Website.
Building
If you wish to build the emulator yourself, follow these steps:
Step 1
Install the X64 version of .NET 6.0 (or higher) SDK.
Step 2
Either use git clone https://github.com/Ryujinx/Ryujinx
on the command line to clone the repository or use Code --> Download zip button to get the files.
Step 3
To build Ryujinx, open a command prompt inside the project directory. You can quickly access it on Windows by holding shift in File Explorer, then right clicking and selecting Open command window here
. Then type the following command:
dotnet build -c Release -o build
the built files will be found in the newly created build directory.
Ryujinx system files are stored in the Ryujinx
folder. This folder is located in the user folder, which can be accessed by clicking Open Ryujinx Folder
under the File menu in the GUI.
Features
-
Audio
Audio output is entirely supported, audio input (microphone) isn't supported. We use C# wrappers for OpenAL, and SDL2 & libsoundio as fallbacks.
-
CPU
The CPU emulator, ARMeilleure, emulates an ARMv8 CPU and currently has support for most 64-bit ARMv8 and some of the ARMv7 (and older) instructions, including partial 32-bit support. It translates the ARM code to a custom IR, performs a few optimizations, and turns that into x86 code. There are three memory manager options available depending on the user's preference, leveraging both software-based (slower) and host-mapped modes (much faster). The fastest option (host, unchecked) is set by default. Ryujinx also features an optional Profiled Persistent Translation Cache, which essentially caches translated functions so that they do not need to be translated every time the game loads. The net result is a significant reduction in load times (the amount of time between launching a game and arriving at the title screen) for nearly every game. NOTE: this feature is enabled by default in the Options menu > System tab. You must launch the game at least twice to the title screen or beyond before performance improvements are unlocked on the third launch! These improvements are permanent and do not require any extra launches going forward.
-
GPU
The GPU emulator emulates the Switch's Maxwell GPU using the OpenGL API (version 4.5 minimum) through a custom build of OpenTK. There are currently four graphics enhancements available to the end user in Ryujinx: disk shader caching, resolution scaling, aspect ratio adjustment and anisotropic filtering. These enhancements can be adjusted or toggled as desired in the GUI.
-
Input
We currently have support for keyboard, mouse, touch input, JoyCon input support, and nearly all controllers. Motion controls are natively supported in most cases; for dual-JoyCon motion support, DS4Windows or BetterJoy are currently required. In all scenarios, you can set up everything inside the input configuration menu.
-
DLC & Modifications
Ryujinx is able to manage add-on content/downloadable content through the GUI. Mods (romfs, exefs, and runtime mods such as cheats) are also supported; the GUI contains a shortcut to open the respective mods folder for a particular game.
-
Configuration
The emulator has settings for enabling or disabling some logging, remapping controllers, and more. You can configure all of them through the graphical interface or manually through the config file,
Config.json
, found in the user folder which can be accessed by clickingOpen Ryujinx Folder
under the File menu in the GUI.
Contact
If you have contributions, suggestions, need emulator support or just want to get in touch with the team, join our Discord server. You may also review our FAQ.
Donations
If you'd like to support the project financially, Ryujinx has an active Patreon campaign.
All developers working on the project do so in their free time, but the project has several expenses:
- Hackable Nintendo Switch consoles to reverse-engineer the hardware
- Additional computer hardware for testing purposes (e.g. GPUs to diagnose graphical bugs, etc.)
- Licenses for various software development tools (e.g. Jetbrains, IDA)
- Web hosting and infrastructure maintenance (e.g. LDN servers)
All funds received through Patreon are considered a donation to support the project. Patrons receive early access to progress reports and exclusive access to developer interviews.
License
This software is licensed under the terms of the MIT license.
This project makes use of code authored by the libvpx project, licensed under BSD and the ffmpeg project, licensed under LGPLv3.
See LICENSE.txt and THIRDPARTY.md for more details.