Commit Graph
72 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 380e6ff30e Frame generation gets the per-object motion vectors DLSS uses, so Link running no longer shows a soft second outline and a trail in the generated pictures
The motion image FG read held the camera's motion alone (fg_motion called mv_pass without its object pass). The camera
follows Link, so his pixels carried the world's motion and the interpolation drew him twice, with a smeared strip where
he had been; NPCs and enemies did the same. fg_motion now runs mv_pass with the object pass (vk_mvobj_execute), and its
gates follow vk_objmv_wanted: DLSS once NGX came up (vk_dlaa_available, as before) or FG following the scene with its
objects (vk_fg_objects_on). vk_mvprev_frame keeps last frame's block tables for either, vk_usnap_begin makes the host
copy for either and vk_usnap_bytes reads the copy that submission wrote (FG turns on and off live), and
vk_dlaa_prev_camera answers whenever the scene is followed. FG is off with DLSS, so every DLSS gate evaluates as before.
fg_objects = 0 keeps the camera's motion alone for comparisons.

Measured on A (RX 9070, 7900X on 4 cores, 1080p, field, 60 s): 85.6 drawn with fg_objects = 0, 80.0 with 1 (about
0.8 ms a drawn frame on the replay thread, half of it the snapshot's host copy), object pass 0.035 ms GPU. Still grass
gets no false motion (SDK debug view: the game vector field stays within 0.2 px), and grass does not break up while the
camera turns. Validation: 0 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:30:51 +03:00
efee9bcf16 Frame generation gets a row on the Game tab under the frame limit (Off or AMD FSR 3) that applies at once, and the fps overlay reads "N fps drawn, M shown" while it runs
The row and its description (for displays of 120 Hz and more, the game at half the limit, about half a frame more input delay, not with DLSS or HDR) are in the menu's catalog for English, Russian, Portuguese (Brazil) and Simplified Chinese. frame_gen is live: vk_fg.cpp vk_fg_engine reads it again after a settings change, the contexts are made at the first frame after it is turned on (a hitch of about 0.1 s once), turned off they stay unused until exit, and gfx_present.c builds the swapchain again when the extra image for the pair comes or goes. The full overlay gets a Shown row. totk.ini.example describes frame_gen.

The shown-frames counter and the overlay lines follow PR #1089 by xellow78-lgtm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: xellow78-lgtm <336264245+xellow78-lgtm@users.noreply.github.com>
2026-11-20 13:48:10 +03:00
451813aa17 Frame generation shows its pictures: each drawn frame goes out as a pair, the generated picture once the GPU has drawn the frame and the game's half the smoothed interval later, and the game draws at half the frame limit while it does
vk_backend.c present_pair: both blits are submitted at once (gfx_present.c vk_present_blit_pair, the flip queue of two), the generated picture is presented after a timeline wait on the frame's last submission and not before the pacer's display time, the game's frame after a wait on the value after both blits and half the smoothed interval between generated pictures (factor 0.1) after it, as AMD's frame interpolation swapchain and Savage Wind's present_wait_turn do: spaced by the CPU clock alone both pictures went on screen together under FIFO and G-SYNC. The swapchain gets one image more while frame_gen names a generator, for the two images held at once; the present slots stay at two (each blit waits on the fence of the blit two before, the previous frame's same picture, already shown). The generated picture's blit lays the menu and overlay out, the game's draws them again; colour and FSR 1 run per blit; the flight recorder keeps the game's frames; the generated present carries no present ID. frame_rate.c frame_step_cap_ns halves the limit, 30 drawn at least, while the last frame went out with a generated picture, so menus and fades keep the whole limit; the real-time step follows the game's presents and stays the drawn interval. With frame_gen = off the present path is unchanged. "fg present" log lines give shown and drawn fps and the present intervals (mean, sd, p99, each half of the pair) in the world.

Measured on the RX 9070 and the 7900X on 4 cores, field save, camera turning, 1080p output: limit 120 immediate 117 shown and 60 drawn, intervals 8.34 ms sd 0.16 from generated to game's, 8.38 sd 1.71 back; FIFO at 144 Hz the same at 120, and 141 shown and 72 drawn without a limit; immediate without a limit 169 shown and 86 drawn against 94 drawn with frame_gen = off. Replay-thread cost 0.59-0.65 ms a drawn frame.

The flip queue, the pair blit, the halving rule and the present without an ID follow PR #1089 by xellow78-lgtm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: xellow78-lgtm <336264245+xellow78-lgtm@users.noreply.github.com>
2026-11-20 10:38:58 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a7275e6644 frame_gen names the frame generator, off or fsr3 (default off), instead of 0 or 1, so later generators (FSR 4 through AMD's DLL, DLSS) become values of the same setting
vk_fg.cpp vk_fg_engine is the one place that reads the string and maps it to VkFgEngine; an unknown value is off and logged once. The setting was never released, so 0 and 1 are not kept as aliases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:20:18 +03:00
1ea8838da9 Frame generation inputs and dispatch with DLSS off: the replay follows the scene for it, records the camera motion vectors and the SDK's prepare at the scene's end, copies the picture before the HUD sRGB-encoded as the window texture holds it, and runs the optical flow and the interpolation after the frame's window texture, nothing shown yet
vk_dlaa.c follows the scene while frame_gen is live and DLSS is off (track: the arming and end of the DLSS path, without jitter, reactive mask or per-object motion), fg_motion runs mv_pass on the camera alone and vk_fg_prepare, vk_dlaa_hud takes the picture before the HUD by PR #1089's rule once the bloom chain began, vk_dlaa_sub_end runs the interpolation at the end of the submission that drew the window texture. vk_fg.cpp reads the camera's planes and depth convention from the scene block's projection (standard depth, near 0.1 m, far 25 km in TotK 1.4.3), makes the contexts again when sizes or the convention change, resets the history on a cut (10 m or 35 degrees, as Savage Wind), a frame without camera motion and after any frame without a generated picture, and stays off with DLSS, replay workers, sync_ahead, HDR and while a menu background or a fade is open. fg_test, fg_debug, fg_shot and fg_times are the checks; GPU timestamps and the replay thread's recording time go to the log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Revivedx <82332536+Revivedx@users.noreply.github.com>
Co-Authored-By: xellow78-lgtm <336264245+xellow78-lgtm@users.noreply.github.com>
2026-11-20 10:09:58 +03:00
4e48669c86 FidelityFX SDK 1.1.4 frame interpolation and optical flow built into totk.exe behind frame_gen, contexts created and destroyed only, no frame-path change
The SDK subset, its compat header and the SPIR-V shader header come from Savage Wind (MIT); tools/ffx_shaders.py regenerates the header with glslangValidator, build_game.py compiles the SDK sources with ffx_compat.h force-included, and runtime/vk_fg.cpp makes the backend, optical flow and frame interpolation contexts after the device exists when frame_gen = 1 (default 0, read at start).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Revivedx <82332536+Revivedx@users.noreply.github.com>
2026-11-20 09:40:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8c3831a1f3 The free camera is off by default behind its own switch, Free camera on the Controls tab (freecam_patch, read at start), so the camera update runs the game's code as shipped for players who never use it; the combo and key rows stay greyed until the switch is on and the game restarted, and the freecam set sits at the end of the 1.4.3 table so the sets before it keep their numbers (#1199)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 08:16:57 +03:00
Valiantsin DzerakhandClaude Opus 5.5 53f9e9bb5f Merge pull request #1213 into task/pr1213
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 08:13:57 +03:00
Valiantsin DzerakhandClaude Opus 5.5 02220fc879 The Tenbez Shrine launcher set has its own switch, shutter_fix, and sits at the end of the 1.4.3 table, so the sets after it keep their numbers and a lift changes one chunk; the comment names the second AI file that uses the node (#1215)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:02:34 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e90732bca1 Merge pull request #1219: contact shadows darken only the pixels the game's lighting puts in the sun, so caves and shade keep their light (itaskaev2, carries #439 by Specht2010)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:04:48 +03:00
Valiantsin DzerakhandClaude Opus 5.5 91aa744907 TOTK_TEST_PAD_RUMBLE_MS is read with cfg_get like TOTK_TEST_PAD, so a test gamepad without it no longer stops the game at start: cfg_int stops on a name with no row in the settings table (#329)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:53:19 +03:00
Valiantsin Dzerakh d87d43a4eb Merge commit 'refs/pull/1219/head' of https://github.com/valentderah/totk-pc-recomp into task/pr1219 2026-11-19 20:38:08 +03:00
lebomisandClaude Opus 5.5 29eec07245 ZL+ZR+L3 detaches the view from Link on 1.4.3 and flies it with the gamepad (freecam_pad)
The camera component update (main+0x628460) copies each component's eye, target and up into its sead camera. The site
freecam (main+0x6286d4, the load every path to that copy runs first) calls runtime/freecam.c freecam_hook, which
writes the component's one-shot eye and target overrides (+0x180, +0x198) while the free camera is on; the update
takes them in place of the pose and clears them, so the game camera's own state is never changed and resumes the
frame the free camera ends. The up vector is levelled through the component's up offset (+0x200), which is kept and
put back. Of the three components a frame updates, the hook drives the two that share the player camera's eye, leaves
the one at the default pose and picks again after a load; with the free camera off it does only the displaced load.

input.c freecam_gate latches TOTK_FREECAM_PAD (zl+zr+lstick when unset, none for no combo) like Minus+Plus and, while
the free camera is on, gives it the sticks, the trigger axes and L and R presses and the game nothing. The left stick
flies along the view and sideways, the triggers straight up and down, the right stick turns, each L or R press halves
or doubles the speed (0.25 to 512 m/s, 8 at the start); the flight follows the wall clock. TOTK_FREECAM_PATCH=0
removes the hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 13:32:22 +11:00
shinodanpenandClaude bb6523a080 The audio_drain_fix texts say when the game's guard fires: evenly paced audio frames, not any run above 200 fps (#337)
The texts that came with the audiodrain set (docs/settings.md, totk.ini.example, the comments in patches-v121.txt and
patches-v143.txt) said that above about 200 game updates a second the game switches its sound off. Every run behind
them had captured the mix with audio = none. With a device playing, on Linux with PipeWire, the game keeps its sound at
240 fps without the set.

The guard (1.2.1 main+0x9bcdc4) sets its count back to 0 whenever a free list is there (0x9bce00), which takes two
audio frames between two updates of the game. The mixer's timer renders one frame every 5 ms, so at 240 updates a
second that never happens and the count reaches 300. A device paces the render thread in bursts after each period
(audren.c, gap_ns: 4 ms apart on Linux; 0 on Windows, read from the code and not measured), so it happens several times
a second. Sampled on the render thread on Linux with PipeWire's 1024-frame periods: 200 frames a second either way, 76%
of them 4 ms after the one before with the device, 939 of 940 at 5 ms with the timer. The count and the switch have
not been read in a run.

The mixer also keeps time by its timer while a device takes nothing. Measured at fps_limit 240, same save and input
script, with the game's audio stream paused from outside (pw-cli on its PipeWire node, not a real device stalling)
while the game ran at 240 fps. On 1.2.1 with the set off a pause of 5 s (two runs) and of 2 s (two runs) left the game
silent to the end of the run, also after the device resumed, and a pause of 1 s (one run) did not; with the set on a
pause of 5 s (two runs) left only the gap. On 1.4.3, one run each: silent after a pause of 5 s and of 2 s with the set
off, sound after a pause of 5 s with it on, sound with a device and no pause with the set off.

The numbers without a device now come from runs that can be named: 1.2.1 6 of 119 and 111 of 119, 1.4.3 3 of 119 and
113 of 120 (set off and on). They replace 5 of 118 / 108 of 118 and 2 of 118 / 110 of 119, which I cannot match to a
run any more.

Text only: no code, no site and no default changes. Not measured: Windows, a device with periods of 240 frames or
less, a real device stalling, 1.4.3 with a device and the set on.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-18 18:18:43 +00:00
Valiantsin Dzerakh 6c48e7a364 Merge dev into task/psp 2026-11-18 19:12:50 +03:00
Valiantsin DzerakhandClaude Opus 5.5 00b04df8b2 The game makes a missing layout or prompts folder in the background, at start and when a setting asks for it (#180, #378)
When the game resolution, the HUD width, the button prompts or the pad layout need a folder the install lacks (an
older setup, a failed setup step, a new display), totk.exe starts the setup's generator for it in the background
with the tools build-cache/rebuild.txt names, once per folder and process: at start for the settings in effect
(the resolution output_res asks for, also when the missing layout made this start 16:9), and from the settings
menu once a changed choice has stayed for 1.5 seconds or the menu closes. A missing 16:9 prompts folder is made too,
the PC prompts from totk.ini's bindings. The notes under Game resolution and Button prompts say the files are being
made and are used at the next start; when the tools did not start they say so and Try again starts them again.
The Prepare button is gone. Source builds without rebuild.txt and TOTK_ROMFS_PATCHES keep the old behaviour.

romfs_shape_missing and romfs_shape_prepare become romfs_folders_missing (a mask of the missing folders) and
romfs_folders_prepare; --probe-cfg and tests/romfs_shapes_check.py check the new decisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 18:34:50 +03:00
Valiantsin Dzerakh c1449b2a9b Merge commit 'refs/pull/1284/head' of https://github.com/valentderah/totk-pc-recomp into task/pr1284
# Conflicts:
#	docs/agents/symptoms.md
2026-11-18 18:22:56 +03:00
ipavlin98 d5d62ab406 The camera jitter is described as dlaa_cam_jitter, and the game's matrix copies skip it at once while DLSS is not running 2026-11-18 09:01:16 +03:00
ipavlin98 77cb787de7 The water volume mask's depth bias can be turned off with volume_mask_bias = 0 (or TOTK_VOLUME_MASK_BIAS), a test setting to compare against 2026-11-18 09:01:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6b0974f08d Merge pull request #1188: opt-in quick save and quick load on rebindable keys with no menu on the screen, game 1.4.3 (itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:17:57 +03:00
Valiantsin DzerakhandClaude Opus 5.5 358b7916d8 Merge task/hud: hud_width keeps the HUD within the middle 21:9 or 16:9 of a wide screen, from pull request #1262 (Marjaperse, ProSep, #643)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:15:16 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f801169e1c Merge pull request #1188: opt-in quick save and quick load with no menu on the screen (itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:07:20 +03:00
Valiantsin Dzerakh 006c186928 Merge pull request #1262 into task/hud: hud_width keeps the HUD narrower than a wide screen on the Shapes step (Marjaperse, ProSep) 2026-11-17 20:06:17 +03:00
ProSepandClaude Sonnet 5.5 3b2bd1f6ba Stop fence write-backs from stalling the game behind the GPU with frame-ahead on
With sync_ahead on, the fence write-back of small GPU-drawn targets that the game reads back still blocked the game thread behind the running frame, about every ninth frame. wb_eager copies those targets into staging at the end of the submission that rendered them, so the write-back at the fence wait needs no GPU wait.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 20:05:15 +03:00
shinodanpenandClaude 037a39d303 The sound engine's audio thread takes every queued command list, so the game keeps its sound above 200 fps (#337)
The game thread hands its sound commands to the audio thread in lists: 16, of which 4 are always held, so at most 12
wait in the command ring. The game thread submits at most one per update (1.2.1 main+0x9bd144), the audio thread
takes one per 5 ms audio frame (after a list, main+0x883780 goes on past the ring's check). Above about 200 updates a
second the ring stays full. The game's guard (main+0x9bcdc4) counts the updates that find the ring of free lists
empty and exactly 12 lists in the command ring (0x9bce1c cmp w9, #0xc); the count returns to 0 only when a free list
is there. At every multiple of 300 (10 s at 30 fps, 1.25 s at 240) it clears the sound command switch
(main+0x2268bfc) and stops every active voice (main+0x226f29c). Only the switch's constructor sets it to 1
(main+0xf31ce8, from the engine's init main+0xf31530), so the game is silent until it is restarted.

Measured on 1.2.1 (Linux, RX 6750 XT), same save and scripted input, mix dumped without a device: with fps_limit 60,
144, 180, 200 and 201 the mix has sound; with 205, 210, 220, 230, 239 and 240 it goes silent after the boot logo and
stays silent, also at the 130-148 fps of the scene that follows. The guard is read from the code; the switch going
to 0 has not been observed in a run.

The set audiodrain (TOTK_AUDIO_DRAIN_FIX, audio_drain_fix, on by default) sends the audio thread back to the ring's
check after each list, so it takes every queued list in the pass: one site per version (1.2.1 main+0x883780, 1.4.3
main+0x149244), each going to a target the game's own code already branches to in the same way (1.2.1 main+0x883c18,
1.4.3 main+0x149700). The setting is in runtime/cfg.c, totk.ini.example and docs/settings.md.

At fps_limit 240, 120 s runs of one build per game version with the set switched, seconds with sound in the mix: on
1.2.1 5 of 118 with the set off and 108 of 118 with it on; on 1.4.3 2 of 118 off and 110 of 119 on. Not run:
Windows. Not covered: 1.1.0, whose main we do not have, so its table has no site and it keeps the game's code.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-17 18:56:55 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a5c3e0f9f5 A game with a mod plugin no longer stops at start: plugin_trace has its row in the settings table (#845)
plugin_init.c reads TOTK_PLUGIN_TRACE through cfg_bool, which stops the game when the key is unset and metas[] has no
row. Every test run set the key, so only a plain start hit it. tests/settings_doc_check.py now fails on any
cfg_value/cfg_int/cfg_double/cfg_bool reading without a metas[] row that is not guarded by cfg_get of the same key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:49:27 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8cee1afe5d The rebuild builds mod plugins in: service run, checks, patch sets and status lines (#845)
After the design in #845 by itaskaev2. tools/exefs_plugins.py writes an accepted plugin's patch set
(recomp/patches.py plugin lines and hook sites, one ordered set mod_<hash> per plugin, several plugins
in one record told apart by their hooks) and a line per plugin of build-cache/plugins.status: built, or
refused with the first reason. It also checks the code the hooks reach (direct branches and calls from
the stubs, impls, callbacks and targets): no svc but OutputDebugString, imports only from a reviewed
list. The init's imports may now include malloc, free, memcpy, memmove and memset, because the init runs
again at every start and its heap blocks exist while the game runs.

The setup's lift step runs the plugin stage when a mod has exefs/subsdk*: a lift with the plugins, a
totk.exe of it in the compile step's folder, the service run, then the lift with the hook sites; a failed
stage warns (warn.plugins_skipped) and installs without the plugins. docs/mods.md describes what works,
what is refused and why, and the rebuild.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:48:31 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b488d9e41d totk.exe --plugin-init runs a mod plugin's init on our kernel and records what it did (#845)
The plugin service run loads the modules as boot does, runs sdk's DT_INIT and then each plugin's from nn::init::Start's
module-init callback (rtld initialises the last loaded module first), writes the record and exits before any game
constructor, graphics or audio. The record holds every word the init wrote into a game module, the plugin's image
before and after its init, the process-memory maps, and the svcs and imports it called.

exlaunch's init needs a Switch-like address space: QueryMemory shows the game's own rtld image below main and the
host's ranges as Inaccessible (it takes Code RX runs for modules), and a 64 GiB free pool for its random alias picks.
New svcs: GetSystemTick, GetInfo 65001 (current process handle), and Map/UnmapProcessMemory, which only the service
run serves: an alias is a copy whose changed words go back into the source when it is unmapped. Any other svc, such
as the CreateSession fallback, ends the run with a reason. nn::oe::GetDisplayVersion is answered with the build's game
version. The game calls none of these svcs; the SVC trace test is still one mask test per SVC.

After the design in #845 by itaskaev2, with the init run natively instead of under Unicorn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:05:19 +03:00
Marjaperse 3a9e8ea50a Verify selective HUD shape preparation and fallback (#643) 2026-11-17 03:58:35 +02:00
Valiantsin DzerakhandClaude Opus 5.5 873903d98f The Mods tab order decides code sites too, conflicts show per mod, and each mod can be used without its code
Load order: mods_exefs_apply ranks each mod's patch sets by its position (rt_patch_rank) and runtime/patches.c fills
the pick byte of every contested site from the sets that are on, lowest rank first; a tie (two files of one mod)
goes to the later file, as emulators apply a mod's files in name order. Reorder and restart, no rebuild. The pick is
redone when an ordered set is switched at run time. Nothing changes for sites one set patches.

Conflicts: one table (mods_conflict) of winner, loser, part (files, data bytes, code sites) and count. romfs.c fills
it for files, mods_exefs_apply for the data bytes two mods stored and for the contested code sites. The log has both
directions per entry and one line per contested code site; each row of the Mods tab lists what the mod overrides and
what overrides it.

Use without its code: a per-mod switch under the row of a mod with a code module or an ExeFS patch file the port
cannot apply (mods_no_code in totk.ini, off by default). On, that code is left out and the rest of the mod is used;
the row says what is left out and why. mods_without_code = 1 holds it on for every mod and now covers the
unsupported patch files too.

--probe-mods: order to winner at contested sites in both orders, the same-mod tie, a switched-off mod, a run-time
switch of the winner, the conflict table for data and code, the per-mod switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:11:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 684ca3d9f3 Merge pull request #1237: barrier_merge, off by default, keeps a render pass open through the game's texture-invalidating barriers (ripps818)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:28:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 005881da20 barrier_merge docs name the by-region limit instead of an unexplained edge difference
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:05:34 +03:00
Valiantsin Dzerakh 589e1cc03c Merge branch 'pr/1237' into task/pr1237 2026-11-16 17:50:44 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a16120452d Merge pull request #1233: falling rain draws with shadow storage (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:50:29 +03:00
itaskaev2andClaude Opus 5.5 7bd1c539bd Quick save and quick load with no menu on the screen
F6 asks the game for its own autosave, as the sequence node OneShotAutoSaveMgrRequestAutoSave does, after the game's
own check (its wait between autosaves skipped), from the pad read: the game itself makes that request from several
threads. The slot the commit wrote is copied to <profile>/quicksave; a request the game holds back for 5 s is taken
back. F7 holds the window on its last picture, runs the game's load list underneath and, from the confirmation until
the load is over, opens the quick save's files for every read of a slot folder. A toast at the top of the picture says
what happened. The two keys are set on the Controls tab by pressing them. Keyboard and mouse keys only, game 1.4.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:42:34 +01:00
itaskaev2andClaude Opus 5.5 0a92f9b186 Hold Reflex to the pacer's frame limit, so fps_limit = display no longer caps it at 60
reflex_apply_locked read TOTK_FPS_LIMIT with cfg_int, which turns "display" into the setting's default, 60: with
Reflex on, a 144 Hz monitor stayed at 60 fps. It now takes frame_step_limit_hz, the rate the pacer holds (the
setting, the monitor's rate for display, 60 without the real-time step), and checks it on every present, as the
window measures the monitor's rate after the swapchain is made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:12:34 +01:00
ripps818andClaude Sonnet 5.5 61a407b0e1 Add barrier_merge: keep a render pass open through the game's texture-invalidating barriers
The runtime ended the Vulkan pass at every game Barrier. A Barrier that asks only for fragment ordering and texture
invalidation (ORDER_FRAGMENTS | INVALIDATE_TEXTURE) now leaves the pass open when none of the pass's draws can write a
storage buffer or image, and the next draw sees the writes through a by-region barrier in the feedback layout. Off by
default (barrier_merge = 0, TOTK_BARRIER_MERGE). TOTK_TRACE=gfx also prints how many passes ended by a change of targets
and by the game's Barrier, how many Barrier calls were merged and which NVN barrier bits they carry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 22:00:38 -06:00
ipavlin98 77a52e4577 TOTK_WB_MERGE=0 also turns off the shadow storage's word merge, so the two can be compared 2026-11-16 03:55:56 +03:00
581c1ecdef Darken only sunlit pixels with contact shadows
The half-resolution lighting pass the composite reads keeps the sun's visibility in its first target's alpha: 1 in
the sun, 0 in the shadow maps' shadow and everywhere underground. vk_contact.c finds that pass (eight targets at half
the scene size, the first RGBA8) and contact_shadow.comp scales its darkening by that alpha, so a contact shadow takes
away direct sunlight only and caves no longer turn flat. Without that pass in the frame the old behaviour stays.
TOTK_CONTACT_DEBUG=2 shows the visibility in grey.

Carried onto dev from #439: the march is now planned by the scan (vk_contact_plan) and recorded from a VkExecJob, so
the lighting target travels in the job's new sun field, and the factor multiplies the facing-the-sun factor of the
back-face fix.

Co-Authored-By: itaskaev2 <165683571+itaskaev2@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 17:34:42 +01:00
Valiantsin DzerakhandClaude Opus 5.5 ccf9837764 TOTK_BIND_INC is off by default
With it on, a GTX 1050 Ti lost the device at one place in the world, after the validation layer reported a descriptor
pool reset while a command buffer still used it and binds of that pool's sets. The cause is not found and the slower
diagnostic runs did not bring the loss back. bind_inc saves about 1% of the frame, so it waits until the cause is known;
bind_inc = 1 in totk.ini still turns it on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:11:50 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2f32f21f5c The incremental draw preparation is on by default, and bind_inc and memx are listed in totk.ini.example (#381)
TOTK_BIND_INC had no settings row, so unset meant off. It now has one with default 1, like TOTK_MEMX: 0 or off turns
it off, check keeps the comparison mode. The check mode found 0 differences on 13 scenes (town, fight2, Kakariko,
Great Sky Island, Depths lit and dark, a shrine, rain, a cave, evening, a field, the menus, entering a building).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 20:03:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ff3a95d0f1 A draw whose pipeline state no op changed takes the previous draw's pipeline and state without building and comparing them (TOTK_BIND_INC)
From task/fastrep 18eab597 (TOTK_PIPE_GEN), now under TOTK_BIND_INC: the pipeline memo keeps the pipe_gen its state
was built under; a draw with that generation and the same shaders, primitive, restart, feedback flags and depth mode
takes the memo's state and pipeline and skips the three 360-byte compares (memo, cache entry, recorded state). The
shader memo skips its compare of pipe the same way. check builds and compares as before and counts a state the
generation called unchanged that differs (bi_mismatch logs the first of each kind with its marks and generations).
The census runs only in check mode. Lookout Landing check, 60 s: 67% of draws keep the state, 0 mismatches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 23:42:11 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2abfa23a67 Bind ops mark the slots whose bytes they changed and a per-draw census counts what the next draw could keep (TOTK_BIND_INC)
vk_exec_bind compares before it writes: VkExec.dirt gets a bit per program, uniform, storage, texture, image and
vertex buffer slot that changed, pipe_gen moves with every change of the pipeline state (also depth clamp, raster
discard and the target formats), fbl_serial with the feedback-layout images, OV.gen with the uniform overlays.
vk_exec_draw_new_cb, copy_state and state_reset mark everything. With TOTK_BIND_INC=on or check, bi_census sorts each
prepared draw by what changed since the draw before (nothing, uniform slots only, other slots, another pipeline) and
counts the descriptors to rebuild, the generation moves and the shader, pipeline, vertex buffer and feedback keeps;
a bind_inc line every 300 frames. No draw is prepared differently yet.

Lookout Landing, 4500 draws a frame: nothing changed 8.7%, uniforms only 55.5%, other slots 22.9%, another pipeline
12.8%; 3.4 of 11.2 descriptors a draw to rebuild; uniform overlays move on 2.3% of draws, snapshots 0.1%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 23:40:01 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e6839387fc Merge task/abilityguard: a stale Recall / Ultrahand target is dropped only where the game would fault on it, replacing the 4 GiB target check, and the model scene report loop gets a bound (#1005, #1137, #1145)
The ability guard (runtime/ov_ability.c) checks the holder, the actor, its component and the reference word the game
writes, so it catches every bad target seen in the reports: -1, 0x80, an empty bounding box (FLT_MAX) and a vtable in
main's data. The optref site at main+0x1bd01c8 (1.2.1: 0x1622bf4) is dropped: set ability patches the same address and
must win there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:57:07 +03:00
Valiantsin DzerakhandClaude Opus 5.5 0ded6164a0 Describe optref_guard, ability_guard and report_guard in docs/settings.md (#1005)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:19:05 +03:00
jcleng 00a0ffc197 Ask fontconfig for the menu's CJK font instead of hard-coding five paths
plat_font_path stats five absolute paths for NotoSansCJK-Regular.ttc and takes the first that exists. That covers
SteamOS and the usual distributions, but misses any system where the font lives elsewhere, and fails outright in a
sandbox: under Flatpak /usr is the runtime and ships no CJK font, the app may only write /app, and the host's fonts
appear at /run/host/fonts. All five paths miss, fonts_up merges 0 fonts, and every Chinese character in the settings
menu renders as '?' while English stays correct.

Asking fontconfig fixes all of these at once. It is the same database Tk/Xft and every other Linux toolkit reads; it
knows /app/share/fonts, the XDG data dirs, /run/host/fonts and the per-user directories, so installing the font where
the system looks is enough and no packaging can leave the menu stranded.

libfontconfig is dlopen'd, not linked: a host without it (headless, a bare container) still builds and runs and takes
the fallback, so this adds no build dependency, and the runtime already links -ldl for the NVIDIA libraries. The
result is checked against the character before it is used, because fontconfig returns the closest pattern even when
nothing covers a character -- without that a Latin-only system hands back DejaVu Sans and the menu believes it merged
glyphs when it did not. The pattern names zh-cn and zh-tw rather than zh-hans and zh-hant, which is how Noto CJK and
fontconfig tag the faces.

menu_font_fontconfig defaults to 1 and 0 goes back to the five fixed paths, for a player whose fontconfig resolves to
a font the menu's parser cannot read. TOTK_MENU_FONT names a file directly and wins over both. A system with the font
where the old paths expect it sees no change, and Windows, whose font names are fixed, is untouched.

Verified against the real fontconfig with the host having no CJK font, with fontconfig pointed at a directory holding
only NotoSansCJK-Regular.ttc (the Flatpak case, now resolved), with TOTK_MENU_FONT set and pointing at a missing file,
with menu_font_fontconfig=0, and with libfontconfig made unloadable (falls back quietly, no crash).
2026-11-11 13:15:39 +00:00
Tears of the SteelTemple 3209ea4358 Implement Native NVIDIA Reflex Low Latency (VK_NV_low_latency2)
- Enable VK_NV_low_latency2 and VK_KHR_present_id with present ID features
- Add VkSwapchainLatencyCreateInfoNV to swapchain creation
- Link present and submission IDs with standard Vulkan latency types
- Insert latency markers: simulation start/end, input sample, render submit, and present
- Gate all extensions and latency chains on reflex != off (RESTART setting)
- Log graceful notice when Reflex is requested on unsupported hardware
- Add UI menu setting and translations for en, ru, pt-BR, zh-Hans
- Document reflex setting in totk.ini.example and docs/settings.md
2026-11-10 18:20:16 +01:00
itaskaev2andClaude Opus 5.5 e8fd6fd7a5 Describe deswizzle, kspin_us, pcore, rec_async and rec_spin_us in docs/settings.md
tests/settings_doc_check.py failed on dev with these five names in known[] and described nowhere. The rows follow the
code: vk_deswizzle.c (TOTK_DESWIZZLE), kernel.c kspin_ns, main.c (rt_knob PCORE), vk_rec.c rec_submit and rec_main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:28:21 +01:00
Valiantsin DzerakhandClaude Opus 5.5 1c1ff975f3 Default dynamic_res to 1 so the game keeps its own dynamic resolution
With dynamic_res at 0 by default the fixres set held the scene at 100 % for every player, the reason #573 was turned
down. The default is now 1, so the set stays off unless a player turns dynamic resolution off in the menu or
totk.ini, and the Steam Deck profile no longer needs its own entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:20:31 +03:00
itaskaev2 59eb026bd7 Merge branch 'dev' into carry/dynamic-res-100 2026-11-09 09:55:24 +01:00