With the unwritten-read rule every read that stays merged comes from a draw that samples a target it also writes,
the case Savage Wind runs the same way on every GPU. Shrine on the RDNA2 iGPU (AMD Windows driver, 1080p): passes
581 -> 128 a frame, GPU time unchanged (37.2 ms off, 38.0 and 36.5 ms on), the picture the same. PR #1237 measured
the waterfall on RADV at 1105 -> 117 passes and GPU 8.3 -> 4.1 ms, and an RTX 4080 shrine at +3% mean fps with the
1% low 83 -> 98. barrier_merge = 0 brings back a full barrier at each such Barrier.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The by-region barrier inside a merged pass orders only the pixel a fragment writes. A draw that reads a target other
draws wrote, without writing it, may read neighbouring pixels (blur, ambient occlusion, light composites), which only
the game's full Barrier orders on every driver. Such a draw now ends the pass, as Savage Wind does for the same case.
TOTK_TRACE=gfx counts these restarts by colour and depth. Shrine, town and field on 1.4.3: 0 restarts; every read
after a merged Barrier comes from a draw that writes the target it samples.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spirv_demote turned every OpKill inside a selection into OpDemoteToHelperInvocation on AMD's Windows driver. A
demoted fragment runs the rest of the shader, so every alpha-tested draw (grass, foliage, hair) paid for its
discarded pixels. The cloud fringe of #164 came from OpImageQueryLod after the discard. Now a discard is demoted only
when an OpImageQueryLod, an explicit derivative or a function call follows it in its function; the rest keep the
plain discard, as before 0.4.1. On the field save 1 of 128 shaders with a discard is demoted, and the picture keeps
the fix.
demote has a row in the settings table and a description in totk.ini.example, so demote = 0 or 1 in the ini no
longer logs an unknown key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
With restbl_cache = 1 on the restbl mods: built on the first start, served on the second with the same bytes, built
again after a rewritten mod file, an added or removed mod, another order and a new totk.exe, and after a torn or
random key file and a damaged or missing table. With the default 0 the key is neither read nor written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The eight new menu tables still used UI_MENU_FSR3_SHARPNESS and lacked the four FSR 4 upscaler strings, which dev renamed or added, so the PR did not compile on dev. installer/text/vi.json lacked the six fsr step, phase, warning and checkbox ids. CONTRIBUTING.md lists all twelve menu languages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
pack_shader_cache.py picked 8 readers on every machine. It now takes half the logical CPUs, 1 to 8, so a 1- or
2-CPU PC reads one file at a time, and reads serially with less than 512 MiB free RAM (tools/hostmem.py, as the
compile and lift workers use). --read-workers still overrides; the log names the choice.
The read-ahead is also capped at 32 MiB of file data by the listed sizes, beside the two files per reader; a file
larger than the cap is read alone.
Any failure of the parallel path (a thread that does not start, a MemoryError in a reader, an executor error) prints
a line and reads the remaining files serially, so the pack still completes with the same bytes.
Tests cover the worker choice, the byte cap and the three fallbacks, each giving the same pack as a serial run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>