mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 22:19:57 -04:00
Defaults from the RX 580 runs: asynchronous replay, mesh emulation, mirror_hot 25, freeze_idle 1200, native zstd, game code at -O2; freeze and zstd and replay rows in the Lama patches tab.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,7 @@ static const char *const known[] = {
|
||||
// The nx2navi.ini section a key cfg_set may write goes to when the file lacks it (nx2navi.ini.example's sections).
|
||||
static const struct { const char *key, *section; } sections[] = {
|
||||
// the menu's Lama patches tab (ui/menu.cpp tab_lama)
|
||||
{"ZSTD_NATIVE", "performance"},
|
||||
{"MESH_EMU_MB", "performance"}, {"MESH_EMU_TASKS", "performance"}, {"MESH_EMU_BATCH", "performance"}, {"VEC_INDEX_FIX", "performance"},
|
||||
{"GUEST_OPT", "performance"}, {"PASS_TIMES", "diagnostics"}, {"DUMP_KEY", "diagnostics"},
|
||||
{"FPS_LIMIT", "frame rate"}, {"FPS60", "frame rate"}, {"RTSS", "frame rate"},
|
||||
@@ -254,7 +255,7 @@ static const CfgMeta metas[] = {
|
||||
// offer's number, which this setting or the menu accepts), always (every room, the save still copied first), or a number.
|
||||
{"COOP_ACCEPT", "ask", NULL, LIVE},
|
||||
// Advanced: scheduling
|
||||
{"ASYNC_PREEMPT", "1", "0|1|2", RESTART}, {"REPLAY_ASYNC", "0", "0|1", RESTART},
|
||||
{"ASYNC_PREEMPT", "1", "0|1|2", RESTART}, {"REPLAY_ASYNC", "1", "0|1", RESTART},
|
||||
{"REPLAY_WORKERS", "3", "0..16", RESTART}, {"REPLAY_PIPE", "0", "0..4", RESTART},
|
||||
{"FREE_CORES", "0", "0|1", RESTART}, {"TIMER_1MS", "1", "0|1", RESTART},
|
||||
// dynamic resolution (dynres.c): the scene follows the GPU time toward DYN_RES_TARGET milliseconds
|
||||
@@ -303,7 +304,9 @@ static const CfgMeta metas[] = {
|
||||
{"MIRROR_HOT", "25", "0..1000", RESTART}, {"FREEZE_IDLE", "1800", "0..100000", RESTART},
|
||||
{"VRAM_HEAP_LIMIT", "auto", NULL, RESTART}, // vk_device.c vram_heap_limits: auto, 0 or MiB
|
||||
{"UPLOAD_BATCH_MB", "256", NULL, RESTART}, // vk_memory.c: MiB of staging before a batch goes early, 0 no limit
|
||||
{"MESH_EMULATION", "1", "0|1", RESTART}, {"MESH_EMU_MB", "256", "32..2048", RESTART},
|
||||
{"MESH_EMU_TASKS", "16384", "256..262144", RESTART}, {"MESH_EMU_BATCH", "1", "0|1", RESTART}, {"VEC_INDEX_FIX", "0", "0|auto|1", RESTART},
|
||||
{"GUEST_OPT", "2", "1|2", RESTART}, // tools/make_game.py: the next Rebuild the Game
|
||||
{"PASS_TIMES", "0", "0|1", RESTART}, {"DUMP_KEY", "", NULL, RESTART}, // vk_crumbs.c, vk_dump.c
|
||||
// textures and memory
|
||||
{"ASTC", "auto", "auto|gpu|native|cpu", RESTART}, {"MEMORY", "auto", "auto|import|mirror|verify", RESTART},
|
||||
|
||||
@@ -1633,6 +1633,7 @@ static void tab_lama(float scale) {
|
||||
static const char *const values[] = {"", "512", "1024", "2048", "4096", "8192"};
|
||||
const char *names[] = {menu_text(UI_MENU_AUTO), "512", "1024", "2048", "4096", "8192"};
|
||||
opt_choice_list("NX2NAVI_TEX_RELEASED_MAX", UI_MENU_LAMA_RELEASED, values, names, 6, UI_MENU_LAMA_RELEASED_DESC);
|
||||
}
|
||||
opt_slider("NX2NAVI_MIRROR_HOT", UI_MENU_LAMA_MIRROR_HOT, 0, 100, UI_MENU_LAMA_MIRROR_HOT_DESC, 5, "%.0f %%");
|
||||
{ // vk_device.c vram_heap_limits
|
||||
static const char *const values[] = {"auto", "0"};
|
||||
@@ -1643,7 +1644,13 @@ static void tab_lama(float scale) {
|
||||
const char *names[] = {"128 MB", "256 MB", "512 MB", "1024 MB", menu_text(UI_MENU_LAMA_NO_LIMIT)};
|
||||
opt_choice_list("NX2NAVI_UPLOAD_BATCH_MB", UI_MENU_LAMA_UPLOAD_BATCH, values, names, 5, UI_MENU_LAMA_UPLOAD_BATCH_DESC);
|
||||
opt_toggle("NX2NAVI_ASTC_SCRATCH_KEEP", UI_MENU_LAMA_ASTC_KEEP, UI_MENU_LAMA_ASTC_KEEP_DESC);
|
||||
{ // vk_memory.c freeze_pass: submissions a region stays unwritten before it is frozen
|
||||
static const char *const values[] = {"1800", "1200", "600", "60", "0"};
|
||||
const char *names[] = {"1800", "1200", "600", "60", menu_text(UI_MENU_OFF)};
|
||||
opt_choice_list("NX2NAVI_FREEZE_IDLE", UI_MENU_LAMA_FREEZE, values, names, 5, UI_MENU_LAMA_FREEZE_DESC);
|
||||
opt_toggle("NX2NAVI_ZSTD_NATIVE", UI_MENU_LAMA_ZSTD, UI_MENU_LAMA_ZSTD_DESC); // ov_zstd.c trusted
|
||||
opt_group(UI_MENU_LAMA_RENDER);
|
||||
opt_toggle("NX2NAVI_REPLAY_ASYNC", UI_MENU_LAMA_ASYNC, UI_MENU_LAMA_ASYNC_DESC); // vk_backend.c
|
||||
const bool native = vk_mesh_shader_native() != 0; // vk_exec_draw.c: the emulation only where the GPU lacks them
|
||||
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE);
|
||||
opt_toggle("NX2NAVI_MESH_EMULATION", UI_MENU_LAMA_MESH_EMU, UI_MENU_LAMA_MESH_EMU_DESC);
|
||||
|
||||
@@ -139,6 +139,17 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
||||
"of -O1: the game's own threads run faster on a slower CPU. The build takes "
|
||||
"several times longer.",
|
||||
[UI_MENU_LAMA_GUEST_OPT_NOTE] = "at the next rebuild",
|
||||
[UI_MENU_LAMA_FREEZE] = "Freeze idle memory after",
|
||||
[UI_MENU_LAMA_FREEZE_DESC] = "Submissions a memory region stays unwritten before it is made read-only, so the write "
|
||||
"tracking can skip it. 1800 (about 15 s): few thaws and small tracking queries. 60: "
|
||||
"the game thaws regions all the time and every thaw stalls a frame. Off: no stalls, but "
|
||||
"the tracking scans all memory every frame.",
|
||||
[UI_MENU_LAMA_ZSTD] = "Native data decompression",
|
||||
[UI_MENU_LAMA_ZSTD_DESC] = "Decompresses the game's zstd data with the PC's libzstd instead of the game's own "
|
||||
"decoder translated from the console. Lighter streaming while you move.",
|
||||
[UI_MENU_LAMA_ASYNC] = "Asynchronous replay",
|
||||
[UI_MENU_LAMA_ASYNC_DESC] = "Translates the game's GPU commands on a thread of their own instead of the game's, so "
|
||||
"the game prepares the next frame meanwhile.",
|
||||
[UI_MENU_LAMA_PASS_TIMES] = "Pass times in the log",
|
||||
[UI_MENU_LAMA_PASS_TIMES_DESC] = "GPU time of every render pass and dispatch goes to the log, with the largest "
|
||||
"viewport each kind of pass draws with. Costs a little frame time.",
|
||||
|
||||
@@ -335,6 +335,8 @@ typedef enum {
|
||||
// the Lama patches tab (ui/menu.cpp tab_lama): the settings of the RX 580 patches, English only
|
||||
UI_MENU_TAB_LAMA, UI_MENU_LAMA_INTRO, UI_MENU_LAMA_MEMORY, UI_MENU_LAMA_RENDER, UI_MENU_LAMA_BUILD,
|
||||
UI_MENU_LAMA_DIAG,
|
||||
UI_MENU_LAMA_FREEZE, UI_MENU_LAMA_FREEZE_DESC, UI_MENU_LAMA_ZSTD, UI_MENU_LAMA_ZSTD_DESC,
|
||||
UI_MENU_LAMA_ASYNC, UI_MENU_LAMA_ASYNC_DESC,
|
||||
UI_MENU_LAMA_RELEASED, UI_MENU_LAMA_RELEASED_DESC,
|
||||
UI_MENU_LAMA_CLOBBER, UI_MENU_LAMA_CLOBBER_DESC,
|
||||
UI_MENU_LAMA_MIRROR_HOT, UI_MENU_LAMA_MIRROR_HOT_DESC,
|
||||
|
||||
@@ -5593,6 +5593,7 @@ static int mesh_emu_draw_prim(VkExec *ex) {
|
||||
static int mesh_emu_on(void) {
|
||||
static int on = -1;
|
||||
if (on < 0) {
|
||||
on = !vk_ctx()->has_mesh_shader && rt_knob("MESH_EMULATION", "1");
|
||||
if (on) rt_log("vk: mesh shaders emulated with compute (NX2NAVI_MESH_EMULATION)");
|
||||
}
|
||||
return on;
|
||||
|
||||
@@ -3471,6 +3471,8 @@ static uint64_t hot_frame0, n_demoted;
|
||||
|
||||
static void hot_check(void) {
|
||||
if (mirror_hot < 0) {
|
||||
const char *v = cfg_value("NX2NAVI_MIRROR_HOT"); // the settings row's default (25) when unset
|
||||
int p = v && *v ? atoi(v) : 25;
|
||||
mirror_hot = p < 0 ? 0 : p > 1000 ? 1000 : p;
|
||||
if (mirror_hot) rt_log("mem: pools copied %d%% of their size a frame stay in system memory (NX2NAVI_MIRROR_HOT)", mirror_hot);
|
||||
}
|
||||
|
||||
@@ -2839,6 +2839,7 @@ static Layout *layout_get(Bindings *B) {
|
||||
// set 0 gets a template per bind point. Caller holds P.lock.
|
||||
static int mesh_emu_on(void) {
|
||||
static int on = -1;
|
||||
if (on < 0) on = rt_knob("MESH_EMULATION", "1");
|
||||
return on;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user