mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 21:39:58 -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:
@@ -531,7 +531,7 @@ static CmdSlot *take_slot(VkCtx *c, uint64_t fence) {
|
||||
// First brings the shadow storage up to date with the CPU's writes, which needs no command buffer.
|
||||
static VkCommandBuffer prologue(VkCtx *c, uint64_t fence) {
|
||||
vk_mem_shadow_sync(); // shadow storage: the CPU's writes go in before the part is submitted
|
||||
vk_mem_gpa_sync(); // a part whose shaders read through the device address table never resolved the pools they reach
|
||||
vk_mem_gpa_sync(fence); // a part whose shaders read through the device address table never resolved the pools they reach
|
||||
vk_mem_lazy_part_end(); // what the part left in the mirror and has to write back after all joins the snapshots
|
||||
if (!vk_mem_mirror_pending()) return VK_NULL_HANDLE;
|
||||
int i = claim_slot(c, fence); // before reading slots: the claim may move it
|
||||
|
||||
Reference in New Issue
Block a user