epicmeme546 e10ef60fd5 Keep the driver's cache of stage libraries warm, link a missing pipeline instead of skipping its draw, and count the texture cache's waits in time.
The preparation builds every stage library once so the driver's disk cache holds it and a library a draw needs later takes under a millisecond. Turning dynamic vertex input off for AMD's RDNA 3 and newer driver changed the dynamic states every library lists, which gave each one another entry in the driver's cache, and nothing built them again: an update carried the prepared shaders over without the driver step. On an RX 7900 XT (26.10.1) all 42,142 prepared libraries were cold, 93 ms a vertex and 242 ms a fragment library on average. With no pipeline recorded, a walk through a village skipped 11,180 draws while their pipelines built and made 94 draws wait 5.5 s in all, four of them 1.0 to 2.0 s; a player's session log shows up to 114,834 draws skipped in 600 frames and 181 waits of 251 ms on average. Skipped ground and walls appear and disappear, and a skipped lighting pass is a black frame with the interface intact.

- The game checks the driver's cache at every start (vk_pipeline.c lw_start): a sample of the prepared fragment libraries is built, and when their median time says the cache is cold the whole prepared list is built into it again on idle-priority threads while the game runs. shader-warm.txt records a warm in progress, so the next start goes on with one a run ended, and stops the tries on a driver that does not keep the libraries. This also covers a driver update and a cache the driver emptied.
- An update that carries the prepared shaders over runs the game's --warm-shaders (tools/make_game.py warm_driver_cache): 11 s with the libraries there, about 8 minutes with all of them cold on that card.
- A draw whose pipeline is missing waits for its fast link from a budget of 6 ms a presented frame, 3 ms at most each (NX2NAVI_PIPE_LINK_MS), before it is skipped: with warm libraries the link is done within that.
- Full-screen draws wait from their 50 ms budget again instead of being skipped (NX2NAVI_PIPE_SKIP = any is the default; fullscreen stays selectable). With warm libraries the wait is a millisecond.

The same walk afterwards: libraries 0.3 and 0.7 ms on average, 1,605 draws skipped, 1,473 of them in the scene's first 600 frames and 8 to 80 in each 600 after, and 19 waits of 60 ms in all. First visits to four other saves (a mountain pass, the Lost Woods, Kokiri Forest, a river) waited 12 to 84 ms in all except the Lost Woods, where mesh shader pipelines, which have no stage libraries, and vertex libraries that need added outputs still compiled once: 23 waits, 2.1 s in all, the longest 776 ms.

The texture cache counted its waits in presents chosen at 60 a second: at 165 presents a second the 1800 that stood for thirty seconds were 11 s, so a released render target went sooner than meant and a texture out of view for 11 s was retired and showed its stand-in for some frames when it came back. The counts are now taken times the present rate over 60 (presents_for), and a texture is retired after two minutes without a sample instead of thirty seconds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 01:36:29 -05:00

NX2navi

NX2navi

Join the official NX2navi update discord server: https://discord.com/invite/uf6gSrsPpq

NX2navi is a static recompilation of The Legend of Zelda: Ocarina of Time for Nintendo Switch 2 (game version 1.1.1) into a native x86-64 application for Windows, with a Vulkan renderer (docs/architecture.md).

Important

No game files are included. You need your own legally obtained copy of the game, dumped from your own console. Instructions for obtaining those files will not be provided.

The game is built from your files on your machine, so the result contains the game. It is for your own use. Do not share it.

Status

Early development, playable. Kokiri Forest, Kakariko Village, Death Mountain Trail and its crater, the Temple of Time and the Great Fairy fountains play at 60 fps and above on current GPUs, from the title screen and from saves. Visual bugs and occasional crashes are still expected (Known issues).

Report problems as issues, following CONTRIBUTING.md.

Features

  • Native code, not emulation
  • 60 fps by default, or a limit of 30 to 240 fps, the display's refresh rate or unlimited
  • Native widescreen and ultrawide (the window's shape, 21:9 or 32:9) with the HUD, menus and movies kept 16:9
  • Game resolutions from 1080p to above the game's 1440p: 1800p, 4K, 5K or the window's own size, sharp on high-DPI displays
  • Upscaling and anti-aliasing: NVIDIA DLSS (DLAA, Quality, Balanced, Performance, Ultra Performance; RTX GPUs) or AMD FSR 3.1 (Native AA and the same modes; any GPU), which render the 3D scene at the mode's share and keep the HUD sharp; or AMD FSR 1 or bilinear scaling to the window, with a sharpness setting; black bars or stretch
  • Frame generation: NVIDIA DLSS Frame Generation (RTX 40 and 50 GPUs, paced with Reflex) at 2x, or 3x and 4x on RTX 50 GPUs (one, two or three generated frames for every frame the game draws), or AMD FSR 3.1 (any GPU), a generated frame between every two the game draws, with the HUD kept out of it, for about twice the frame rate on a fast display; in a window of another shape than the picture, frames are generated inside the picture only, so the black bars stay clean. With frame generation on, the frame limit counts the frames on screen, and with no limit chosen it is the display's refresh rate. The frame limit can also be handed to RivaTuner Statistics Server
  • HDR on HDR displays: the game's own native HDR, or its SDR picture tone mapped to the display's peak, with exposure, highlights, shadows, contrast, saturation and gamma in the menu
  • The game's known shaders prepared when the game is built, and the pipelines met in play built again in the background at each start, so play rarely stops to compile them; a shader or pipeline met for the first time can still hold a frame, and a draw that must wait for its pipeline has it built on worker threads, never on the game's drawing thread
  • In-game settings menu (F1, or Minus and Plus together on a gamepad) and performance overlay (F10)
  • Keyboard, mouse and gamepads with remapping, Nintendo, Xbox or PlayStation button layout, rumble and gyro; the game follows whichever connected gamepad you press, and DualShock 3 controllers are read directly when enabled
  • Xbox, PlayStation and keyboard and mouse button prompts in the game's own text, drawn on your PC when the game is built; the keyboard prompts follow your key bindings
  • Stereo or 5.1 surround sound output, on the output device of your choice; the default microphone for the game's microphone input
  • The monitor the game opens on, straight in fullscreen when fullscreen is on
  • Your Discord status shows "Playing NX2navi" with the play time (on by default; the Game tab of the menu or the launcher's Settings turns it off)
  • Docked or handheld console mode
  • The game's textures stay compressed (BC3, about half the video memory at the same speed) unless the PC has 20 GiB of video memory and 48 GiB of RAM, as Windows counts video memory against the system's commit limit

Installing

Download NX2navi-Setup-<version>.exe from the releases and start it next to your .nup dump. It is the only file you need. The launcher it installs finds the dump, downloads the build tools, builds the game on your PC (10 to 25 minutes, once) and starts it; afterwards it keeps the port up to date and rebuilds only what changed (docs/launcher.md). docs/README-BuildKit.md describes the same build by hand, docs/building.md building from source. Settings are in the in-game menu and in nx2navi.ini (nx2navi.ini.example lists every key). Controls: docs/controls.md.

Requirements: Windows 10 or later; an x86-64 CPU with SSE4.2 (AVX2/FMA machines get a faster build); 16 GB of RAM; about 30 GB free for the game and 1.5 GB for the launcher and its tools; a GPU with Vulkan 1.3, VK_EXT_external_memory_host and VK_EXT_mesh_shader. The setup is not signed, so SmartScreen warns on its first start.

Known issues

  • The first start after an install or update, and the first visit to an area, can pause briefly while the graphics driver builds what it has not seen; later starts are smooth.
  • Machines with 16 GB of RAM can run out of system memory in Hyrule Field.
  • Integrated AMD GPUs can fail at the title screen (their host memory heap is too small for the game's memory).
  • A rare crash in the game's particle code.

License

The source is public to read. Its additions and changes are all rights reserved (LICENSE-ADDITIONS): no part of them may be copied or published without written permission. The base import stays under its MIT License, and third-party code keeps its own license (THIRD_PARTY_NOTICES.md). No license grants anything for Nintendo's game.

NX2navi is an independent, non-commercial fan project, not affiliated with or endorsed by Nintendo. The Legend of Zelda, Ocarina of Time and Nintendo Switch are trademarks of Nintendo.

Building from source

docs/building.md lists the toolchain and the steps. tools/make_game.py also builds the game natively on Linux (docs/README-BuildKit.md, "Linux"); the launcher and the setup are Windows only. Everything the build writes stays under build\ and generated\, which git ignores; run tools/check_content.py before a commit.

Description
A mirror of NX2Navi for safe keeping
Readme MIT 102 MiB
Languages
C 70.1%
Python 23.7%
C++ 3.6%
C# 1.7%
GLSL 0.7%
Other 0.2%