mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 02:09:57 -04:00
Mesh emulation: the stages of a pass's emulated draws run before the pass, in a command buffer of their own.
Each emulated mesh draw ended the pass, ran its stages between four barriers and began the pass again: a pass of 20 emulated draws became 20 passes, and on an RX 580 6 to 7 ms of a frame's 30 ms of GPU time went to the gaps between passes (gpu_passes in Kokiri Forest: 8.7-10 ms per frame outside the game's passes and dispatches, 6.3-7.7 ms of it in 273-306 gaps with barriers only; 71 emulated draws a frame, 36 of them indirect). Now the first emulated draw of a pass ends the part there (vk_exec_split_now), so the pass begins a new part, and the stages of every emulated draw of that pass, the indirect ones' ring entries included, go into the part's pre-pass command buffer (vk_sync_pre), which the queue runs after the mirror prologue and before the part; the pass is not split again. NX2NAVI_MESH_EMU_BATCH=0 (Lama patches: Mesh emulation before the pass) brings the split back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -125,6 +125,8 @@ typedef struct VkExec {
|
||||
const void *fb_fs; // feedback_scan's memo: fragment shader, texture bind serial, pass serial
|
||||
uint32_t fb_serial, fb_pass, fb_sampled;
|
||||
uint32_t tex_serial, pass_serial; // bumped by every texture or image bind and pass begin
|
||||
uint32_t pre_pass; // the pass (pass_serial) the part's pre-pass command buffer serves (vk_sync_pre;
|
||||
// vk_exec_draw.c mesh emulation); a pass begins after it with another serial
|
||||
} VkExec;
|
||||
|
||||
// Begins dynamic rendering with the current targets unless a pass is open (a full memory barrier precedes it). Call
|
||||
@@ -140,6 +142,7 @@ void vk_exec_barrier(VkExec *ex);
|
||||
void vk_exec_barrier_dispatch(VkExec *ex);
|
||||
// NX2NAVI_TRACE=perf, every 600 frames: the barriers per frame by kind.
|
||||
void vk_exec_barrier_log(uint64_t frame);
|
||||
int vk_exec_split_now(VkExec *ex);
|
||||
// vk_texture.c (NX2NAVI_TEX_ALIAS): commands that must run at the replay's current position. vk_exec_inline_begin returns
|
||||
// the command buffer being recorded after a full barrier (an open pass is ended; *reopen says so), or VK_NULL_HANDLE
|
||||
// when this thread is not recording a replay. vk_exec_inline_end begins the pass again when it was open.
|
||||
|
||||
Reference in New Issue
Block a user