Other languages | Status | How to build | How it works | Want to help? | Credits | License | Discord
Leonida is a static recompilation project. The Xbox Series CPU is x86-64 like a PC, so the game's code is loaded and run natively, and the console's system software is reimplemented. The console's precompiled RDNA2 GPU programs are translated to SPIR-V for Vulkan. The game's models, textures and audio are read from your package. All of this happens on your PC, from your own copy of the game.
This repository does not contain the game, keys or an executable, and it does not explain how to get them. You need your own copy, with its files already readable on disk. Nothing here decrypts or works around any protection. Everything the build creates (the generated shaders, extracted assets, the runtime folder and your saves) comes from your game and stays on your PC. Never share those files.
Early. The game does not boot yet. Everything that can be done without the game's executable is in place, so work on booting can start as soon as one is available to a developer.
The table above is written by hand. To measure it on your own checkout (unit and runtime tests, which rows of the translator contract were confirmed on a GPU, measured imports, your corpus counts and, with --github, CI and the D3D- items), run python -I tools/progress_dashboard.py --out and open progress.html (notes).
Nothing is playable on any platform yet (see Project status). What runs where today:
GPU results from every platform are collected in #166; how to run the tests is in docs/testing.md.
The port isn't downloaded ready-made. It's built on your PC from your own copy.
It finds your copy of the game by itself: it looks in Downloads, Desktop, Documents (also where Windows keeps them, such as in OneDrive), Games, your home folder and the top of every drive, two folders deep. It recognises the version from a few file sizes, without reading anything large. If you have more than one copy it asks which one, and if it finds none it asks you to paste the folder. Before starting it checks that everything below is installed and that there is enough free space, and it lists anything missing in one go. The result goes to Documents\Leonida. A stopped build continues where it left off.
Your game folder is the one that holds MicrosoftGame.Config and the .rpf archives, as plain files.
Low disk space: the ~350 GB figure is for the full build. To run the port, --stages check,shaders,runtime needs about 30 GB; the assets stage (~300 GB) is only for the asset tools, and --wav adds several times the Ogg Opus size (the preflight prints this choice when the assets stage is what does not fit). --work and --out can sit on another drive. The runtime maps the package in place, so a read-only package drive needs gta6rt --overlay ; --overlay is a gta6rt option, not a make_game.py one. Leave the .s files in work/shaders/dxbc/disasm in place: deleting them, along with the translated work/shaders/spirv/index.json, can leave the shaders stage looking finished with zero shaders. A disasm folder that is a symlink is refused when the stage has to clear it.
From a terminal, with the same behaviour and more control:
python -I make_game.py --find # list the copies found on this PC python -I make_game.py --pick # choose the game folder in a folder dialog python -I make_game.py --check # check your copy, build nothing python -I make_game.py --check --full-check # also compare SHA-256 of every file (slow) python -I make_game.py --game "D:\path\to\your\package" --out "D:\Games\Leonida" --work "E:\leonida-work" python -I make_game.py --stages shaders,assets # only some stages python -I make_game.py --game "D:\path\to\your\package" --wav # also decode Opus to PCM WAV (large) python -I make_game.py --wave64-emulate off # auto (default), on or off; see below --wave64-emulate decides whether wave64 compute and mesh shaders are translated to be exact on any subgroup size (see "Wave64 emulation" in docs/design.md). NVIDIA and Intel GPUs have 32-wide subgroups and need it. The default, auto, asks vulkaninfo (part of the Vulkan SDK) and turns emulation on if any GPU lacks 64-wide subgroups or its subgroup size is unknown. It also checks whether the runtime's GPU can run compute and mesh shaders 64-wide. With --mesh-compute, only compute subgroup support is needed.
On AMD's Windows driver, auto uses native wave64 on RDNA1 and RDNA2 when the runtime's GPU supports it, even if another GPU is 32-wide or vulkaninfo is unavailable. That driver can crash on emulated LDS code (#857). For RDNA1 cards without mesh support, the decision uses the compute stage, which can run wave64 without native mesh support.
The mode is saved next to the translated shaders, and changing it translates them again. auto can normally reuse previously emulated shaders. The AMD Windows workaround rebuilds those shaders in native mode. Use --wave64-emulate on to force emulation or --wave64-emulate off to force native wave64.
Four fallback flags are forwarded to the translator the same way, saved next to the translated shaders, and changing them translates them again: --no-float-controls (drop SignedZeroInfNanPreserve, for devices whose pipeline check skips a shader without shaderSignedZeroInfNanPreserveFloat32; needs PR #664's translator flag), --bary-fallback (read raw barycentrics from an interpolated input, for devices without VK_KHR_fragment_shader_barycentric), --texel-offset-fallback (fold image_sample*_o offsets into the coordinate, for devices without VK_KHR_maintenance8) and --mesh-compute (mesh shaders as compute, for devices without VK_EXT_mesh_shader). Each is documented in docs/design.md.
The build records which llvm-mc command and version produced the disassembly. Changing either, or reusing a work folder that predates this record, reruns disassembly and translation while keeping the extracted shader inputs.
The build records which translator sources produced the shaders. A change to those files reruns translation using the saved disassembly. Older work folders need one translation after upgrading to record this information.
The build also records which decoder (the third_party/rpf9-explorer commit and the tools/rpf9dump sources) exported each archive's models and textures. When it changes, the assets stage removes that export and makes it again. Older work folders have no record, so their models and textures are exported once more after upgrading.
Stages run in order: check, shaders, assets, runtime, pipelines (creates every translated shader on your GPU driver and checks that it compiles, reports any it has to skip, and saves a pipeline cache to pipeline_cache.bin in --out; the runtime doesn't load that cache yet, so it doesn't speed up the first boot). The shader translation is the longest step: it runs on --jobs processes (half the CPU threads by default).
--wav is off by default because 16-bit PCM WAV is several times larger than Ogg Opus. It decodes the repackaged Ogg Opus streams to work\assets\audio\wav after the audio bank step; existing WAV files are skipped when a build resumes.
With CMake 3.24+, a C++20 compiler, and Vulkan development headers and loader installed:
cmake -S runtime -B runtime/build/linux cmake --build runtime/build/linux --parallel ./runtime/build/linux/vk_pipeline_check /path/to/spirv Pass the directory containing index.json and the translated SPIR-V files to vk_pipeline_check.
make_game.py runs on Linux too. The pipelines stage uses the vk_pipeline_check built above (runtime/build/linux, or runtime/build), and builds it there itself before any other work if it is missing.
The loader is a Windows program and runs under Wine or Proton; CI runs its tests under Wine on every change to runtime/ (the wine job of the Runtime workflow). On Linux the runtime stage cross-builds it into runtime/build/windows with clang-cl and lld-link (LLVM 19+, but not 22.1.7 or 22.1.8, see docs/testing.md; plain names, or all five LLVM tools with one version suffix such as clang-cl-21) against the MSVC CRT and Windows SDK that xwin lays out, in XWIN_DIR or ~/.local/share/xwin-sdk (docs/testing.md has the one-time xwin command). Without them the stage is left out of the default stages, and asking for it lists what is missing before any work starts. A Windows build made elsewhere works too, such as the runtime-windows artifact of that workflow's windows job, unzipped:
python3 -I make_game.py --runtime-build ~/Downloads/runtime-windows Either way it copies gta6rt.exe and gta6rt_tls_host.dll into --out and writes gta6rt.sh next to them, which starts gta6rt.exe with wine, or with the Wine named by WINE (for Proton, its files/bin/wine). The same option skips the build on Windows.
The translator's runtime contract (user SGPRs, push constants, memory model, bindless images, vertex fetch, system values) and all the format notes are in docs/design.md; the format, asset, runtime and validation notes are indexed in docs/README.md. The Xbox D3D12 plan is in docs/d3d12_vulkan.md. Audio bank formats and the export tools are in docs/audio.md; docs/related_projects.md records the prior art we may read and the licence limits on it.
See CONTRIBUTING.md. Never attach game files, extracted assets or generated shaders to issues or pull requests.
Grand Theft Auto and all related names are trademarks of their owners. This project is not affiliated with or endorsed by them.
GPLv3 (or any later version). See LICENSE. Third-party code keeps its own license.
Leonida Is A Native PC Recompilation Of The Xbox Version Of Grand Theft Auto 6




