mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 06:59:57 -04:00
Let the game go on while the GPU runs the end of the last frame, with tail_early = 1.
The game waits each frame until the GPU has finished the frame before. In Hyrule Field with FSR 4 the last of that work is one part of 4.7 ms, the temporal upscaler and the interface drawn after it, then 1.4 ms of write-backs, and what the game reads of the frame is done before the upscaler runs. With NX2NAVI_TAIL_EARLY the replay records that tail into a command buffer of its own, and when it hands the CPU nothing but timestamps, writes no pool memory but inline uniform updates of mirrored blocks and reads no guest memory late, the write-backs go to the queue before it with the executed timeline's signal. The game's waits end there, and the GPU runs the tail while the next frame is prepared. The GPU's commands are the same; a tail that fails a test goes as before. Off by default. RX 7900 XT, Ryzen 7 5800X3D, 3440x1440, FSR 4 Native AA, one batch, replay workers off: 50.7 against 42.5 fps standing and 56.0 against 45.9 along the field route; with FSR 3.1, 51.8 against 47.8 and 54.9 against 52.3. With three replay workers, FSR 4, standing: 63.5 against 49.4. The screenshots matched those without it standing, along the route and through warps to five areas, with no black frame outside the loading screens of both. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -3303,7 +3303,11 @@ static uint64_t wb_skip(void) {
|
||||
}
|
||||
static int64_t m_wb_skipped; // bytes wb_skip kept in mirrors since the last summary
|
||||
|
||||
static volatile uint64_t n_gpu_wrote; // vk_mem_gpu_wrote_count
|
||||
uint64_t vk_mem_gpu_wrote_count(void) { return __atomic_load_n(&n_gpu_wrote, __ATOMIC_RELAXED); }
|
||||
|
||||
static void gpu_wrote(const VkMemSpan *sp, uint64_t size, int shader) {
|
||||
__atomic_fetch_add(&n_gpu_wrote, 1, __ATOMIC_RELAXED);
|
||||
PoolRec *r = sp->pool;
|
||||
if (!r || r->mstate != MS_ON || sp->buffer != r->mbuf || !size || !wb_lazy()) {
|
||||
uint64_t skip = r && r->mstate == MS_ON && sp->buffer == r->mbuf ? wb_skip() : 0;
|
||||
@@ -3678,6 +3682,9 @@ static uint64_t capture_cap(void) {
|
||||
}
|
||||
|
||||
void vk_mem_note_live(void) { __atomic_store_n(&mirror_live, 1, __ATOMIC_RELAXED); }
|
||||
int vk_mem_live_swap(int v) { return __atomic_exchange_n(&mirror_live, v, __ATOMIC_RELAXED); }
|
||||
static int wb_lazy(void);
|
||||
int vk_mem_wb_lazy(void) { return wb_lazy(); } // the lazy write-back runs (vk_exec_draw.c op_update_ub)
|
||||
|
||||
int vk_mem_take_live(void) {
|
||||
int live = __atomic_exchange_n(&mirror_live, 0, __ATOMIC_RELAXED);
|
||||
|
||||
Reference in New Issue
Block a user