From 5354aecdc5da7fb2bdadecf00eba1a1d9afe25b1 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Fri, 13 Nov 2026 12:44:51 -0500 Subject: [PATCH] Name the term that set the released textures' size bound in its log line. The line said "a quarter of the video memory budget" whenever the card's rule raised the bound, also when the smaller term was an eighth of the installed memory: on the RTX 5090 with 32 GB of the 2026-11-13 session the bound of 4,008 MiB came from the memory, not from the card's 7,854. The line now names the term that won, and the default's own. Co-Authored-By: Claude Opus 5.5 --- runtime/vk_texture.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/runtime/vk_texture.c b/runtime/vk_texture.c index f5e846d2..efc2b932 100644 --- a/runtime/vk_texture.c +++ b/runtime/vk_texture.c @@ -2540,13 +2540,14 @@ static uint64_t released_cap_bytes(void) { if (!released_cap) { const char *s = cfg_get("NX2NAVI_TEX_RELEASED_MB"); long long mb; - int by_vram = 0; + const char *by = ""; // which term set the bound, for the line below if (s && *s) mb = atoll(s); else { float used, total, proc; plat_mem_info(&used, &total, &proc); mb = total > 0 ? (long long)(total / 32) : 1024; mb = mb < 512 ? 512 : mb > 2048 ? 2048 : mb; + by = ", a thirty-second of the installed memory (512 MiB to 2 GiB)"; // By the card too: a quarter of its budget where the PC has an eighth of its memory to match, up to // RELEASED_CAP_MAX_MB. The game lets go of the textures of what leaves the view and takes them back when // it returns; walking through a village the released ones passed 1 GiB within two or three minutes, and @@ -2559,13 +2560,15 @@ static uint64_t released_cap_bytes(void) { if (vk_mem_vram(&vused, &vbudget, &exact) && total > 0) { long long by_card = (long long)(vbudget >> 22), by_ram = (long long)(total / 8); // a quarter, in MiB long long more = by_card < by_ram ? by_card : by_ram; - if (more > RELEASED_CAP_MAX_MB) more = RELEASED_CAP_MAX_MB; - if (more > mb) mb = more, by_vram = 1; + const char *more_by = by_card <= by_ram ? ", a quarter of the video memory budget" + : ", an eighth of the installed memory"; + if (more > RELEASED_CAP_MAX_MB) more = RELEASED_CAP_MAX_MB, more_by = ", the largest the rule by the card gives"; + if (more > mb) mb = more, by = more_by; } } released_cap = mb > 0 ? (uint64_t)mb << 20 : UINT64_MAX; if (mb > 0) rt_log("vk: released textures keep at most %lld MiB of their own memory%s (NX2NAVI_TEX_RELEASED_MB)", mb, - by_vram ? ", a quarter of the video memory budget" : ""); + by); else rt_log("vk: released textures: no size limit"); } return released_cap;