Runtime: power opt-out, faster fence wake-ups, feedback barrier, texture re-upload skip

- Opt the process out of Windows power throttling (execution speed and
  timer resolution) at startup; NX2NAVI_POWER_FULL=0 turns it off.
- Fence completion thread wakes waiters before collecting freed memory,
  so collection no longer delays them.
- Add a by-region barrier when a draw or clear writes an attachment that
  an earlier draw in the same pass sampled; count it and inline uniform
  updates in the per-frame stats.
- Hash small texture contents at upload and skip re-uploads whose bytes
  are unchanged (removes ~420 redundant uploads per frame in Kokiri
  Forest); NX2NAVI_TEX_SAME=0 turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-08 06:03:32 -05:00
parent 7410e0d2d7
commit 42ae87bca6
10 changed files with 136 additions and 18 deletions

View File

@@ -528,6 +528,15 @@ int main(int argc, char **argv) {
// Timed guest waits (kernel.c block_inner) sleep in whole milliseconds; at the default 15.6 ms tick a 1 ms wait
// costs a full tick. NX2NAVI_TIMER_1MS=0 keeps the default for comparison.
if (cfg_bool("NX2NAVI_TIMER_1MS")) plat_timer_1ms();
{ // NX2NAVI_POWER_FULL=0 leaves Windows' power throttling of an unfocused window in place (A/B runs)
const char *pf = cfg_get("NX2NAVI_POWER_FULL");
if (!(pf && !strcmp(pf, "0"))) {
int got = plat_power_full();
rt_log("power: %s", got == 2 ? "full speed and the 1 ms timer kept when the window is not in front"
: got == 1 ? "full speed kept when the window is not in front (no timer control here)"
: "the OS throttling of an unfocused window stays as it is");
}
}
cfg = (RtConfig){.exefs = rt_default_exefs, .romfs = rt_default_romfs, .profile = rt_default_profile,
.gpu = cfg_get("NX2NAVI_GPU")};
portable_paths(&cfg); // command-line paths below still win