Grow the render-target heap for the scene's share only where the start's mode needs it, and never past the pool.

The heap grew by the full-picture factor whenever the upscaler setting was on, in every mode, and without a limit:
915 MiB at 3840x2160 where the modes below three quarters need 382, and at 10240x2880 an application pool of 13.5 GiB,
past the 12 GiB heap region, where the game's SetHeapSize is refused and nothing starts.

The share is now the start's own mode: all of the picture for dlaa, the game's own most for the modes below it. The
growth stops at what the pool can take (2,478 MiB): the scene's share is lowered to what fits, with a log line, and a
picture too large even for the game's own scene gets the most there is and a warning. A mode chosen in the menu that
renders more than the start's keeps the start's share until a restart, as the log and nx2navi.ini.example now say.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 22:08:44 -05:00
parent cd0b1a387d
commit 7ff1a21ef2
4 changed files with 73 additions and 20 deletions

View File

@@ -1306,6 +1306,12 @@ static int inside(uint64_t a, uint64_t n, RtRange r) { return a >= r.base && n <
static uint32_t map_gen;
uint32_t mem_map_gen(void) { return __atomic_load_n(&map_gen, __ATOMIC_ACQUIRE); }
// The application pool is the title's own plus res_heap_extra_bytes (mem_init), and the game asks for a heap of
// nearly all of it: past HEAP_CAP the request below is refused, so this is the most that may be added.
uint64_t mem_heap_extra_max_kib(void) {
return HEAP_CAP > DEFAULT_POOL ? ((HEAP_CAP - DEFAULT_POOL) & ~0x1fffffull) >> 10 : 0;
}
// ---- 0x01 SetHeapSize
uint32_t mem_set_heap_size(uint64_t size, uint64_t *addr) {
uint64_t t0 = perf_mark_begin(); // NX2NAVI_TRACE=perf: the commit or decommit, the wait for the lock included