mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -04:00
Let one replay worker record each long run of draws from a copy of the replay state, behind NX2NAVI_REPLAY_WORKERS.
Stage 1 of recording a submission on several threads. A submission's draws come in runs between ops that have to stay in the replay's order on its own thread (dispatches, copies, texture and buffer clears, events, the game's barriers, calls). With NX2NAVI_REPLAY_WORKERS=1 a run of 16 draws or more is recorded by a worker thread: it takes a copy of the replay state, records the run into a command buffer of its own pool with a draw context of its own, ends it behind a full barrier and hands the state back. vk_sync_append puts that command buffer into the part between the replay's own pieces before and after it, so the GPU runs everything in the op stream's order. The submitting thread waits for each run, so every side effect keeps the replay's order; this stage checks that a run recorded apart from a copy of the state gives the same pictures. The default, 0, replays as before. walk's handling of the ops that do not steer it moves into op_one, which the worker uses too. NX2NAVI_REPLAY_RUNS=1 logs every 600 frames how the draws fall into such runs and which ops break them. The draw replay's hot functions load their recording context once instead of at every use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -148,6 +148,10 @@ void vk_exec_inline_end(int reopen);
|
||||
// recording a replay into cb for submission `fence`, so vk_exec_inline_begin hands cb out. Called from the record
|
||||
// callback of vk_sync_submit_own, where a replay would be recorded.
|
||||
void vk_exec_probe_inline(VkCommandBuffer cb, uint64_t fence);
|
||||
// vk_exec_draw.c, the replay workers: a draw context of their own (what draws keep from one to the next while they
|
||||
// record: vk_exec_draw.c DrawCtx), and the one the calling thread records with from now on (NULL: the replay's).
|
||||
void *vk_exec_draw_ctx_new(void);
|
||||
void vk_exec_draw_ctx_use(void *ctx);
|
||||
// vk_exec_draw.c: forget what the command buffer being recorded has bound (pipeline, sets, dynamic state, vertex
|
||||
// buffers): the replay continues in a new one (vk_sync_split).
|
||||
void vk_exec_draw_new_cb(void);
|
||||
|
||||
Reference in New Issue
Block a user