mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -04:00
Replay workers record mesh draws, and stop waiting for each other at queries and per-object motion.
Mesh draws ended a group and stayed on the submitting thread: 119 a frame in Hyrule Field at about 13 us each, and the groups around them were cut short. They are recorded in the chunks now: the entries filled ahead for the indirect ones are the draw context's, the ring index is taken atomically and the ring is made before the chunks record, each chunk counts the ops that break a run of them on its own, and the lazy lookups of the mesh and shading-rate entry points store their pointer before the flag that says it is there. With the mesh fallback, and while NX2NAVI_GPU_PASSES copies the workgroup counts, they stay on the submitting thread. A chunk's closed occlusion query slots go into a list of its own and into their segments once the group is done, in chunk order, instead of under a lock per query. The per-object motion check decides alone per draw context (its variant memo is per context) and takes its lock only to list a draw. The occlusion query ring has 16384 slots: the chunks' blocks are sized to their draws, and with 4096 the ring came round to slots not reset yet. The perf line splits the submitting thread's time with workers on: ops outside groups by kind, the front pass, its own chunks and the wait for the others, and which ops ended the groups. Hyrule Field, RX 7900 XT, 3440x1440, FSR 4 Native AA, same batch: standing 51.7 fps with 3 workers against 43.6 with the workers off (replay 11.2 against 15.1 ms); along the field route 48.9 against 44.7. Screenshots standing and along the route match the replay without workers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -164,7 +164,11 @@ void vk_exec_draw_group_begin(VkExec *ex);
|
||||
void vk_exec_xfer_group(int on);
|
||||
int vk_exec_xfer_front(VkExec *fx, uint32_t op, const void *payload);
|
||||
uint64_t vk_exec_xfer_chunk_state(void);
|
||||
void vk_exec_xfer_worker(int on, const uint8_t *cond, uint32_t ncond, uint64_t state, uint32_t slot0, uint32_t nslots);
|
||||
void vk_exec_xfer_worker(int on, const uint8_t *cond, uint32_t ncond, uint64_t state, uint32_t slot0, uint32_t nslots,
|
||||
int chunk);
|
||||
// After every chunk of the group is done (submitting thread): the slots the chunks closed go into their segments, in
|
||||
// the order of the chunks.
|
||||
void vk_exec_xfer_group_merge(int nchunks);
|
||||
// The front pass: whether a draw here counts samples (a query slot), and n slots of the ring in the order of the stream
|
||||
// for one chunk (the first is returned; vk_exec_xfer_worker hands them to the chunk's worker).
|
||||
int vk_exec_xfer_counting(void);
|
||||
@@ -290,6 +294,7 @@ uint64_t vk_exec_event_late_take(void); // waits only a CPU signal after t
|
||||
void vk_exec_event_stats(uint64_t *waits, uint64_t *unmet, uint64_t *late, uint64_t *late_subs);
|
||||
extern uint64_t vk_exec_submit_seq; // replay thread: submissions replayed so far
|
||||
extern uint32_t vk_exec_brk; // replay thread: bumped by every op that is not state or a draw (vk_exec.c op_linear)
|
||||
uint32_t vk_exec_brk_now(void); // vk_exec_brk, or in a parallel group's chunk the chunk's own count
|
||||
int vk_exec_mesh_run(const void *cur, const void **out, int max);
|
||||
void vk_exec_mesh_run_stops(char *out, size_t n);
|
||||
// NX2NAVI_EVO_TRACE=1 (diagnostics, vk_exec.c "event order trace"): one token per step of the replay's event order.
|
||||
|
||||
Reference in New Issue
Block a user