Commit Graph
138 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 166e5a7b7d Drop released textures oldest first, one per release past 2048, instead of all of them once the count passed 4096: that sweep destroyed thousands of images in one frame, 333-422 ms frames every 40-50 s on a GTX 1050 Ti, and the textures still in use came back as new images and uploads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:14:11 +03:00
Valiantsin DzerakhandClaude Opus 5.5 01dfe5d5a6 Take staging buffers from a VMA pool of their own that keeps two 64 MiB blocks from boot: in the default pool a block made by the headroom thread or by a burst of uploads held the render thread's staging allocations under the memory type's lock, 47-50 ms for one in the first frame after a save load (that frame 138 -> 70 ms)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:06:40 +03:00
Valiantsin DzerakhandClaude Opus 5.5 41f201ad39 Skip full-screen draws while their pipeline builds by default (TOTK_PIPE_SKIP=fullscreen): in a fight a full-screen pass whose stage libraries were cold in the driver cache held three frames in a row at 64-72 ms, each spending the 50 ms wait budget, and some draws were skipped after all
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:02:18 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9dc738c045 Count untimed script lines in 60 Hz ticks of game time instead of presents, so the title menus get scripted presses at the same game time at any frame limit; in a recording the untimed lines stop when the world clock starts, and the recorder cuts a button or stick held at that moment and continues it as a timed event
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 14:49:41 +03:00
Valiantsin DzerakhandClaude Opus 5.5 5da6c5bb89 Merge the frame critical path recorder: TOTK_CRIT=<first>-<last frame> with TOTK_TRACE=sched writes the guest threads' state changes and wakes, read by tools/crit_path.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 14:13:40 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2fe6a6d4c1 Keep MXCSR in line with FPCR where FPCR changes instead of checking it in every FP op
The FP helpers compared c->fpcr with a cached copy before every operation to resync MXCSR lazily. MXCSR now
follows FPCR.FZ at once: MSR FPCR calls rt_fpcr_sync, and so do rt_call (thread, fiber and host entry into guest
code), fiber resume (FIBER_FLAG_FLOAT_SWITCH fibers keep their own MXCSR) and the differential test harness per
case. op and vop only test FPCR.RMode for the slow path, and their redo check is one ordered-not-equal compare of
|r| with the smallest normal, the same NaN-or-smallest-normal set as before.

Hot guest code shrinks by about a quarter (132 functions holding half the guest cycles, 1.4.3); fight frame time
moves 1-3%, inside the run-to-run spread. lift, simd, func, atomic and flags_check pass on 1.4.3; simd.py fails
without the harness sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:25:25 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ba52fe6e89 Record the critical path of the frame with TOTK_CRIT
With TOTK_TRACE=sched, TOTK_CRIT=<lo>-<hi> records every state change and wake of the guest threads and every
present over those frames (runtime/kernel.c crit_add from acct() and wake(), crit_frame at the present) and writes
them to TOTK_CRIT_OUT at the last frame. tools/crit_path.py walks back from each present through the waits to the
thread whose signal ended them and splits the frame interval by thread and state; the sums equal the interval.

A 1.4.3 fight: with the replay on the submitting thread the path is 7.3 ms of replay on the render thread and 4.3 ms
of guest code; with TOTK_REPLAY_ASYNC=1 it is 10.1 ms of guest code through the fork-join of the main thread and five
workers, at the same frame interval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 09:26:07 +03:00
Valiantsin DzerakhandClaude Opus 5.5 27056b212a Keep NZCV in a local of each generated function instead of c->nzcv
Every flag-setting instruction packed N, Z, C and V into c->nzcv and every reader unpacked them. recomp/flags.py
now runs a reaching-definitions pass per function: a compare stores its operands in a local Flags F, and a reader
whose definitions are all of one kind computes its condition from them, so cmp and b.cond become one host compare.
CCMP, FCMP, MSR NZCV and ADCS write the packed form, which readers reached by several kinds also use. Calls and
returns publish nothing (AAPCS64 neither passes nor preserves NZCV); tail branches, falls into the next function and
br through rt_dispatch publish c->nzcv, since discovery can start a function inside another one. Functions with an
unresolved computed br keep flags in c->nzcv.

1.4.3 main: 492k direct and 89k packed flag reads, .text 342 -> 299 MiB. Fight bench (bench-fight2-2026-10-27b,
frames 5400-7500, uncapped) 13.15 and 13.63 ms vs 13.9 before. tests/flags_check.py checks the new helpers against
the packed ones; tests/diff/func.py no longer compares NZCV, which generated code leaves untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:07:58 +03:00
Valiantsin DzerakhandClaude Opus 5.5 101f2c8b5e Give the virtual core up in nn::fs host functions and in NVN memory pool setup, as the Switch blocks those threads in IPC: the game's loader threads held a core through CloseFile, CreateCacheStorage and nvnMemoryPoolInitialize (up to 20 ms) while job workers waited. Core diagnostics now also report waits on an owner in a host call, with its module, offset, latest SVC and guest lr, and the AllocateMemoryPages and AllocateAddressRegion lines need TOTK_TRACE=host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:42:14 +03:00
Valiantsin DzerakhandClaude Opus 5.5 5b783728e5 Count NVN calls per thread and add them to the shared counter 1024 at a time: the main thread and the job workers record command buffers, and a locked add per call kept the counter's cache line moving between their cores
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:29:32 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8e15d70fd4 Scale the performance counter by a fixed-point multiplier set before main: plat_now_ns and rt_ticks divided a 128-bit product by the counter frequency on every call, and __udivti3 took 5% of the game's running samples
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:22:11 +03:00
Valiantsin DzerakhandClaude Opus 5.5 acd550e822 Merge the VRAM headroom: a background thread allocates the next VMA block of each memory type before the render thread needs it (vk_headroom.c, TOTK_VRAM_HEADROOM)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:09:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d1149e5060 Allocate the next VMA block of each memory type on a background thread: a new block made by another thread wakes vk_headroom.c, which allocates half a block every 500 ms and keeps it as the anchor of a block it had to create, so the render thread finds room instead of calling vkAllocateMemory for 8-19 ms; no headroom above 85% of the VRAM budget (TOTK_VRAM_HEADROOM)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:05:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bac4d6cf91 The shader memo skips its 1 KiB handle compare while no texture or image was bound
memo_match compared the vertex and fragment stages' 64 texture and 64 image handles on every draw. Every OP_BIND_TEX and now every OP_BIND_IMG bumps tex_serial; a key whose serial is current has the same handles, and a key that matched by the compare takes the current serial. memo_match went from 0.95% to 0.27% of the fight replay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:54:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c238c341c7 Replay command buffer parts span at least a millisecond of recording
A fight frame of about 2,000 draws made 15 parts on the 7900X at 64 draws a part, each split costing the render thread a submit, a new command buffer and a mirror prologue (vk_sync_split, 7.6% of the replay). maybe_split now also waits until TOTK_SPLIT_US (1000, 0 off) has passed since the part began, so a frame makes 7-9 parts there. A millisecond of recording is well under a millisecond of GPU work, so the GPU still starts early in the frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:53:59 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c9c06f2501 Render target views of registered textures live as long as their image
vk_exec_pass_begin created every attachment view again in each submission and freed them at its fence: 2% of the fight replay on the 7900X, more on drivers with a slower vkCreateImageView. view_of now takes the view from vk_exec_target_view, which keeps it in the sampled-view tables under the texture lock, and vk_exec_image_gone releases it with the image. Images that are not registered textures keep the per-submission views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:53:59 +03:00
Valiantsin DzerakhandClaude Opus 5.5 403606bbcb The settings menu draws over the performance overlay while it is open
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:24:14 +03:00
Valiantsin DzerakhandClaude Opus 5.5 89cc960f09 Menu navigation with the left stick and back from the bottom buttons; AMD sensors and the picture lines in the performance overlay
The left stick now moves the menu cursor as the D-pad does (ImGui only scrolled with it). The page's rows are a
direct NavFlattened child of the menu window: behind a second child level ImGui did not clip them, so up from
Continue went to the tabs and down from the tabs to Continue.

The full overlay reads temperature, board power, clock and GPU load from ADL's PM log on AMD GPUs (matched by PCI
bus), and shows the window, game image and 3D scene sizes, the scaling to the window (FSR and its sharpness), the
frame limit and the presentation mode in use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:21:41 +03:00
Valiantsin DzerakhandClaude Opus 5.5 eca89641fa Keep 1.2.1's scene at the wanted size, package zstd for the installer
1.2.1 renders the scene size it reads, while 1.4.3 scales it by output width / 1920: on 1.2.1 the scene set is on
whenever the output grows (2560x1440 gave a 1600x900 scene before, 2133x1199 now). An output at or below the shipped
size needs no grown HeapDef. The release deps carry the static libzstd and its header, totk.ini.example the four new
keys, THIRD_PARTY_NOTICES.md the MacNativeGames sites, FSR 1 and zstd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:56:28 +03:00
Valiantsin DzerakhandClaude Opus 5.5 7abdbc90ac Render the game above 1080p and scale it to the window with FSR 1
The output and scene patch sets make the game read its output, swapchain and scene sizes from the patch page
(MacNativeGames' sites for 1.2.1 and 1.4.3); resolution.c picks them from TOTK_OUTPUT_RES and TOTK_RENDER_SCALE and
grows the HeapDef texture heap, its parent and the application pool to match. vk_fsr.c runs AMD FSR 1 EASU and RCAS
on the present when the window is larger than the game's output (TOTK_UPSCALER, TOTK_SHARPNESS).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:40:34 +03:00
Valiantsin DzerakhandClaude Opus 5.5 97d3762ba1 Strip milestone and task labels from code comments and drop the dead gfx_stubs.c
Comments named the agent task (T1-T7, M2-M5, Task 2.x) that once owned each file or block, and pointed at local
notes the repository does not carry (backlog items, milestone plans, research notes). They now say what the code
does. gfx_stubs.c held weak stand-ins for functions that every build has defined for a long time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:12:50 +03:00
Valiantsin DzerakhandClaude Opus 5.5 42b73c4098 Note what each 2026-10 frame time fix needs on a Linux host: the SleepThread spin is for the Windows timer only, the file I/O moved off the game and render threads is portable with fsync in place of FlushFileBuffers, the slow-present profiler is Windows-only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:01:22 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b12bbe7705 Merge the overlay width fix: the full overlay's frame time plot and wait table fill the panel, and the wait numbers end at its right edge
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 12:17:31 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d5d8497825 Stretch the full overlay's frame time plot and wait table to the panel width, with the numbers on the panel's right edge
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 12:17:27 +03:00
Valiantsin DzerakhandClaude Opus 5.5 277c8484e7 Read every shader use mask file on a background thread at start, so the render thread opens none in play
Each draw's first sight of a program opened its <hash>.use file on the render thread (use_find from gfx_shader_get_async). The open takes 0.1 ms alone but took 11-40 ms in play behind the translator's and the pipeline cache's writes and flushes on the same volume (slow-present dumps of a 1.4.3 fight session). The 45131 masks of a prepared 1.4.3 cache load in about 12 s below normal priority, before the first save load ends; until then lookups read the file as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:40:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ecc90b5678 Record and replay input on a world clock: game seconds stepped since the player first stands away from the title screen's origin
With the real-time frame step, a frame advances the game by its own length, so a recording keyed by presents replayed at another frame rate pressed at other game times, and every load of another length shifted the rest. Lines after the first save load are now written as "@<ms> <what> <hold ms>" and replayed on that clock; menu input before it stays in presents. Two replays of one recording whose loads ended at presents 1887 and 2094 kept the player within 2 m for 15 game seconds, until the fight's own nondeterminism took over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:40:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 adc4d7aa9c Dump every thread's call chains of a slow present (TOTK_PROFILE_SLOW=<ms>), and never copy a stack whose Rsp sits in its guard page
The sampler keeps the last half second of every thread's chains in a ring and writes the samples of a present interval over the threshold to <TOTK_PROFILE>.f<frame>, per thread and time (tstack), with the samples that took over 2 ms to stop their thread (tstall: the thread was in a long kernel call). A thread that ran no cycle since its last sample repeats its chain without being suspended. A thread stopped between its sub rsp and the stack probe has Rsp in the guard page; copying from there raised STATUS_GUARD_PAGE_VIOLATION and ended a run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:40:32 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6fca957670 Run the save Commit on a background thread: the copy, flushes and renames held the game thread 95-135 ms at every game save in the 1.4.3 fight save
The game's Commit returns at once. Every later change to the working copy, Unmount and the next Commit wait for the thread, so no write lands in the snapshot, and the window close, guest ExitProcess and --frames exits wait through fs_save_flush. A crash during the commit loses that commit only; the transaction and save_recover are unchanged. probe-fs waits for each commit and checks a write and an Unmount right after Commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:01:54 +03:00
Valiantsin DzerakhandClaude Opus 5.5 650c69bcb5 Save the pipeline cache and append pipeline keys on an autosave thread, without P.lock: the save held P.lock through vkGetPipelineCacheData and the file write (about 60 ms) and ran on the present thread, so every 20 s the replay stopped at its next pipeline lookup or waited for the present thread (60-80 ms freezes on the 1.4.3 fight); shader record files are written outside RC.lock for the same reason
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:45:53 +03:00
Valiantsin DzerakhandClaude Opus 5.5 dc69797746 Index recording copies by 64 KiB block instead of 4 KiB page: AddControlMemory walked about 500 pages per call under the exclusive copy lock (53 calls a frame, 2 MiB ranges on the 1.4.3 field), and the main thread and job workers recording command buffers waited on it; field walk 72-77 fps to 78-80
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:17:14 +03:00
Valiantsin DzerakhandClaude Opus 5.5 95ae91687c Spin short SleepThread calls on the performance counter: the high-resolution waitable timer ended the SDK's 20 us polling sleeps after 460-515 us on the main thread and the job workers; the sched trace now reports wake-to-run and core-grant-to-run latency and asked versus taken sleep time per thread
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:17:13 +03:00
Valiantsin DzerakhandClaude Opus 5.5 639d00efb4 Merge the main thread wait tracing: TOTK_TRACE=sched reports the guest main and render threads' waits by object and by the thread whose signal ended them, and TOTK_PROFILE_MAIN=1 samples the main thread alone with call chains
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:54:28 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a653f4cdd1 Merge the driver cache correction: a relink keeps the AMD driver's pipeline cache, so build_game no longer re-warms it after every relink; the cold libraries came from preparing another build dir, and --warm-shaders stays for that case
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:54:28 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ff75f32189 Copy a finished recording in one exact-size allocation and one memcpy, and inline a called recording as one block: record-by-record copies with doubling reallocations held the game's main thread about 1 ms a frame (MacNativeGames 5189ade does the same)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:44:53 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bd9851f4f2 Trace the guest main thread's waits by object and by the thread whose signal ended them (TOTK_TRACE=sched), and sample the main thread alone with call chains (TOTK_PROFILE_MAIN=1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:23:35 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e9865f188c Open the game window behind the user's windows without taking focus
The window appeared over everything with the game's blank blue loading frames and took the focus. It now opens at the
bottom of the z-order, flashes its taskbar button until the player brings it up, and applies the fullscreen setting at
that first activation. The game counts itself in focus until the first WM_ACTIVATEAPP, so loading goes on behind;
keyboard input already waits for the foreground window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:16:46 +03:00
Valiantsin DzerakhandClaude Opus 5.5 5784084590 Drop the driver cache warm after every relink: a relink keeps the AMD cache (29,587 variants re-warmed in 1.8 s), the cold libraries in play came from preparing another build dir, which evicted this one's; --warm-shaders stays for that case
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:10:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 7daeffdc08 Warm the GPU driver's cache again when build_game relinks a prepared build: the cache is keyed to the exe, and after a relink every new stage library took 40-220 ms in play instead of about 2 ms; totk.exe --warm-shaders builds the prepared variants from the shader cache without translating
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:00:54 +03:00
Valiantsin DzerakhandClaude Opus 5.5 138a7d3a99 Commit a save by writing only the files that changed and hard-linking the unchanged ones to the committed save: the game rewrites 3-4 of 82 files per save, and flushing all 82 held the game thread for 300-380 ms
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 08:55:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6d216840dd Merge the device-local memory census: a mem: vram line every 600 frames with TOTK_TRACE=perf, and backlog item 20 with the released texture entries as the grower and machine B at its budget
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 08:14:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9758b8365e Log what holds device-local memory every 600 frames with TOTK_TRACE=perf: VMA blocks and allocations, texture entries live and released with the bytes of their own memory, VRAM mirrors and pending releases
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:39:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2bcba6bc3f Keep which shader of a program serves each stage per program serial instead of reading every stage's control block several times a draw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:01:54 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b92f113073 Check a texture's storage pages only in the 2 MiB regions stamped since its last check: an unchanged 4 MiB texture read 1,024 page generations, at about 1,100 checks a frame
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:01:54 +03:00
Valiantsin DzerakhandClaude Opus 5.5 895aa43ab9 Wake the completion thread for a new callback only when its value is already reached: the replay's callbacks wait for the submission it records, whose submit wakes the thread anyway
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:56:48 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bcbbcb0b1a Keep texture lookups per slot instead of per global texture generation, and vertex buffer spans while their ranges repeat
TotK finalizes and initializes transient textures every frame: the global tex_gen and slots_gen moved about every 16
draws in the monsters fight, so every cache keyed on them (the slot cache in vk_texture_by_id_locked, the texture types
of answers_for, the texture descriptor memo) lived for a few draws. A slot resolves through the entries at its own
storage address only, so each address hash now has its own generation and each slot a token
(vk_texture_slot_token: registration serial and address generation, lock-free). The memos check the global generation
first and the slot's token only when it moved.

The descriptor memo no longer drops an entry at each submission (the first binding still makes the storage check; a
re-upload writes the same image) or pass (the feedback layout is set on each hit from the kept image), and is twice
the size. feedback_scan keeps each handle's sampled subresource across passes instead of looking up every fragment
texture after every texture bind. bind_vertex_buffers keeps each stream's resolved span while its range and
vk_mem_gen stay the same.

Monsters fight on the RX 9070: replay 12.0 -> 10.8 ms per frame; field 8.1 -> 7.4 ms. TOTK_TEX_MEMO=check and
TOTK_SHADER_MEMO=check runs found no difference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:55:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 353c237208 Count the replay's buffer traffic with plain adds: the replay is the census's only writer, and the locked add was 2% of fight replay
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:55:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6b65fb6c0e Keep sampled-texture descriptors between draws while the slot, sampler, submission and feedback pass stay the same
tex_info resolved the slot, built a view key, probed the view table and looked up the sampler for every texture
binding of every draw. A direct-mapped memo keyed by handle, resource type and separate returns the descriptor while
vk_texture_slots_gen, vk_sampler_gen, the submission epoch and (with feedback-loop images) the pass are unchanged;
storage images are not kept. TOTK_TEX_MEMO=0 turns it off, =check recomputes every hit (a fight run with it and
TOTK_SHADER_MEMO=check stopped on nothing). Against main, profiler on, no bind stats: fight replay 13.9 to 11.9 ms per
frame, render thread busy 16.3 to 14.6 ms, CPU-bound windows 15 to 9; field replay 9.5 to 8.2 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 22:50:22 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1836d5c5d0 Keep texture image views for the image's lifetime instead of creating them again in every command buffer
Views made per command buffer were created anew every frame: vkCreateImageView under get_view took about 8% of the fight
replay on the 7900X. They now live in one table keyed as before, used under the texture lock, and destroy_tex hands an
image's views to the deferred release with the image (vk_exec_image_gone). The buffer range limits ubo_info and
ssbo_info read on every binding are read once. Fight replay 14.0 to 12.5 ms per frame (15.7 before the branch), field
9.5 to 9.2 ms; a fight run under the validation layer shows only the known cp_t_tcb_20 message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 22:42:47 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b273005901 Look up texture types only for the slots a shader's translation reads, and reuse the previous draw's pipeline while its state repeats
answers_for looked up the type of all 64 texture and image handles of a stage whenever one changed; the use mask of the
first shader of each program stage now limits it to the slots that select the variant, with a generation per slot and
the texture lock taken only on a miss (texture type recomputations per draw 0.39 to 0.05 in fight). prepare_draw keeps
the previous draw's pipeline info while the pipeline state is equal (TOTK_PIPE_MEMO), and reads the clock only for
draws that may wait. Fight on the 7900X: replay 15.7 to 14.0 ms per frame, 53.3 to 58.7 fps; field 11.1 to 9.5 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 22:31:53 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1385e7af9b Drop Portuguese from the game language list, which TotK does not ship, and note under Presentation the mode the swapchain got when it differs from the setting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 20:55:08 +03:00