From 9416e1b228a5deb0180e431d0dda7aafa7b254f4 Mon Sep 17 00:00:00 2001 From: jcm Date: Sat, 16 Mar 2024 02:50:57 -0500 Subject: [PATCH] Add Metal-Frame-Capture.md --- Developer-Guides/Metal-Frame-Capture.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Developer-Guides/Metal-Frame-Capture.md diff --git a/Developer-Guides/Metal-Frame-Capture.md b/Developer-Guides/Metal-Frame-Capture.md new file mode 100644 index 0000000..0cdff28 --- /dev/null +++ b/Developer-Guides/Metal-Frame-Capture.md @@ -0,0 +1,16 @@ +### Metal Frame Capture with Ryujinx + +Below is the method that I have found to produce reliable Metal GPU frame captures of Switch titles in Ryujinx, using Xcode and the lldb debugger. The first draft of this guide will be "quick and dirty;" hopefully, it will be updated continuously so it eventually conforms to best practice, if such a thing exists for what we're doing. + +#### External Build System Project in Xcode + +Xcode seems to be more willing to harness an application properly if it's nominally in charge of the entire build process, even if the application isn't using a standard C-family build toolchain. So we will add Ryujinx as an "External Build System" project, with `dotnet`, our favorite external build system. + +1. Clone the Ryujinx github repository as normal: ```git clone https://github.com/Ryujinx/Ryujinx``` +2. In Xcode, create a New Project. For the template, navigate to "Other", then search for or select "External Build System". For the "Build Tool", provide the location of your `dotnet` installation. For me, this is `/usr/local/share/dotnet/dotnet`. Create the project in any directory you wish; for convenience, you may want to create a folder in your cloned Ryujinx repository named `macos-xcode` or similar. +3. With your project created, for the build Arguments, substitute `build -c debug src/Ryujinx` (If you have better knowledge of Ryujinx dotnet build arguments, please put whatever here for your preferred Ryujinx build settings. This is just the most minimal way I found to get it building without poring over Ryujinx build scripts). For the directory, browse and pick the base directory for your cloned Ryujinx repository that contains the `Ryujinx.sln` file. Uncheck "Pass build settings in environment." +4. Optionally, add all project files to the project with "File->Add Files to...", creating folder references and selecting the build target. +5. Build the project. +6. Tell Xcode the binary you want it to debug by navigating to Product->Scheme->Edit Scheme. Under Info, then Executable, select Other.... Then, at the prompt, navigate to your repository folder, then the binary location. In the example from step 3, this would be `/src/Ryujinx/bin/Debug/net8.0/Ryujinx`. +7. At this point, Ryujinx should be building properly, and launching and harnessing properly within the Xcode debugger. However, we're not done yet! + \ No newline at end of file