Commit Graph
100 Commits
Author SHA1 Message Date
Ruan ShannonandClaude Opus 5.5 ab356192d7 heap_lazy: the docs say 1 MiB chunks, and with the setting off ipc, svc and save writes are as before
Review of #1369: the settings row still said 64 KiB though LAZY_CHUNK is 1 MiB, and two changes ran for every player.
ipc.c and svc.c readable() ask the OS again unless TOTK_HEAP_LAZY is on (mem_heap_lazy), and fs_host.c write_file calls
mem_heap_commit, which commits the buffer's reserved heap chunks in lazy mode and does nothing otherwise, instead of
mem_thaw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 13:38:10 -08:00
Ruan Shannon 54b2975d98 Merge remote-tracking branch 'origin/dev' into perf/heap-lazy-commit
# Conflicts:
#	runtime/cfg.c
2026-11-23 13:37:39 -08:00
Valiantsin DzerakhandClaude Opus 5.5 b5b9cc2be8 null_attach reads its switch once at device creation and gives a pass one dummy that covers it, freed with the device (#1343)
With the switch off, the draw path now pays one load of vk_caps.null_attach per gkey_fill and per empty slot in
target_wmask instead of a call into vk_exec.c, and vk_exec_pass_begin one flag test per pass. The switch is read in
vk_caps_init, before the pipeline prewarm makes the first key.

With it on, only empty slots below the pass's last target get a dummy, which is where the pipelines'
colorAttachmentCount ends (vk_pipeline.c target_count); a pass without colour targets keeps none, so a depth-only or
attachment-free pass never gets a 16384-wide image. All empty slots of a pass share one view, and an image serves
every pass it covers with its sample count: 1.4.3 at 1600x896 makes one image of 1.75 MiB instead of three. The
images are destroyed in destroy_all before the allocator goes, and the log line gives each one's size.

The settings row no longer states that empty slots caused #1343: the dumps do not show it. totk.ini.example gets
the player entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:02:38 +03:00
Valiantsin Dzerakh 83e4037f9c Merge commit 'f278e91a' into task/pr1412
# Conflicts:
#	runtime/cfg.c
2026-11-23 19:02:11 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3b97936ed3 The kept resource size table is off by default, and its key covers the running totk.exe, the RomFS image and every overlay
restbl_cache now defaults to 0. Its key adds the path and identity of the running exe (a dev or source build that
changes the merge code keeps the VERSION string, so the port version alone served the old table), the RomFS image's
identity, the number of shipped tables and the overlays of the port's own folders, which the old filter left out.
The table's SHA-256 is taken from the bytes the build wrote instead of a read back from disk. A miss logs why the
table is built again. totk.ini.example and docs/settings.md describe the setting, its default and what the key does
not see (a rewrite that keeps size and write time).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:51:01 +03:00
Valiantsin DzerakhandClaude Opus 5.5 05d46f3538 Merge pull request #1385 head: serve the mods' merged resource size table from the last start (itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:37:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e15aae0606 Anti-Lag 2 runs only with reflex = auto, so on and boost keep their old Reflex-only meaning
A player who had reflex = on on an AMD GPU got nothing from it before #1416 and would have got Anti-Lag after an
update without asking for it. on and boost now enable NVIDIA Reflex alone and log the same line as before when it is
missing; auto picks Reflex or Anti-Lag. The Anti-Lag entry point loads with atomics, since the game thread and the
present thread both make the first call, and the TOTK_TRACE=perf latency line keeps its old text unless Anti-Lag is
on. The menu description, docs/settings.md and totk.ini.example say which value turns on what.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:34:39 +03:00
Valiantsin Dzerakh 8619d1bb3f Merge pull request #1416 head: AMD Anti-Lag 2 in the low latency setting (ripps818)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	runtime/vk_device.c
2026-11-23 18:24:19 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f1ec56b592 Merge pull request #1245: AMD FSR 4 upscales the 3D scene on Windows through AMD's signed FSR SDK 2.4 libraries (scene_upscaler = fsr4, off by default), and the setup can download them (codexx-dev) (#1409)
FSR 4 is a fourth engine of the scene upscaler beside DLSS and FSR 3.1 and takes their frame point, jitter, per-object
motion vectors, mip bias, fsr_sharpness, FXAA skip and dynamic resolution hold. The PR's dlaa_backend setting, its
FSR 3 through the DLL and its separate Upscalers row are left out: dev builds FSR 3.1 from the SDK 1.1.4 sources.
Checked on an RX 9070: FSR 4.1.2 at quality, 1280x720 -> 1920x1080, picture clean; without the DLLs the upscaler stays
off with a log line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:39:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9978eb2948 Merge pull request #1371: GPUs without VK_EXT_external_memory_host run on shadow storage instead of being skipped; GPUs with it see no change (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:27:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9469ad0675 Merge pull request #1371: a GPU without VK_EXT_external_memory_host runs on shadow storage (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:21:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d98996b6e2 Turn the ANV vertex-shader storage barrier off by default on every GPU; players opt in with anv_vs_barrier = 1 (#927)
The barrier costs about 5% of the frame rate on an Iris Xe and was only tested there. TOTK_ANV_VS_BARRIER and anv_vs_barrier still force it on with 1 and off with 0. docs/settings.md says what it fixes, what it costs and that only Intel GPUs with Mesa ANV on Linux are affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:17:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 be98dbc336 Merge pull request #1245: AMD FSR 4 as a fourth scene upscaler, scene_upscaler = fsr4 (codexx-dev)
The PR's FSR 4 path (runtime/vk_ffx.c over AMD's FSR SDK 2.4 signed libraries, ffx_api_min.h, the cooperative
matrix and float8 device extensions in vk_device.c), its setup step that downloads amd_fidelityfx_loader_vk.dll and
amd_fidelityfx_upscaler_vk.dll, its notices and the FXAA copy shader hash 0x9d065204aac9766b now serve dev's own
scene upscaler as UPSCALER_FSR4. FSR 4 goes through vk_dlaa.c fsr_evaluate beside FSR 3.1: the same frame point,
jitter, motion vectors with the per-object pass, camera from vk_fg_camera, mip bias, fsr_sharpness, FXAA skip and
dynamic resolution hold.

Dropped from the PR: the dlaa_backend setting, FSR 3 through the DLL and the separate Upscalers row. vk_ffx.c pins
FSR 4 only; a device the libraries offer no FSR 4 for runs with the upscaler off and the menu says so. It keeps one
context per output size with dynamic resolution, like vk_fsr3.cpp, waits on the SDK's ring depth and is released
before the device goes. The menu's scene upscaler row gets "AMD FSR 4" (Windows; marked when the libraries or the
GPU are missing). The setup's FSR box and its strings are in all eleven installer catalogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:13:20 +03:00
ripps818andClaude Sonnet 5.5 84e44f3aed Add AMD Anti-Lag 2 to the low latency setting, with an auto value that picks Reflex or Anti-Lag for the GPU
The reflex setting gains an auto value. With auto, on or boost the device uses NVIDIA Reflex when the driver has VK_NV_low_latency2, otherwise AMD Anti-Lag 2 when it has VK_AMD_anti_lag (Mesa RADV, AMD's Windows driver); with neither it does nothing. Anti-Lag marks the INPUT stage where the window texture is acquired and the PRESENT stage just before vkQueuePresentKHR, with the pacer's frame limit as maxFPS. The default stays off. The menu row is renamed Low Latency in all four languages.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 23:24:48 -06:00
Ruan Shannon f278e91a7c null_attach = 1 gives empty colour slots a dummy attachment instead of a null view (Intel legacy driver crash, #1343)
On an HD 520 with Intel's legacy Windows driver (101.2125, Vulkan 1.3.215) the game faults inside vkCmdBeginRendering
(igvk64.dll+0x5cfab2/+0x5cfab9, frames +0x5c42dd and +0x548235) right after the logo, with the recorder on or off and
with import or mirror memory. The driver reads an attachment entry of the pass that is null. vk_exec_pass_begin leaves
imageView VK_NULL_HANDLE in every colour slot without a target, which Vulkan allows, and the first pass of a boot that
has one is the 1600x896 scene G-buffer pass (slots 2 and 4 empty), the render area of the reported crash.

With TOTK_NULL_ATTACH=1 such a slot gets a view of a dummy R8_UNORM image of the pass's size, layer and sample count
(one per shape, made once, GENERAL, DONT_CARE load and store), and the pipelines name that format for it with the writes
masked off (vk_pipeline.c gkey_fill, target_wmask), so views and pipelines agree. Off by default: nothing changes, and
pipeline keys stay as they were. Untested on the affected driver; Iris Xe (101.7092) plays the same with it on.
2026-11-22 16:49:02 -08:00
mattheuspaivadiniandClaude Opus 5.5 4c95df372a On Mesa's ANV, put a by-region barrier before a draw in a pass whose vertex shader reads a storage buffer (#927)
On an Iris Xe with ANV the half-resolution particle pass drew campfire smoke and clouds as white or dark blobs and
turned the sky white for single frames. Such draws read stale data inside the pass unless the sampler cache is
invalidated first; a stall alone or the attachment flush alone does not help. The barrier is feedback_barrier, which
the feedback loops already record inside passes. TOTK_ANV_VS_BARRIER (anv_vs_barrier) turns it off or on elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:45:13 -03:00
itaskaev2andClaude Opus 5.5 f11987e9a7 Serve the mods' merged resource size table from the last start when the mod files are the same
Building the table opens every mod file and unpacks the mods' packs: about 7 s with an HD texture pack and The Second Quest. restbl_cache = 0 builds it at every start. Split from #1331.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:02:47 +01:00
Ruan Shannon f877aae10e A GPU without VK_EXT_external_memory_host runs the game on shadow storage instead of being skipped
The extension was in vk_device.c k_required_ext, so pick_device skipped every GPU without it ("gpu 0 skipped: missing
extension VK_EXT_external_memory_host") and the game exited: Qualcomm Adreno's Windows driver (issue #161), some older
or mobile drivers, and RenderDoc, which hides it. It is now enabled when present (VkCtx.has_external_memory_host); without
it vk_memory.c mirror_mode turns shadow storage on, the path Wine already takes, so import_pool gives every CPU-visible
pool a host-visible copy instead of an import. vk_mem_class_log runs once the device's extensions are known.
TOTK_VK_NO_HOST_IMPORT=1 takes that path on any GPU, for testing it. Docs no longer list the extension as required.

Iris Xe with a test layer that hides the extension: dev skips the GPU and exits (70); this change plays the sky-island
save (40 s, 39.9 fps, shadow storage logged). With the extension present nothing changes.
2026-11-22 05:01:27 -08:00
Ruan Shannon 6370c7c0b6 heap_lazy = 1 commits the game's heap a 1 MiB chunk at a time on first use (Windows, opt-in)
SetHeapSize takes the game's whole heap at boot (2.1 GiB on 1.4.3) and Windows charges all of it against the commit
limit, although a sky-island run touched about two thirds. With TOTK_HEAP_LAZY=1 the heap stays reserved: the first
read or write of a chunk faults and memory.c heap_fault commits it; read faults reach the hook only in this mode
(plat_mem_fault_reads). A byte per chunk (lazy_map) answers without asking the OS, so frozen-region write faults pay
nothing for it, and only clear chunks are committed, never pages a freeze made read-only. mem_thaw, which file reads,
save writes and Vulkan imports call before the kernel or driver touches guest memory, commits its range's chunks
first; ipc.c and svc.c check readability by the layout; vk_mem_host_room counts the uncommitted heap as taken. Default
off: the heap path is unchanged unless set.

Sky island, 120 s, this laptop (Iris Xe): peak commit 6345-6536 MiB on dev, 5736-5821 MiB with heap_lazy = 1; about
600 first-use faults, 8 ms in all.
2026-11-22 04:49:58 -08:00
codexx-devandClaude Opus 5.5 c71222fecb Merge upstream dev 25a53e5 into fsr4
Conflicts: runtime/cfg.c keeps dev's FREECAM_* names next to the FSR_* ones; runtime/vk_dlaa.c keeps dev's two
FXAA_FS hashes for translator patch 0017 (#1299) and this branch's FXAA_COPY_FS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:41:04 -03:00
shinodanpenandClaude fb252ebf6b Scale the thunderstorm's lightning chances by the frame so a storm above 30 fps has the lightning it has at 30 fps (#1287)
In a thunderstorm the world manager's lightning update (1.4.3 main+0x62aac4, 1.2.1 main+0xab849c) runs once per frame
and draws, each update, a random number in [0, 1) for each of three fixed chances: 0.013333 for a distant bolt (the
effect Far_Lightning), 0.01 to pick a near strike and 0.01 for the environment's lightning flag. Its timers follow the
frame step, the draws do not: above 30 fps a storm has more distant bolts and lightning flags the higher the frame
rate. The new set lightning (TOTK_LIGHTNING_FIX, lightning_fix, on by default) multiplies each chance by the time
object's frame ratio (+0x38), at most 1, on 1.2.1 and 1.4.3: above 30 fps the rates per second of 30 fps, and at 30 fps
and below the game's own chances.

Counted on 1.4.3 in the reporter's storm (205 s with the storm on, Link standing still) with a local build that logs
each draw that succeeds, which this change does not contain: distant bolts 22, 52 and 94 to 96 a minute at 30, 60 and
120 fps with lightning_fix = 0, and 26, 27 and 20 to 24 with lightning_fix = 1, each one a Far_Lightning effect; the
lightning flag 19, 34 and 64 to 80 times a minute of the storm's lightning phase with 0, and 12 to 17 with 1. Near
strikes stayed at 14 to 18 per run at every rate with either value: each lightning phase lets its last pick strike in
the phase after it, where nothing is drawn, and that phase ends with a strike of its own.

On 1.2.1, which the logging build does not cover, the distant bolts were counted in screenshots of a storm in Hyrule
Field (one every 0.2 s of game time, a detector of thin bright lines, each counted screenshot checked by eye at 30 fps
and at 120 fps with lightning_fix = 1, a sample of 48 with 0): 19 screenshots with a distant bolt a minute at 30 fps,
about 61 at 120 fps (105 to 107 fps in the storm) with lightning_fix = 0, and 15 with lightning_fix = 1. The same count
on the 1.4.3 runs gives 25 to 26, 65 to 68 and 16 to 20 a minute: at high rates it misses bolts that share a
screenshot.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-21 15:24:43 +00:00
Valiantsin DzerakhandClaude Opus 5.5 ce47fdda3f perf_census: the settings row says the census runs only in the import memory mode, since a mirror prints its own mem lines (#946)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:10:35 +03:00
kliksoandClaude Opus 5.5 14fa37a318 A switch to turn off the perf trace's dirty census, which slows a traced Steam Deck run by about 3% (#946)
TOTK_PERF_CENSUS=0 (perf_census in totk.ini) keeps TOTK_TRACE=perf and its frame lines but skips the write-watch
queries the census makes at every submit, so a perf trace on Linux measures the frame without them. On an LCD Steam
Deck at Lookout Landing (dev, three interleaved runs each) the census costs about 0.8 ms a frame: 38.0-38.3 fps with
it, 39.1-39.4 fps without, 1% low 30.5-31.5 against 32.1-33.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:00:13 +00:00
Valiantsin DzerakhandClaude Opus 5.5 22794ab332 Merge task/fg into task/fsr31: frame generation's per-object motion vectors and its contexts kept across dynamic resolution, on one motion gate with FSR 3.1
vk_objmv_wanted is FSR 3.1's latched upscaler half (DLSS with NGX up, or FSR 3.1 picked at start) or frame generation following the scene with its objects (vk_fg_objects_on), and vk_mvprev_frame turns the tables on for the running upscaler or for frame generation. vk_usnap.c keeps this branch's host regions: a region's host flag says whether this submission wrote its host copy, which covers frame generation going on and off live without fg's separate U.host pointer. The jitter fix in mv_pass stays a single copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:15:40 +03:00
14ccef9a80 AMD FSR 3.1 upscales the 3D scene on the FidelityFX SDK 1.1.4 sources behind scene_upscaler = fsr3, off by default
scene_upscaler (off | dlss | fsr3, read at start) replaces the dlaa toggle on the Screen tab; without the key dlaa = 1
still means DLSS, so nobody gets FSR 3.1 without picking it. The DLSS mode row is the upscaling mode of both engines,
the DLSS model, characters' mask, fixed exposure and effects-after rows show only with DLSS, and the performance
overlay names the upscaler that ran and its mode. resolution.c sizes the scene for the engine picked at start.

runtime/vk_fsr3.cpp drives the SDK's upscaler context on its Vulkan backend directly, as Savage Wind's fsr3.cpp does:
one context per output size with the output as its largest render size (the modes and the dynamic resolution need
no new context), HDR input (the light target before the bloom, where DLSS reads it), render-size motion vectors with
the per-object pass, the camera jitter, the camera's planes and field of view from the scene block (vk_fg_camera; a
cut starts a new history), FSR's sharpening off. vk_dlaa.c calls it at the DLSS point after the recorder's drain;
the NGX path is left as it was. The backend's per-frame rings hold four dispatches: a dispatch waits for the one three
back should it still be in flight. Frame generation stays off while FSR 3.1 runs (logged once).

The SDK subset gains the upscaler component, its shader headers, FSR 1's (its RCAS) and its GLSL, from Savage Wind's
copy unchanged; tools/ffx_shaders.py --effects fu builds its blobs (HDR, 32- and 16-bit floats) into
spirv/ffx_fsr3upscaler_vk.h, and vk_fg.cpp's blob lookup hands those out through vk_fsr3_blob. The luma history's
storage image is declared rgba16f, its images' format (rgba8 in the SDK; the validation layer reported it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Revivedx <82332536+Revivedx@users.noreply.github.com>
2026-11-20 14:39:57 +03:00
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
codexx-devandClaude Opus 5.5 35d7411bab Merge upstream dev into fsr4
The installer runs dev's new kit step and keeps the FSR step after DLSS: check, kit, fonts, extract, lift, compile,
prepare, pc_prompts, shapes, dlss, fsr, cleanup; docs/installer.md numbers FSR 10 and the clean-up 11. cfg.c keeps
dev's DLSS settings (dlss_fixed_exposure, dlaa_effects_after, dlaa_cam_jitter) beside dlaa_backend. The Screen tab
keeps FSR sharpness with the upscaler's rows, before dev's two new DLSS rows. totk.ini.example takes dev's game
versions for dynamic_res and keeps the note that FSR holds the scene at 100 %.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:37:07 -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