mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 10:09:59 -04:00
Count what the shadow copy-ins overwrite and cost, and keep stores through the device address table behind a switch.
NX2NAVI_SHADOW_CHECK=1 logs with the shadow line, every 60 frames: the whole copy-ins that overwrote a store a shader made through the device address table, and the pools they fell on; the write-backs that moved bytes into a page the CPU had written since its copy-in; the bytes both sides changed since their base copy; what the copy-ins cost by kind, and which pools and flag sets took them. The stores are found by content: a whole copy-in leaves a hash of the page, and the next one compares the shadow page with it first. NX2NAVI_SHADOW_TABLE_STORES=1 keeps such stores: a page found stored into gets a base copy, so copy-ins take only the CPU's bytes, and the fence of every submission that uses the table writes the stores back to guest memory. --probe-vkmem checks it with a GPU write that nothing notes. It is off by default. The overwrite it removes was the suspected cause of the flicker on Linux and is not: standing outdoors (RTX 5090 with NX2NAVI_SHADOW=1) it happens exactly four times a frame, on ten pages in pools of 20 and 44 KiB, with the copy that precedes the frame's stores, and no frame came out wrong with it or without it in 1,800 frames each; the hashes cost 1.8 ms a frame of the replay (67 against 75 fps); and a count the CPU resets before the write-back has landed would keep counting, where the whole copy-in resets it every time. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -37,8 +37,11 @@
|
||||
// NX2NAVI_GPA_EMPTY=1 keeps it empty, so every access through it reads the zero buffer (diagnosis).
|
||||
// Mirrored pools are not synced for the table's readers (vk_exec_draw.c ssbo_info says why). With shadow storage the
|
||||
// pools are copies of guest memory: a part whose shaders use the table is marked (vk_exec_draw.c bind_resources) and
|
||||
// its prologue copies the pages the CPU wrote into the copies the table names (vk_memory.c vk_mem_gpa_sync). What a
|
||||
// shader stores through the table into a shadow copy is not noted as a GPU write and does not come back to guest memory.
|
||||
// its prologue copies the pages the CPU wrote into the copies the table names (vk_memory.c vk_mem_gpa_sync). There
|
||||
// the twin of a mirrored pool is its shadow copy, not guest memory, and what a shader stores through the table is not
|
||||
// noted as a GPU write: it does not come back to guest memory, and the next whole copy-in of its page overwrites it.
|
||||
// vk_memory.c "Pages a shader stores into through the device address table" has the sequence, what was measured, and
|
||||
// the switch that keeps the stores (NX2NAVI_SHADOW_TABLE_STORES).
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user