mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-19 20:25:57 +00:00
nvnCommandBufferUpdateUniformBuffer between draws was replayed as a buffer copy at that point, which needs a barrier against the draws that read the old bytes, and a barrier ends the open pass. The terrain and the sky islands' meshes update before most of their draws: about 200 updates inside passes in a field submission, each a pass end, a full barrier and a pass begin. An update inside a pass now goes to the scratch buffer only. Later bindings of a range it covers bind the scratch bytes (ub_bind, from ubo_info and bind_range); a binding it covers only in part, or at an offset the alignment refuses, gets a merged copy of the snapshot or guest memory with the submission's updates on top. The copies into the real buffers are recorded behind one barrier of their own at the next full barrier (vk_exec_ub_flush from barrier_to). A new update of a range replaces the older overlay and pending copy of it, so the lists stay as short as the blocks. Copies, fills and storage writes of the same bytes retire the overlays they touch, and a storage binding over a pending copy brings the copies forward with a pass restart. bind_sig hashes the overlay each of the draw's uniform and storage bindings reads, so a draw of an updated block binds the newest bytes and the others still skip their descriptor build. TOTK_UB_OVERLAY=0 copies at once as before; ab alternates; TOTK_TRACE=perf prints the counts. 1.4.3, RTX 4070 Ti, 2560x1440 DLAA, standing still on Great Sky Island, TOTK_AB=10 (tools/ab_summary.py): 17.03 ms a frame with the copies at once, 14.39 ms with the overlays (-15.5%, 58.7 to 69.5 fps); replay time on the CPU 8.81 to 8.30 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BspNcezsiV8zT8wcnXrrME