Commit Graph
776 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 1974b671be Merge pull request #1263: with DLAA, fog and particles can be drawn over the smoothed picture, so dust in shrine fog no longer vanishes; off by default until checked on NVIDIA (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:07:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a702c33f91 dlaa_effects_after is off by default until the inventory preview, the scope and water edges are checked on NVIDIA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:06:49 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c76a38852e The DLAA effects switch sits with the other DLSS settings and is read only while DLSS runs
dlaa_effects_after moves to the Screen tab under the DLSS rows, to [display] in totk.ini and totk.ini.example next
to dlss_char_mask, and vk_dlaa_frame reads it after the dl_active check, so a game without DLSS does no new work
per frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:05:44 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a36e7917da Merge task/cascade: shadow_range moves the sun cascades on 1.2.1 and 1.4.3, from pull requests #1258 and #1254 (shinodanpen, #606)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:03:05 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f53b86c61d Merge pull request #1253: sync_ahead works on game 1.1.0, and game-time scripts find the player there (Marjaperse)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:01:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1ccefb46f2 Merge pull request #1252: the dynamic resolution switch holds the full scene size on game 1.1.0 (Marjaperse)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:01:25 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e031ac596a Merge dev into task/pr1263
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:59:52 +03:00
Valiantsin DzerakhandClaude Opus 5.5 4613d9b458 res_shadow_range's comment names both cascade tables and the controller's boundaries they scale (#606)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:58:02 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1cc47c7768 Merge pull request #1255: the field-of-view setting works on game 1.2.1 (shinodanpen)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:57:54 +03:00
shinodanpenandClaude 13819ab6d8 Add the field-of-view setting for 1.2.1
recomp/patches-v121.txt gets set fov on the two camera routines the aspect set already patches, at the load of the
camera's vertical view angle (+0x13c): camera update main+0xcb4ad8, camera setup main+0x1252194. The update site matches
1.4.3's instruction for instruction around the load; the setup site copies the camera's fields with other instructions
and registers before it and matches 1.4.3's from the load on. Both call sinf, cosf and tanf in the same order as on
1.4.3. Each version fills sead's perspective projection this way in ten places, each with its counterpart in the other
version: these two camera copies, which are the only places 1.4.3 patches, and eight others (inlined copies, projection
routines and four projections on the stack), none patched. The replacement words are those of the 1.1.0 and 1.4.3 sets
(x10 kept on the stack, s8 overwritten by the next instruction), so no register liveness is assumed. #621 (ipavlin98,
closed by its author) chose the same two sites with x8 and s2 as scratch registers.

The setting's text in totk.ini.example and in the four menu languages names 1.2.1, and the comment of
runtime/resolution.c res_fov_live names the patch files of all three versions.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-17 19:29:43 +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 501f0d3e6f The setup installs a build kit into the game folder, and the game's rebuild for code mods runs from it (#845)
The rebuild for ExeFS patches, code cheats and mod plugins ran the setup window from the setup folder, whose absolute
path build-cache/rebuild.txt held, with the generated C and objects in that folder's temp/. A moved or deleted setup
folder left code mods without a rebuild.

- A new Kit step after the check copies the release folder without TotK-Setup.exe into <game>/build-kit
  (installer/layout.py KIT_ITEMS), and every later step runs its tools from there. A newer setup replaces the kit,
  the kit's own rebuild keeps it.
- The release's temp folder is <game>/build-cache/work, so the lift cache and the objects stay with the game.
- rebuild.txt names the kit relative to the game folder; runtime/cheats.c and runtime/romfs.c resolve relative
  entries against the exe's folder.
- runtime_key drops the lines of clang --version that name its folder, so a rebuild from the kit or a moved game
  folder keeps the compile and prepare steps the setup recorded.
- An update over an install of an older setup moves that setup's temp folder into build-cache/work when both are on
  one disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:54:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 aa184f9fd2 A mod plugin the build has whose file is gone starts the rebuild, which goes back to a build without it (#845)
Removing a plugin mod left its module in the layout: the loader skipped the missing file and the game ran, but the
rebuild that drops the plugin never came. The loader counts layout plugins whose file no longer exists
(ldr_plugins_gone) and rebuild_if_needed treats them like files waiting for the rebuild. A changed file was already
pending through its mod's status line. On the 1.4.3 install: The Second Quest removed, the start asked for the
rebuild, the setup lifted and compiled the no-plugin build in 30.5 s, the game reached gameplay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:35:49 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c477b67a09 The runtime library's module tables hold 32 modules, not the release's MOD_COUNT: an install's plugins fit (#845)
loader.c and memory.c sized their tables by MOD_COUNT of the layout.h make_release.py built libtotkrt.a against (3:
main, subsdk0, sdk). An install whose rebuild adds a plugin has 4, and its service run stopped at once with "loader: 4
modules in the layout"; dev builds compile those files against their own layout and never saw it. RT_MAX_MODULES
(host.h) is the bound now; the loader still refuses a layout above it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:35:49 +03:00
ipavlin98 40c0071dd2 With DLAA, DLSS runs before the fog and the particles, which are drawn over its picture without jitter, so the dust in shrine fog no longer vanishes
DLSS ran at the bloom, after the volumetric fog composite and the particle pass. Neither has motion vectors or jitter
of its own, and DLSS wiped out the smallest motes. In DLAA mode DLSS now runs right after the deferred lighting: the
light target is the G-buffer's scene colour target, the lighting is the first pass into it after the G-buffer, with
a D16 depth, and the first pass into it with any other depth (the scene's, none, or the D16 of an ability's highlight)
is an effect. The order of the effects changes from frame to frame (the yard's half-size effects pass is in some
frames only; with Ultrahand or Ascend open the highlight comes before or after the fog layer), and rules that waited
for one of them, or took any D16 pass for the lighting, flickered. As a safety net the point is used only after it
held for 60 frames with nothing of the scene drawn after it; otherwise DLSS stays at the bloom.

dlaa_effects_after (Advanced tab, Render fixes, default 1, live) turns it off. The upscaling DLSS modes are unchanged.
2026-11-17 09:41:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 77f34a05f5 A plugin build whose plugins all stay off gives the game its own QueryMemory back (#845)
plugins_start returned before clearing mem_query_hook and rt_process_memory when no plugin's set was on (the mod off,
removed, or its file changed), so the game ran with the service run's view of memory: host ranges Inaccessible, the
rtld stand-in below main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:33:49 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b9b8f3dce1 Each mod plugin is built or refused on its own: one that is refused, crashes or hangs costs only itself (#845)
tools/exefs_plugins.py ran every plugin's init in one service run and refused them all when one was refused. Now a run
without inits lists the plugin modules, then each plugin runs in service runs of its own (TOTK_PLUGIN_ONLY, the others
stay loaded): a refused svc, a crash (the FATAL line is the reason), a timeout or a failed check refuses that plugin
alone, with its reason in plugins.status; the rest are built in. 4 plugins take 2.3 s.

At start, plugins_start compares each plugin right after its own init and takes its branches out of main's .text before
the next one, so each init sees the game's bytes, as in its service run. Only that init's aliases are flushed: the
start stays at 113 ms for Full Inventory Expansion + Quick Weapon Durability (107 ms before).

The installer's second lift keeps every plugin of the service runs in the layout when one is built: the records hold
that layout's addresses. A refused plugin stays loaded and never starts. A mod with a built plugin and a refused one,
used without its code, runs the built one (mods.c; --probe-mods case T).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:25:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d865000929 A mod plugin's init runs at every start and its hooks go on when it writes what the build recorded (#845)
After the design in #845 by itaskaev2, with one change: no image taken after a build-time run. When a
plugin's patch set is on, sdk's DT_INIT runs first, then the plugin's, in the environment of the service
run (rtld image below main, the QueryMemory view, the alias pool, process-memory aliases), then the game's
constructors. That is rtld's order on the Switch (oss-rtld, librtld/source/ld.cpp __rtld_modules_init
runs the modules from the last loaded to the first). sdk's first DT_INIT only registers it with its musl
and main's DT_INIT finishes it, so its flag stays 1 and it is not called a second time. The plugin keeps
its heap blocks, GOT and alias addresses.

The words the init wrote into the game modules and the plugin's .text after it are compared with
patches.h: equal, the set stays on; different, it goes off for this run, the reason is logged, the Mods
tab row says so and build-cache/plugins.stale has the next start run the rebuild. The branches written
into main's .text are taken back. mods.c reads build-cache/plugins.status: a built plugin's set joins its
mod's sets and the Mods tab order, a refused one keeps its mod off with the reason (the catalog texts in
en, ru, pt-BR, zh-Hans), a plugin without a line waits for the rebuild. A plugin file changed after the
build is left out by the loader. TOTK_PLUGIN_TRACE=1 logs the first call of each hook entry.

Without a plugin in the build nothing of this runs. --probe-mods covers a plugin set against another mod's
patch on one site, a refused plugin, one the build lacks and one whose start differs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:48:23 +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 59e4ed9e7d Follow the 1.1.0 scene singleton indirection for the world clock
The 1.1.0 scene slot is a GOT entry pointing to the singleton storage. Dereference it before walking the scene so game-time scripts, captures and benchmark windows can start. Add a memory-fixture regression for all supported versions and unloaded or invalid player state.
2026-11-16 22:39:45 +02:00
Marjaperse 8c147cf6dd Enable sync ahead for game version 1.1.0
Recognize the verified per-frame NVN wait site while retaining replay and shadow-memory guards. Document support and cover wait selection, polls, unrelated calls, fence completion, timeouts, and disabled modes with a deterministic backend.

Validated 1.6 million wait selections, runtime probes, and a two-minute gameplay smoke test in the v0.4.1 test build. The smoke test retained DLAA and display settings on a disposable profile copy; no FPS improvement is claimed.
2026-11-16 21:42:00 +02:00
Marjaperse 9d66735e73 Make the dynamic resolution toggle work on game version 1.1.0
The menu exposed dynamic_res on 1.1.0, but its patch table had no fixres
set, so disabling it left the engine's 80/90/100 percent tiers active.
Patch the scale returned by the controller's common epilogue, matching
the existing 1.2.1 and 1.4.3 implementation. The configured render scale
remains the maximum size, and enabling dynamic resolution restores the
original controller live.

Extend the 1.1.0 differential patch tests across dynamic tiers and both
switch states, checking register, SIMD and flag preservation. All 51
sites and 889 spin back-edges match local ExeFS; 720 native/Unicorn cases
pass. All five runtime probes pass. Live off/on/off testing shows native
3440x1440, lower tiers when enabled, and 3440x1440 again when disabled.
2026-11-16 21:07:02 +02:00
Valiantsin DzerakhandClaude Opus 5.5 f541d02ba5 MOD_PLUGIN's comment names the per-mod switch that uses such a mod without its code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:35:35 +03: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
8e098e95a8 A mod with a code module the port cannot run can be used without it (mods_without_code)
Taken from PR #790, which carries Eric Dallo's work from his fork (ericdallo/totk-pc-recomp, 6241358f): only its
mods_without_code part, adapted to dev, which has the ExeFS data writes already (#835) and no plugin runner. A mod with
an exefs/subsdk* or a replaced exefs/main stays off as a whole; mods_without_code = 1 under [mods] uses the rest of it
(RomFS files, cheats, ExeFS patch files) without that code. ModInfo.code names the modules that do not load; the
scan logs it, the Mods tab says it on the mod's row and shows the switch once such a mod is there.

Co-Authored-By: itaskaev2 <165683571+itaskaev2@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:56:42 +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 547350167b The shadow's word merge loads whole words and updates only the bases over the range
diff_run read each word with a memcpy of variable size, a library call per word, and base_set walked every pending
range (about a hundred) for each run of differing words. word_at loads 4 bytes directly and the bases over the merged
range are found once per merge. Rain at night, shadow = 1 and sync_ahead = 1: the fence write-back took 11-12 ms per
60 frames instead of 20-22 (the plain copy with TOTK_WB_MERGE=0: 7-8 ms). No change in what is merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:12:35 +03:00
Valiantsin DzerakhandClaude Opus 5.5 af1329440d barrier_merge costs nothing per draw while off and guards the reads a merged Barrier cannot order
The storage check in prepare_draw ran on every draw with the setting off; it now runs only when the context's cached
flag is on, and after bind_resources, which may restart the pass (ub_written) and clear the note of a storage writer.
A pass whose target is a 3D BC stand-in no longer merges: its texture gets the writes only at the pass end. After a
merged Barrier, a draw with a storage image or a vertex texture that is an attachment of the pass ends the pass and
begins the next behind the full barrier (merge_guard), since the in-pass by-region barrier orders only fragment shader
sampling. The per-bit Barrier counters count only under TOTK_TRACE=gfx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:03:42 +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
Valiantsin Dzerakh c9f155b72f Merge branch 'pr/1239' into task/pr1239 2026-11-16 17:48:33 +03: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 f8e0a7b374 The shadow's word merge skips equal words 64 bytes at a time 2026-11-16 04:01:22 +03: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
ipavlin98 cabbfc5c86 Shadow storage merges pending GPU writes word by word in both directions, so falling rain draws with shadow = 1: the CPU copy into the shadow skipped every range a recorded GPU write covered, and the particle buffer the rain shaders update is always one, so new drops never reached the GPU, and the copy back at the fence put the shadow's whole range over them 2026-11-16 03:46:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c5b1cc7fac The GPU address map for device faults is off by default (#1174)
With VK_EXT_device_address_binding_report enabled, AMD's Windows driver (26.10.1) tracks every bound range in a
chained hash map that it searches on nearly every recorded command. The chains grow as textures stream in and out, so
after 5-10 minutes in a busy area recording a submission cost 3-4 times more and an RX 9070 XT fell from 60 to 20-30
fps. The map only serves the fault report after a device lost, so TOTK_ADDR_REPORT now defaults to 0 and =1 turns it
on for a run that chases a fault. ADDR_REPORT is a known key now, so the ini line no longer logs "unknown key".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:13:00 +03: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 d6715029e5 A device loss logs the last descriptor pool events, and a pool with two owners is logged at once
The replay keeps a ring of the last 1024 descriptor pool events (a CbRes made, a pool handed to a CbRes from the spare
list or new, a pool reset or destroyed), a few per submission and nothing per draw. vk_device_fault_report logs the
newest 256 after a device loss. Each pool's owner is checked under spare_lock as the pool is handed out and as it is
reset: a pool handed out while another CbRes holds it, or reset by a CbRes that does not hold it, is logged at once
with the 64 events before it. On a GTX 1050 Ti with TOTK_BIND_INC on, the validation layer reported a descriptor pool
reset while a command buffer used it, then binds of its sets, before a device lost that slower diagnostic runs did
not bring back; the next one names the pool's owners.

--probe-vkexec gains a set batch part (60 submissions of batched sets with splits and empty submissions beside them),
a pool owner part (one pool handed to two CbRes, then reset by the one that no longer holds it: two conflicts) and
calls the device loss report on the working device to check that it comes out and returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 18:55:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 810cf2c2bb The memory probe's slot redirect check follows a texture of the slot's own format
Since 1c5c6fdb a finalized slot follows only a live entry of its texel format at its storage; the check still put an
RGBA8 texture over a BC1 slot and expected the slot to follow it. The live texture is now BC1 of another size, and a
second check puts an RGBA8 texture at the same storage and expects the slot to stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:12:40 +03:00
shenjack 74bb01d2af Preserve pool flags in the Vulkan memory probe texture fixture 2026-11-15 11:07:25 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c26c3a04bc Merge pull request #1203: on AMD's Windows drivers objects against clouds and fog lose the light blocky fringe round their silhouettes; a discard demotes the fragment as on the Switch (codexx-dev, #164)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:38:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6ff98e2d61 Contact shadows take the in-image neighbour on the screen border when they find the surface normal
On the border the clamped neighbour is the pixel itself, so the nearer-in-depth pick took a zero difference and
normalize() returned NaN; `lit <= 0.0` is false for NaN, so whether those pixels were marched and what they wrote
depended on how the driver clamps NaN. The border now uses the side inside the image, and a NaN gate skips the march.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:05:54 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f76a24a7cf Merge pull request #1200 into task/pr1200: with contact shadows on, rock faces turned away from the sun no longer go dark and smoky in haze and fog (itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:34:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 0efa904d90 A new controller no longer inherits the previous one's gyro bias, and a calibration where the pad moved is rejected
The bias reset in sensors_ready only ran when sensor_pad was nonzero, but scan_pads zeroes it on every disconnect,
so a pad connected after another one kept the old pad's bias, and an attempt still collecting finished on the new
pad under the old pad's name. The bias was also loaded only once, at the first StartSixAxisSensor.

- input.c pad_bias_select runs for every pad the sensor code sees: it drops the old bias and attempt, then loads the
  saved bias when gyro_bias_pad names this pad. scan_pads drops them on disconnect. The bias loads with
  gyro_calibration off too, so turning the switch on mid-run applies it.
- The pad identity is the name plus an FNV-1a hash of SDL's serial when the pad reports one, so two pads of one
  model no longer share a bias; the hash keeps the Bluetooth address out of totk.ini and the log.
- An attempt skips 0.5 s of samples (the button press shakes the pad), then averages 1 s. It is rejected when the
  largest per-axis standard deviation exceeds 0.04 rad/s; a steady bias of any size passes. The row then says the
  controller moved (new UI_MENU_GYRO_CALIBRATE_MOVED in all four catalogs) and the bias in effect stays.
- The timeout counts 5 s without a sample, not 5 s from the start.
- Calibrate gyro starts the sensor thread when the game has not yet (title screen) instead of doing nothing.
- Row states are an enum (MOTION_CALIB_*); motion_calibrate_start takes the clock, and only the gamepad's fusion
  instance writes totk.ini, so --probe-services now checks a measured bias, a rejected attempt and the timeout.
- The duplicate copy_name in motion_fusion.c is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:32:05 +03:00
Valiantsin Dzerakh 0a792f22c1 Merge pull request #1197 into task/pr1197: a Calibrate gyro row on the Controls tab removes the aim drift of a controller with a large gyro bias (palxex) 2026-11-15 09:21:40 +03:00
Valiantsin DzerakhandClaude Opus 5.5 7b5265d1fd Discard as demote runs only where shaderDemoteToHelperInvocation is enabled, and the log says whether it is on (#164)
vk_device.c create_device records the feature from the Vulkan 1.3 chain it passes to vkCreateDevice. spirv_demote
leaves the module as the translator wrote it without the feature, also under TOTK_DEMOTE=1, since the
DemoteToHelperInvocation capability needs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:19:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 fda4e62405 Merge pull request #1203 into task/pr1203: objects against clouds and fog lose the light blocky fringe on AMD's Windows drivers (codexx-dev)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:08:13 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2ab5329909 The NVN probe's Cpu gets the FP result check threshold too
Its static Cpu ran guest code with a zeroed threshold, which lets +-smallest normal pass the check unexamined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:54:22 +03:00