Mesh emulation: cut the part at a pass's first emulated draw instead of splitting it, so the texture pool set stays.

A split hands the part to the queue and seals its texture pool set; the next part takes another set of the ring and
refreshes its entries first. The splits for the mesh stages made 5 parts a submission and 6 set switches a frame at
2.3 ms of replay each (Kokiri Forest on 0.7.1, an RX 580: replay 32-38 ms a frame, the replay thread blocked on fences
26-35% of the time, 79 waits for a set the GPU still used). A cut (vk_sync_cut) ends the command buffer without
submitting it: the part and its pre-pass command buffer wait in a chain and go to the queue, in order, with the next
part that does, so the set is the same one throughout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tobim6
2026-11-12 16:22:37 +01:00
parent 55ab90c66e
commit 38a3824b8f
5 changed files with 77 additions and 15 deletions

View File

@@ -5922,6 +5922,9 @@ static int mesh_emu_draw(VkExec *ex, uint32_t count, const VkMemSpan *ind, const
VkDescriptorSet set0 = ex->dc->B.ds_bound[0];
// NX2NAVI_MESH_EMU_BATCH (default on): the stages run in the part's pre-pass command buffer (vk_sync_pre), which
// the queue runs before the part, and the pass is not split for them. At the first emulated draw of a pass the part
// is cut there (vk_sync_cut: ended, but handed to the queue only with the next part, so the texture pool set stays;
// a split there took a new set, and each took 2.3 ms of the replay to refresh), so that the pass begins the next
// part and only what came before it runs before the stages. Split, a
// pass of 20 emulated draws was 20 passes, each emulated draw a pass end and begin with a full barrier, three more
// barriers and the targets stored and loaded again: on an RX 580 6 to 7 ms of a frame's GPU time went to the gaps
// between passes (gpu_passes, Kokiri Forest, 2026-11-10).