Commit Graph

1045 Commits

Author SHA1 Message Date
chrg6
cae09a2bcd Add floor_watch: hardware watchpoints on the floor the scan finds log which game code reads and writes it, at 60 fps and again at 120 fps or more.
floor_watch.c takes up to twelve of the floor scan's survivors (the platform's rigid body controller unit first, then one per object at the pivot's height), watches them four at a time through the debug registers on every thread (platform.h plat_watch_set, Windows only), counts each access's call chain in a lock-free table and logs the chains with the executable's symbol names after each pass. prof_syms gains a callback form for that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:08:49 -05:00
chrg6
c84724da2c Make a moving floor carry Link above 100 fps as it does at 60 (set ofollow, floor_carry = 1).
The character controller's three follow-surface modules kept only a tenth of the floor's velocity whenever the physics' inverse step passed 100, which every update above 100 fps did. The gate now compares with 100 over frames per update from the patch page above 60 fps, and with the game's 100 at 60 and 30 fps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:08:49 -05:00
chrg6
d9429b0c00 Break the memory report down past VMA, by owner in system memory, and by growth over a session.
Every report adds a line for video memory outside VMA (the driver's usage and budget per heap against VMA's blocks, and counts of pipelines by kind and by last use, stage libraries, compute pipelines, layouts and descriptor pools, with the swapchain, DLSS and FSR sizes), a line that splits the process's commit by owner (the game's heap and maps, device-local memory, VMA's host blocks, the C runtime heap with the shader caches, pipeline tables, texture cache, log queue and flight recorder in it, the driver's pipeline cache data and the rest), and a line naming what grew by more than 64 MiB since the report before and since play began. Every ten minutes of play and at exit a ranking line orders the categories by growth and marks those that only climbed; tests/mem_growth_check.py checks that bookkeeping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:46:31 -05:00
chrg6
a74503cd86 Add physics_steps = 2: at least a 60 fps frame's solver steps in every update on 1.1.1.
Link is carried by the Deku Tree's floating platform fully at 60 fps, about a tenth at 160 and not at all at 240,
which follows the solver steps an update (4, 2, 1 with physics_steps = 1) rather than those a second. The new set
osolverfull raises the rounded-up count to the 60 Hz frame's 4 in every update; physics_steps = 2 switches it on and
osolver off at start, and the mode is logged. 60 and 30 fps keep the game's 4 and 8. It costs more physics time above
60 fps: 576 solver steps a second at 144 fps and 960 at 240, against 288 and 240 with 1, the default, which stays
until a run confirms the carry. frame_step_check runs the lifted words of all three counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:26:39 -05:00
chrg6
b912d72b87 Remove the Video memory use row; its low behaviour is the only one now.
Released textures go once they have gone unused for the hold, and what a switched-off upscaler or SMAA held is freed, with no setting to keep them. A vram_use line left in a settings file is known and read by nothing. Memory use is to be decided by the card's and the system's budget instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:23:01 -05:00
chrg6
75ae5b0221 Read co-op's switch by its new name, coop_steam, in the launcher too.
Main renamed the switch so that an old "coop = 1" turns nothing on; the launcher's check for Steam's library still read the old name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:07:26 -05:00
chrg6
b399d8f15c Keep a late HD rumble report from opening a Joy-Con pair again after the stop.
hd_tick picks a report under the locks and writes it to the pair after letting them go. When input_rumble_hd_stop
wrote the neutral value and closed the pair in between, that write opened the two devices again and left the
Joy-Con vibrating after the exit. The stop now ends the pair (hd_pair_end), and hd_pair_write checks that under the
lock it holds for the write, so nothing is written after the stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
d59488d308 Claim the anti-aliasing setting's frame with a compare-and-swap, so SMAA's idle images are freed once.
vk_aa_mode is asked at every compute dispatch, on whichever thread records it, and the replay workers record at once.
The frame was checked and claimed without atomics, so two threads could both free the idle work images. The first
call of a frame now claims it with a compare-and-swap, and only that call frees them and takes the setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
721da64866 Put Steam's library file beside the game only with co-op on, and look for it off the window's thread.
Every Play ran steamlib.ensure on the Tk thread, co-op on or off. Without the file that walks up to 60,000 folders
of the player's Steam libraries and checks signatures, and the window stood still meanwhile. Play and the Steam
shortcut's start now call it only when co-op is on in the game's settings (steamlib.wanted, read as the game reads
them), and Play runs it on a thread of its own and starts the game from the window's thread when it is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
0e76baad36 Limit replay_small to 0..63, where it can match a group.
A group too small to share out has fewer than 64 draws (2 x CHUNK_DRAWS), so a threshold of 64 or more never matched
in group_start and the setting did nothing. The setting's range is now 0..63, the menu's slider ends at 60 in steps of
4, and a value of 64 or more from nx2navi.ini reads as 63 with one line in the log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
e7dead8663 Take the low-latency lock around AMD's anti-lag calls, so the switch-off is the driver's last word.
The stage calls ran on guest threads and the present thread without the lock the NVIDIA path holds, and a stage call
with the mode on could come after the switch-off on another thread and leave the driver on. The stage calls now hold
the lock shared and make none once the path is off; the switch-off holds it exclusively and waits for a stage call in
flight. Shared, because the input stage waits inside the call while the present thread makes the present stage of the
frame before, which must not wait for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
c656532cd3 Warn in the log when replay workers are set by number on AMD's driver for RX 6000 and older.
The automatic count gives that driver no workers, since a game with workers lost its device there, but a number in
nx2navi.ini or the menu starts them without a word. The number still applies; the log now says that workers on this
driver have caused device loss and that auto or 0 avoids it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
5c5b1914d5 Keep the sizes frame generation still uses when the upscaler's idle sizes are freed.
With frame generation and no upscaler, idle_release freed every DLSS size other than the last one at each present
from 600 presents after the switch, without waiting for the GPU. The scene's size can change from frame to frame, so a
size the frame before used could still be in flight. A size now goes only after it went unused for as many
evaluations; its DLSS feature, unused since the upscaler went off, is released as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
e682934bd0 Write the log file before stderr, and keep a blocked console from stopping the log and the exit.
A selection in the console window of a game started directly held back the write to stderr, and with it the log
file, the exit hook and the crash report. The log file now comes first, stderr goes past the C runtime's stream lock,
and the lines of an exit, a fatal error or a crash skip stderr while another thread is stuck in it. A game run turns
the console's QuickEdit mode off, and a closed console, Ctrl+C or Ctrl+Break ends the game the way a closed window
does, with the settings and saves written and the exit logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:06:27 -05:00
chrg6
175033d49a Merge main's co-op switch name into the 0.10.0 line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	runtime/cfg.c
2026-11-13 05:58:46 -05:00
chrg6
97f1caa9b4 Of one GPU listed by two installed drivers, take the newer driver's listing.
On a laptop with the vendor's processor graphics and a card of the same vendor, both installed drivers list the
card, and pick_device took the first listing of the best device type. That listing can come from the older driver
installed for the processor graphics, which was reported to crash in its shader compiler with the card. Among
listings of equal rank with the same vendor and device ID, the one with the higher driver version is taken now, and
the log says so. A GPU chosen by index or name is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:54:58 -05:00
chrg6
328554e7c6 Run the sound manager's job at 60 Hz with whole steps above 60 fps.
The job (main+0x415300) hands the time manager's step to the sound system in its phase 0 and runs the sound objects'
and the system's updates in phases 1 and 2. With the set ostep that step is a fraction of a frame above 60 fps, and fed
fractions the game has been reported to keep sounds held after an area unloaded until no voice was free, new sounds
and then the music going silent until a restart. The new set osound (sound_steps, on by default) calls the page's
+0xf10 after the job's prologue: phase 0 adds the step to what the job is owed and runs once a whole step has built
up, phases 1 and 2 follow that choice, and a job that does not run gets phase 3, which returns through its own
epilogue. After phase 0's load of the step the page's +0xf00 makes a fraction one whole step. At 60 fps and below
the job runs every frame with the game's step. Both sites were checked against the module; frame_step_check covers
the gate at 60, 30, 144 and 240 fps. Needs the game code generated again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:54:58 -05:00
chrg6
f512a98988 Give the water and floor surfaces' fixed-step remainders as many slots as the waters' ripples.
Every interactive floor of a place and both water managers ask frame_rate_sim_host once an update, each for its own
object. With 8 slots, a place with more such objects than that had them take each other's slot in turn, start
without a remainder every update and stand still above 60 fps, as before the set owater. The table now has 64 slots,
as the ripples' has, and frame_step_check runs 32 surfaces at 144 fps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:54:58 -05:00
epicmeme546
a01910d905 Give the new co-op's switch a name of its own, so an old "coop = 1" turns nothing on.
The Steam co-op took the setting name of the old beta's switch, coop. A player whose nx2navi.ini still had coop = 1 from that beta got the new co-op switched on at the first start of the new build, unasked: the game signed in to Steam as its test app. The switch is now coop_steam (NX2NAVI_COOP_STEAM), off by default, and coop is a retired key like the old co-op's other settings: known, read by nothing.

--probe-cfg now loads a file of the old co-op and checks that its keys are no unknown keys, that coop = 1 leaves the new co-op off, and that coop_steam = 1 turns it on; it passes on a build of this commit. The game itself was not started with the change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 05:30:56 -05:00
chrg6
2f7ddc884b Let the floor scan dump the owner of the platform's position and the objects that refer to it.
Scan run 2 showed the platform moving at full speed above 60 fps while Link stays behind, so the fault is in what
carries him. Once the scan has its survivors, it logs the 0x500 bytes around the one deepest below Link, names the words
there that point into main's data (vtables), and walks the heap once more for the words that point at the starts of
the nearest objects, each logged with its own object's vtable, so one run names the classes to trace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:10:43 -05:00
Tobim6
1eadef609e Put textures and allocations past a full video memory heap only in another device-local heap, never in system memory.
On an RX 580 the second device-local heap (2 GiB) takes what the first has no room for. On a GPU with one device-local
heap (an RTX 3050 Laptop, 4 GiB, 16 GiB of RAM) the budget wrapper and the texture placement sent everything past the
heap's reserve to system memory instead: 4096 and more texture images and every other allocation, held in the
process's commit (21 GiB). The system's commit ran out (31730 of 32023 MB), host memory imports failed, a pool was
left without a GPU buffer and the GPU wrote through its address: device lost. Now an allocation leaves out a full heap
only when another device-local heap has room, and a texture's second step allocates as before, past the budget, where
the driver keeps it in video memory or moves it out itself, and NX2navi's own VRAM pressure drops textures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:09:47 -05:00
chrg6
a7e79b3460 Bring the line's floor scan into the co-op branch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:54:51 -05:00
chrg6
27dae195ab Arm the floor scan only on a sideways drift and keep what lies below Link, logged once a second.
Scan run 1 armed on a floor that only sinks and found points 3.4 m above Link that follow him (the camera's). The scan
now arms on a straight horizontal drift at a steady height, snapshots from 4 m below Link to 0.5 m above, keeps the
triplets that moved with him and lie more than 0.3 m below him or more than 0.5 m from his feet, and logs each of them
(64 at most) once a second with its move over that second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:45:52 -05:00
chrg6
da65aa6099 Bring public main's Steam co-op, the removal of the old co-op and the launcher's Steam library file into the 0.10.0 line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:37:01 -05:00
chrg6
2970b0c7d6 Add a floor scan that finds the floor carrying Link in guest memory on 1.1.1.
The Deku Tree's floating platform is not one of the engine's ground groups, and where its position lives is not known.
With floor_scan set (off by default), once Link has been carried at 60 fps for 30 frames with the left stick at rest,
one snapshot of the game's heap and alias regions keeps every float triplet near him; 30 frames later the triplets
that moved as far as he did are kept, and from then on each frame logs the twelve of them farthest from him with their
addresses, positions and moves. The snapshot logs how long it took.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:36:29 -05:00
chrg6
652ed4dcce Let the floor probe list moving ground groups first, within 12 m of Link.
Run 5 named only the four nearest groups, and the still map pieces nearer to Link may have crowded out the platform's
group, whose translation is its pivot rather than its surface. A line now names up to six groups within 12 m: those
that moved since the last present first, then the nearest still ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:30:20 -05:00
chrg6
cdb3c59304 Let the floor probe give the time manager's step and first two time categories on each line.
The game derives every time category from the patched frames per update (main+0x3b4e300 and main+0x2c84c make the
inverse, seconds and rate from it), so the lines can show whether what a floor's motion reads matches the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:28:59 -05:00
epicmeme546
e60677ed87 Have the launcher put Steam's library file beside the game, so no player fetches it for co-op.
Co-op loads steam_api64.dll from beside ocarina.exe, and the repository may not hold that file. Before Play and before a start from the Steam shortcut, when the file is not there, launcher/steamlib.py now copies one: one a release ships in its bin folder if it has one, else the newest one in the games of the player's own Steam libraries that Valve signed (WinVerifyTrust and the signer's name) and that has every call runtime/steam.c uses. Nothing is downloaded, the search takes a second or two once, and with no Steam or no suitable file the game starts as before and the Co-op tab says what is missing. The tab's two texts about the file say so in the four languages.

Checked: four new tests on made-up library folders (too old, unsigned, too deep, a second library, a shipped file first, none said once) and the launcher's 190 tests pass; on this PC the search found 40 files in 1.2 s, 25 suitable, and copied a Valve-signed one; that file's library version, an older one than the game was run with, signs in as app 480 and makes a lobby in a program without the game. Not run: Play in the launcher itself with this change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 04:24:56 -05:00
chrg6
791ab8638e Let the floor probe name the four ground groups nearest to Link each present, moved or not.
The last run found no moving group near the drifting platform, which leaves open whether its drift is a ground group
at all. Each line now gives up to four groups within 8 m with their translation and move since the last present, and
with none that near, one line in 30 presents still gives Link's position and move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:21:33 -05:00
epicmeme546
cd2f9f12be Add an experimental co-op through Steam: rooms, invites, names in the world, chat and shared progress.
Up to four players, each in their own game and save, meet in a room. Rooms are Steam lobbies and the games talk through Steam's networking, so nobody forwards a port and nobody runs a server. The game signs in to Steam as its test app (480), so Steam shows the player as playing Spacewar. Off by default; the menu has a Co-op tab with Create a room, Join a room by its ID, Invite a friend, the players, chat and Leave, in English, Russian, Brazilian Portuguese and Simplified Chinese.

runtime/steam.c loads steam_api64.dll from beside the exe at run time and declares the C functions it calls itself; nothing of the Steamworks SDK is in the repository, and a player copies the file from a Steam game they have. runtime/coop.c is the room: the lobby's owner is the host, lets games of the same protocol and game build in and lists them, and every game takes positions, chat and progress only from the players on that list. runtime/coop_game.c reads Link from the Player actor and shares progress, items, songs and quest items through the game's own flag routines, each value only ever raised; small keys, rupees, ammunition and hearts stay each player's own, and the save is copied to coop-backup before anything of a room reaches it. The other players show as a name with a distance where their Link stands, projected with the upscaler's camera.

One Steam account cannot be in a lobby twice, and this PC has not the memory for two games, so the room and the game side were run with one game and tests/coop_peer.py as the second player over runtime/coop_local.c, a stand-in for Steam on 127.0.0.1 that only the environment turns on: the peer was let in, saw the game's Link in Hyrule Field, chat went both ways, the save was copied, one flag the save lacked was set and a flag the game does not share was refused. On Steam itself one game signed in as app 480, made a room, showed its ID and the player's Steam name on the Co-op tab and left. Not run: two Steam accounts in one room, an invite, a join by room ID over Steam, a host that leaves, a removal, and the menu's text probe on this build.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 04:16:17 -05:00
chrg6
0d7289af11 Let the floor probe read all of the Deku Tree's ground groups cheaply in two batched copies a present.
The manager there holds 5345 entries, which the 512 cap skipped. The probe now checks the entries' range once a present
and copies them and the rows of the groups they name (those in the guest heap) with mem_copy_readable, which takes one
lock and no system call per read; the cap is 16,384 again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:15:41 -05:00
chrg6
fa17076ea6 Keep the floor probe cheap: walk the ground groups only with a player, at most 512 of them, one read each.
Every read checks the address with a system call, and before the save loads the probe read a count from a manager that is not one yet: up to 16,384 groups a present made every frame about 1.9 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:10:22 -05:00
chrg6
a9f161579b Add a floor probe that logs Link on a moving floor each frame on 1.1.1.
Above 60 fps Link stands still on the Deku Tree's floating platform while it moves under him, and the code that carries
him is not found yet. With floor_probe set (off by default), each present logs the frame's step, Link's position and
how far he moved, and the nearest moving ground group of the engine's ground manager with how far it moved, so one run
at 60 and one above it show where the carry is lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:04:05 -05:00
chrg6
750034b7fd Run the water and floor surface simulations at their own 60 steps a second above 60 fps on 1.1.1.
The physics' two water managers and the game's interactive floor simulation (the Deku Tree's ground webs) step their
surfaces in fixed steps of 1/60 s, as many whole steps as the frame's time holds, and drop the fraction, so every
frame shorter than 1/60 s ran none and the surfaces stood still above 60 fps. The new set owater (water_steps, on by
default) calls the page between the division and the game's cut, which keeps the fraction per object; at 60 fps the
count is the game's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 03:42:40 -05:00
chrg6
8b5e344765 Bring the 0.10.0 line's newest commits into the shader warm check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 03:40:22 -05:00
chrg6
13e6563236 Build the prepared shaders into the driver's cache at an update only when a sample says the driver lost them.
After an update that keeps the prepared shaders, --warm-shaders built all 42,000 of them into the graphics driver's
cache again: 10 to 20 s at every update on a player's PC while the driver gave every one back at once, and the full
build when it no longer had them (380 s there once, after a change of what they are built with). It now builds twelve
fragment libraries spread over the list first, into the driver's cache alone, as the game's check at every start
does, and builds the whole list only when fewer than three quarters of them came from that cache.

On copies of an install's caches (RTX 5090): with the driver's cache partly cold after a relink, 5 of 12 came from it
and the whole list was built (313 s); the run after it found 12 of 12 and built nothing more, the step taking 3 s.
lib_warm = force builds the whole list whatever the sample says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 03:40:21 -05:00
epicmeme546
c84c035939 Remove the co-op of 0.8.0: its runtime layer, relay, menu tab, settings, tests and docs.
The hidden beta shared story progress through a relay a player had to run and never showed the other players. A new co-op replaces it. Gone are runtime/coop*.c and their headers, the menu's Co-op tab and its texts in four languages, tools/coop_relay.py, the co-op tests, docs/coop.md, the [coop] section of nx2navi.ini.example, the --probe-coop mode, the coop trace item, and Monocypher, which only this layer used.

The old settings stay known as retired keys, so an nx2navi.ini that still sets them logs no unknown key, and they stay on the list of private settings, so a bug report keeps a room's secret, a relay's address and a name out. The platform layer's UDP sockets and fs_save_snapshot stay for the new co-op; cfg_ini_now and fs_profile_path, which nothing else called, are removed.

Checked: the game builds and starts, the menu shows its four tabs, --probe-cfg and --probe-fs pass, and the launcher's private-settings test passes. tests/save_share_check.py builds without its co-op stub; it cannot run from this worktree because the folder's path is longer than Windows allows, on main too.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 03:37:26 -05:00
chrg6
6a3c4d6ca2 Give replay_pipe its own row in the settings table again.
The comment added to the replay_workers row swallowed the replay_pipe row behind it on the same line, so every start stopped with "NX2NAVI_REPLAY_PIPE has no row in the settings table".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 03:05:00 -05:00
chrg6
a8332948f2 Bring the text speed setting from the 0.10.0 line into the VRAM pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:54:25 -05:00
chrg6
2bbdb25de7 Add a text speed setting for the game's message windows on 1.1.1.
The patch set text_speed scales the typewriter speed of a message the game lets the player skip (fast, three times as
fast, its scripted waits as long) or runs the game's own skip on the first frame of each page (instant). Messages the
game marks unskippable, such as those that turn their page on a timer, keep the game's speed. The setting is live and
has a row on the Game tab in all four menu languages; with it at normal the set is off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:53:22 -05:00
chrg6
58c7baaa9e Bring frame generation without an upscaler from the 0.10.0 line into the VRAM pass.
The release of what the upscaler leaves now waits for frame generation's own inputs too: in that mode the DLSS sizes
are made for frame generation alone while the upscaler does not run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:52:36 -05:00
chrg6
e0f69489af Bring the 0.10.0 line into the VRAM pass, keeping the line's own releases where the two overlap.
The line freed the upscaler stand-in's scratch images, FSR 1's and SMAA's images and the DLSS sizes on its own while
this pass did: its versions stay. Of this pass's versions, what they do not cover stays: the stand-in's views of a game
image it read as it is now go with that image (vk_tonemap_forget from vk_exec_image_gone, under a lock), and the
upscaler release frees only what the line's idle release leaves, the reactive mask's snapshots, the FSR upscale
contexts and the DLSS sizes after a failure, at the same 600 presents and with vram_use = high keeping them as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:50:21 -05:00
chrg6
e89cc4d430 Let frame generation run without a temporal upscaler, from inputs made for it alone.
With frame generation running and no DLSS or FSR upscaling, vk_dlaa.c arms and ends the frame in the same places and,
where the upscaler's evaluation would run, makes only frame generation's inputs (fg_only_frame): the scene's depth and
camera found as before, motion vectors from the same pass at the scene's size, no jitter at all, and the picture without
the HUD copied from the game's own scaled picture. DLSS Frame Generation and AMD's frame generation no longer need an
upscaler set; NVIDIA's through NGX still needs DLSS at the start and then keeps running when the upscaler is switched
off. The menu's Frame generation row stays usable with every Upscaling choice and the Upscaling row keeps frame
generation as set, with texts in all four menu languages. The log says at the start and at each change whether frame
generation takes its inputs from the upscaler or runs without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:49:30 -05:00
chrg6
691d41a026 Free the images of HDR, FSR 1 and SMAA once they are no longer used, instead of keeping them for the process.
Each made its images at the picture's or the scene's size the first time it ran and kept them until the process
ended, also after the menu switched it off:
- the HDR encode's picture and menu image (28 and 14 MiB at 2560x1440, 63 and 32 MiB at 2160 lines) now go when the
  swapchain is made without HDR, after a wait for the presents that may still read them;
- FSR 1's two images (56 MiB, 127 MiB at 2160 lines) go after 300 presents it did not scale, with the same wait;
- SMAA's three work images (35 MiB, 79 MiB at 2160 lines) go after 600 frames of another anti-aliasing, deferred past
  the submission being recorded.
Each makes them anew when it runs again; one log line says when they go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:46:26 -05:00
chrg6
fdaa3e2a01 Take a failed frame generator's swapchain and contexts down at the next present.
A frame generation failure turns it off for the run, but the present compared what is wanted with what runs only when
a setting changed, so AMD's swapchain and both of its contexts stayed until some other setting moved. A frame
generator that runs and is no longer wanted is now noticed at every present, and the swapchain is made again without
it, as when it is switched off in the menu. The other way round, wanted and not made, is still tried only at a
settings change, so a swapchain that cannot be made is not tried at every frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:44:33 -05:00
chrg6
839afa32ac Add a test setting that runs DLSS or FSR 3.1 before the bloom instead of after the tonemap.
Frame dumps show the upscaler reads the bloom composite's output, which the game has already exposed, bloomed and
tonemapped to 0..1. With dlss_prebloom = 1 it runs at the bloom chain's first pass on the scene's linear light. Without
upscaling its picture goes back into the light target. With upscaling the lens flares and the bloom composite are
drawn at the picture's size and that picture replaces the game's upscaler's output. Off by default; with it off
nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:44:07 -05:00
chrg6
c7de484a72 Free what DLSS and FSR hold some presents after the upscaler is switched off, and the HUD-less picture once frame generation is off.
Switched off in the menu or failed, the upscaler kept everything it had made for the process: per scene size its
output, motion vector, mask and sharpening images and a DLSS feature (81 MiB of images at 2560x1440 with DLAA, 182 MiB
at 2160 lines, and about 0.5 GB per DLSS feature), the reactive mask's snapshots, the HUD-less pair and the FSR 3.1
and FSR 4 upscale contexts. Eight presents after it goes off they are freed on the replay thread, which makes every
evaluation, after a wait for the device to be idle, as the code already does for a size it replaces. Switched on
again, it makes them anew with a new history, as any switch on does.

The HUD-less picture was made and copied every frame, and kept, after frame generation went off, since the flag that
asks for it was never cleared on Windows: the frame generator's release clears it now, and the pair goes once no frame
generation swapchain is up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:44:01 -05:00
chrg6
c6f2484ef9 Add Native (100%) to the Upscaling row: the scene drawn at the picture's own size with no upscaler.
The row writes scene_share = 1 with dlaa = 0, which the start already sized the render-target heap for; widescreen.c now
reads the share live, says when the heap needs a restart for it (the row's note and the Restart count), and logs the
scene size, the picture size and how the scene is scaled once the fixed share takes over and at each change. The
stand-in copies a scene of the picture's size texel for texel with a nearest sampler, and the performance overlay shows
Ocarina's real scene size instead of the other builds' placeholders. scene_share gets its settings row and its ini
text; the row's texts are in all four menu languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:43:03 -05:00
chrg6
ad58dfcddb Keep the fallback blit's scratch images for the sizes in use, and let the tonemap pass's views go with their image.
The scratch images of the fallback blit, one per size and format, were kept for the process, the first eight ever
asked for. Their sizes follow the scene's resolution, which DLSS modes, the dynamic resolution and a window or
picture size change move, at up to 32 MiB each at 2160 lines; a ninth size got no scratch and its blit was left out.
A new size now takes the place of the one used longest ago, which goes once the GPU is past the submission being
recorded, and never one the submission being recorded uses. The cache is under a lock, since replay workers record
blits side by side.

The tonemap pass's views were kept by image handle for the process, a game image's view naming a destroyed image that
a new image could get the handle of, and no view at all past sixteen. A view now goes with its image: at a scratch
image's replacement, and with a game image through the replay's image-gone hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:41:47 -05:00
chrg6
4882623ce7 Look the pool up again when its new mirror joins the mirror list, and count the table hand-over under the pool lock.
A mirror is made on the replay thread after a look at the pool index; a pool finalized on another thread in between
had no mirror to forget, and the new mirror then joined the list for a record already retired: freed twice, or
never. The index is searched again under the exclusive lock where the mirror joins the list, and a pool that is gone
has its new buffer deferred past the submission being recorded instead. The count of mirrors waiting for their table
hand-over is raised under the same lock that the finalize and the prologue take it down under.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:40:43 -05:00