mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 07:09:57 -04:00
Stage 2 of NX2NAVI_REPLAY_WORKERS (default 0, the replay as before). A run of draws is cut into groups: a group ends where the render targets change after its first draw or clear, and before an inline uniform update, a mesh draw and a samples-passed counter op, which the submitting thread replays itself in the order of the stream. A group of 64 draws or more is first walked by a front pass on the submitting thread: it applies the state and binds, settles the CPU side of the timestamp reports and decides the render conditions in the order of the stream, and copies the replay state at the first op of each chunk. The workers and the submitting thread then take the chunks in order and record each into a command buffer of its own, which vk_sync_append puts into the part in the order of the stream. The frame's pass hooks (contact shadows, DLSS) run in a group's first chunk, which the others start after. What still depends on the order between chunks waits until every earlier chunk of the group is done: a texture lookup that would make or take back an entry returns nothing and the chunk replays the op again in turn, and so do the contact shadows' pass, per-object motion and the HDR pass's source. The tables the chunks share take locks (the shader table, the descriptor lists, mirror use and GPU write notes, uniform snapshot drops, target frames, the DLAA camera votes and the previous-frame motion notes); each chunk keeps its own occlusion query open, its own feedback memo and no pass marks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
299 KiB
299 KiB