Show the low-end GPU mode's settings under its switch in the Game tab, and read them only while the mode is on.

The settings had a tab of their own; they are rows of the Game tab now, listed under the switch once the mode is on after a restart, and the tab is gone. With the mode off every one of them reads as unset, whatever nx2navi.ini or the environment says, so nothing of the mode acts unless a player turned it on; the build reads guest_opt the same way. The notes describe that, and take the white edges in towns and the dropped textures from the known issues to the fixes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 13:59:43 -05:00
parent 857d22fe4f
commit 26f3dc47ec
10 changed files with 174 additions and 140 deletions

View File

@@ -33,11 +33,10 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
- A texture the game reads after another image was drawn over its memory gets memory of its own, which removed - A texture the game reads after another image was drawn over its memory gets memory of its own, which removed
teal splotches from the fog of Kokiri Forest on that card. teal splotches from the fog of Kokiri Forest on that card.
Each of these also has a key of its own, listed with `low_end_gpu` in nx2navi.ini.example. While the mode is on, the Game tab lists its settings underneath the switch: the video memory limit and reserve,
- **A settings tab for those cards**, *Lama patches*, by Tobim6: how many released textures are kept, the video the upload batch size, mesh shader emulation and its memory, foliage detail (`foliage = full`, `reduced` or `off`)
memory reserve, the upload batch size, mesh shader emulation, foliage detail (`foliage = full`, `reduced` or and compiling the game's code at -O2 at the next *Rebuild the Game* (`guest_opt = 2`, a build several times
`off`) and compiling the game's code at -O2 at the next *Rebuild the Game* (`guest_opt = 2`, a build several times longer). With the mode off none of them is read, also when nx2navi.ini sets one.
longer).
- **Link's own motion for DLSS, FSR 3.1 and frame generation** (`selective_motion = 1` in nx2navi.ini, off by - **Link's own motion for DLSS, FSR 3.1 and frame generation** (`selective_motion = 1` in nx2navi.ini, off by
default): Link and the equipment attached to him are drawn a second time with last frame's pose, so the upscaler default): Link and the equipment attached to him are drawn a second time with last frame's pose, so the upscaler
gets their real motion in fast turns, attacks and jumps instead of an estimate. It has not been played by us yet. By gets their real motion in fast turns, attacks and jumps instead of an estimate. It has not been played by us yet. By
@@ -79,6 +78,15 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
the same memory in another format. That texture was dropped every 600 frames as overwritten although the game still the same memory in another format. That texture was dropped every 600 frames as overwritten although the game still
read it, and the frame that dropped it made it again from the scene's raw bits: in a player's recording one frame at read it, and the frame that dropped it made it again from the scene's raw bits: in a player's recording one frame at
a sixth of its brightness. A texture that is still read is kept now. a sixth of its brightness. A texture that is still read is kept now.
- **Kerb, stair and wall-top edges drawn white for one frame in towns.** In a town the game registers a round of 30
to 60 sharper textures every four or five frames, from another of its threads, while the frame before is still
being drawn. Each registration took effect at once and changed the texture slots under that frame, and some of its
surfaces were drawn untextured, twice four frames apart. A registration now takes effect between two submissions,
in the order the game made it.
- **Textures going plain for a moment after the game let go of them.** A texture the game has finalized stays on
screen until the game puts another in its place. Nothing looked such a texture up any more, so it counted as unused
and was dropped once the kept textures passed their size limit, although every frame still drew with it. One that
was drawn with lately is kept now.
- **The game hanging with the draw replay on several cores.** Two replay threads could wait for each other at the - **The game hanging with the draw replay on several cores.** Two replay threads could wait for each other at the
end of a render pass, each holding the lock the other needed. By leonardochappuis (pull request #697). end of a render pass, each holding the lock the other needed. By leonardochappuis (pull request #697).
- **Lines drawn one pixel wide whatever width the game set.** The width is passed on now where the card supports wide - **Lines drawn one pixel wide whatever width the game set.** The width is passed on now where the card supports wide
@@ -126,8 +134,6 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
Performance and 3.9 ms at Native AA on a Radeon RX 7900 XT (FSR 3.1: 0.5 ms). Measured standing in Hyrule Field at Performance and 3.9 ms at Native AA on a Radeon RX 7900 XT (FSR 3.1: 0.5 ms). Measured standing in Hyrule Field at
3416x1440: FSR 4 Native AA 52 fps, Quality 53, Ultra Performance 55; FSR 3.1 Native AA 55, Ultra Performance 66; 3416x1440: FSR 4 Native AA 52 fps, Quality 53, Ultra Performance 55; FSR 3.1 Native AA 55, Ultra Performance 66;
without an upscaler 70. without an upscaler 70.
- In towns, the edges of kerbs, stairs and wall tops can be drawn white for one frame when the game brings in a
batch of sharper textures. Its cause is not found yet.
- `low_end_gpu = 1` was run by its author on a Radeon RX 580, not by us. Please report how it behaves on your card. - `low_end_gpu = 1` was run by its author on a Radeon RX 580, not by us. Please report how it behaves on your card.
- FSR 4, its frame generation and the AMD-only fixes were not run by us on the cards they are for before this - FSR 4, its frame generation and the AMD-only fixes were not run by us on the cards they are for before this
release. release.

View File

@@ -296,7 +296,8 @@
# the game waits less for the GPU (mirror_stage = 1, submit_finish_gpu = 0), frames are prepared on a thread of their # the game waits less for the GPU (mirror_stage = 1, submit_finish_gpu = 0), frames are prepared on a thread of their
# own (replay_async = 1, which can show a dark or flickering frame now and then), pools the game refills every frame # own (replay_async = 1, which can show a dark or flickering frame now and then), pools the game refills every frame
# stay in system memory (mirror_hot = 25), and a texture read after another image was drawn over its memory gets # stay in system memory (mirror_hot = 25), and a texture read after another image was drawn over its memory gets
# memory of its own (tex_clobber = 1). 0, the default: each of these stays as it was in 0.9.1. Read at start. # memory of its own (tex_clobber = 1). 0, the default: each of these stays as it was in 0.9.1, and none of these keys
# is read. Read at start.
# low_end_gpu = 0 # low_end_gpu = 0
# Textures the game released that are kept as they are (1 to 16384); past this count only those that lose nothing # Textures the game released that are kept as they are (1 to 16384); past this count only those that lose nothing
# when dropped go. Default: one per 2 MB of the video memory budget, 2048 to 8192. Read at start. # when dropped go. Default: one per 2 MB of the video memory budget, 2048 to 8192. Read at start.

View File

@@ -91,7 +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). // 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[] = { static const struct { const char *key, *section; } sections[] = {
// the menu's Lama patches tab (ui/menu.cpp tab_lama) // the low-end GPU mode's rows in the menu's Game tab (ui/menu.cpp rows_low_end)
{"TEX_RELEASED_MAX", "performance"}, {"MIRROR_HOT", "performance"}, {"FREEZE_IDLE", "performance"}, {"SUBMIT_FINISH_KINDS", "performance"}, {"FOLIAGE", "performance"}, {"TEX_RELEASED_MAX", "performance"}, {"MIRROR_HOT", "performance"}, {"FREEZE_IDLE", "performance"}, {"SUBMIT_FINISH_KINDS", "performance"}, {"FOLIAGE", "performance"},
{"ZSTD_NATIVE", "performance"}, {"ZSTD_NATIVE", "performance"},
{"VRAM_HEAP_LIMIT", "performance"}, {"VRAM_RESERVE_MB", "performance"}, {"UPLOAD_BATCH_MB", "performance"}, {"MESH_EMULATION", "performance"}, {"VRAM_HEAP_LIMIT", "performance"}, {"VRAM_RESERVE_MB", "performance"}, {"UPLOAD_BATCH_MB", "performance"}, {"MESH_EMULATION", "performance"},
@@ -311,7 +311,7 @@ static const CfgMeta metas[] = {
// all|<count>: the compute pipelines the boot keeps, those dispatched most recently (vk_pipeline.c, compute-used.bin) // all|<count>: the compute pipelines the boot keeps, those dispatched most recently (vk_pipeline.c, compute-used.bin)
{"COMPUTE_KEEP", "512", NULL, RESTART}, {"COMPUTE_KEEP", "512", NULL, RESTART},
{"SHADER_CARRY", "1", "0|1", RESTART}, // gfx_shader.c "Carry": a previous translator's translations until translated again {"SHADER_CARRY", "1", "0|1", RESTART}, // gfx_shader.c "Carry": a previous translator's translations until translated again
// the menu's Lama patches tab (ui/menu.cpp tab_lama): the settings of the RX 580 patches // the low-end GPU mode's rows in the menu's Game tab (ui/menu.cpp rows_low_end)
{"TEX_RELEASED_MAX", "", NULL, RESTART}, // vk_texture.c released_max: "" by the video memory budget, else 1..16384 {"TEX_RELEASED_MAX", "", NULL, RESTART}, // vk_texture.c released_max: "" by the video memory budget, else 1..16384
{"MIRROR_HOT", "0", "0..1000", RESTART}, {"FREEZE_IDLE", "1800", "0..100000", RESTART}, {"MIRROR_HOT", "0", "0..1000", RESTART}, {"FREEZE_IDLE", "1800", "0..100000", RESTART},
{"SUBMIT_FINISH_KINDS", "31", "0..31", RESTART}, // vk_sync.c res_mask {"SUBMIT_FINISH_KINDS", "31", "0..31", RESTART}, // vk_sync.c res_mask
@@ -567,13 +567,27 @@ static const char *raw_get(const char *name);
// texture checks share their write-watch queries (vk_memory.c snap_widen_n), video memory stays within the heaps' // texture checks share their write-watch queries (vk_memory.c snap_widen_n), video memory stays within the heaps'
// budgets (vk_device.c vram_heap_limits, vk_vma_budget.c), large upload batches go to the queue early (vk_memory.c // budgets (vk_device.c vram_heap_limits, vk_vma_budget.c), large upload batches go to the queue early (vk_memory.c
// vk_upload_end), frames are prepared on a thread of their own and pools the game refills every frame stay in system // vk_upload_end), frames are prepared on a thread of their own and pools the game refills every frame stay in system
// memory (vk_backend.c, vk_memory.c hot_check). Without the key each of these keeps what 0.9.1 did, and a player can // memory (vk_backend.c, vk_memory.c hot_check). Without the key each of these keeps what 0.9.1 did.
// still set any of them alone.
static const struct { const char *key, *value; } LOWEND[] = { static const struct { const char *key, *value; } LOWEND[] = {
{"MESH_EMULATION", "1"}, {"TEX_CLOBBER", "1"}, {"MIRROR_STAGE", "1"}, {"SUBMIT_FINISH_GPU", "0"}, {"SNAP_WIDEN", "8"}, {"MESH_EMULATION", "1"}, {"TEX_CLOBBER", "1"}, {"MIRROR_STAGE", "1"}, {"SUBMIT_FINISH_GPU", "0"}, {"SNAP_WIDEN", "8"},
{"VRAM_HEAP_LIMIT", "auto"}, {"VRAM_RESERVE_MB", "512"}, {"UPLOAD_BATCH_MB", "256"}, {"REPLAY_ASYNC", "1"}, {"VRAM_HEAP_LIMIT", "auto"}, {"VRAM_RESERVE_MB", "512"}, {"UPLOAD_BATCH_MB", "256"}, {"REPLAY_ASYNC", "1"},
{"MIRROR_HOT", "25"}, {"MIRROR_HOT", "25"},
}; };
// The keys that count only while the mode is on (LOWEND_ONLY): without it each reads as unset, whatever the settings
// file or the environment says, so nothing of the mode acts unless a player turned it on. The menu shows their rows
// only then (ui/menu.cpp rows_low_end). Keys the game had before the mode (replay_async, freeze_idle, zstd_native,
// tex_released_max, astc_scratch_keep) are not among them.
static const char *const LOWEND_ONLY[] = {
"MESH_EMULATION", "MESH_EMU_MB", "MESH_EMU_TASKS", "MESH_EMU_BATCH", "TEX_CLOBBER", "MIRROR_STAGE", "MIRROR_HOT",
"SUBMIT_FINISH_GPU", "SUBMIT_FINISH_RESULTS", "SUBMIT_FINISH_KINDS", "SNAP_WIDEN", "VRAM_HEAP_LIMIT",
"VRAM_RESERVE_MB", "UPLOAD_BATCH_MB", "FOLIAGE", "FLUSH_SKIP_CLEAN", "VEC_INDEX_FIX", "GUEST_OPT", "PASS_TIMES",
"DUMP_KEY", "LOG_TEX_NEW", "SVC_WAITS",
};
static int lowend_only(const char *key) {
for (size_t i = 0; i < sizeof LOWEND_ONLY / sizeof *LOWEND_ONLY; i++)
if (!strcasecmp(LOWEND_ONLY[i], key)) return 1;
return 0;
}
static int lowend = -1; static int lowend = -1;
static int lowend_of(void) { static int lowend_of(void) {
int p = __atomic_load_n(&lowend, __ATOMIC_ACQUIRE); int p = __atomic_load_n(&lowend, __ATOMIC_ACQUIRE);
@@ -583,6 +597,7 @@ static int lowend_of(void) {
__atomic_store_n(&lowend, p, __ATOMIC_RELEASE); __atomic_store_n(&lowend, p, __ATOMIC_RELEASE);
return p; return p;
} }
int cfg_low_end_active(void) { return lowend_of(); }
static const char *lowend_value(const char *key) { static const char *lowend_value(const char *key) {
if (lowend_of()) if (lowend_of())
for (size_t i = 0; i < sizeof LOWEND / sizeof *LOWEND; i++) for (size_t i = 0; i < sizeof LOWEND / sizeof *LOWEND; i++)
@@ -614,7 +629,9 @@ static const char *raw_get(const char *name) {
static const char *cfg_get_now(const char *name) { static const char *cfg_get_now(const char *name) {
const char *v = raw_get(name); const char *v = raw_get(name);
if (v || strncmp(name, PREFIX, PREFIX_LEN)) return v; if (strncmp(name, PREFIX, PREFIX_LEN)) return v;
if (!lowend_of() && lowend_only(name + PREFIX_LEN)) return NULL; // the mode is off: its settings are not read
if (v) return v;
if (profile_of()) if (profile_of())
for (size_t i = 0; i < sizeof DECK / sizeof *DECK; i++) for (size_t i = 0; i < sizeof DECK / sizeof *DECK; i++)
if (!strcasecmp(DECK[i].key, name + PREFIX_LEN)) return DECK[i].value; if (!strcasecmp(DECK[i].key, name + PREFIX_LEN)) return DECK[i].value;

View File

@@ -33,6 +33,7 @@ int cfg_ini_now(const char *key, char *out, size_t cap);
int cfg_ini_read(const char *path, const char *key, char *out, size_t cap); // the same, of the file at path int cfg_ini_read(const char *path, const char *key, char *out, size_t cap); // the same, of the file at path
// 1 when the player set name (the environment or nx2navi.ini), 0 when cfg_get gives a device profile's default or NULL. // 1 when the player set name (the environment or nx2navi.ini), 0 when cfg_get gives a device profile's default or NULL.
int cfg_is_set(const char *name); int cfg_is_set(const char *name);
int cfg_low_end_active(void); // the low-end GPU mode was on when the game started (cfg.c LOWEND)
// The keys of the file's lines that are no settings of this version, lower-case with ", " between them ("" when there // The keys of the file's lines that are no settings of this version, lower-case with ", " between them ("" when there
// are none; a list too long to keep ends early), and how many there are. Such a line does nothing: the log says so at // are none; a list too long to keep ends early), and how many there are. Such a line does nothing: the log says so at
// start and the settings menu shows it (ui/menu.cpp), so that nobody takes one for the cause of what they see. // start and the settings menu shows it (ui/menu.cpp), so that nobody takes one for the cause of what they see.

View File

@@ -505,7 +505,7 @@ static int fonts_up(float scale) {
// what the title face shows in the CJK languages: the menu's title and tabs (Simplified Chinese menu text) and // what the title face shows in the CJK languages: the menu's title and tabs (Simplified Chinese menu text) and
// the boot screen's title (the game's language) // the boot screen's title (the game's language)
static const UiTextId titles[] = {UI_MENU_TITLE, UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND, static const UiTextId titles[] = {UI_MENU_TITLE, UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND,
UI_MENU_TAB_CONTROLS, UI_MENU_TAB_LAMA, UI_MENU_TAB_COOP, UI_BOOT_TITLE}; UI_MENU_TAB_CONTROLS, UI_MENU_TAB_COOP, UI_BOOT_TITLE};
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
if (!data[i]) continue; if (!data[i]) continue;
ImFontGlyphRangesBuilder b; ImFontGlyphRangesBuilder b;
@@ -573,8 +573,8 @@ extern "C" void menu_vk_release(void) {
// NX2NAVI_ prefix optional) puts the cursor on that setting's row and scrolls it into view when the row is next drawn // NX2NAVI_ prefix optional) puts the cursor on that setting's row and scrolls it into view when the row is next drawn
// (opt_focus_key), so a page's shot shows a row below the first screenful; it does not switch tabs. COOP_PAGE, COOP_JOIN // (opt_focus_key), so a page's shot shows a row below the first screenful; it does not switch tabs. COOP_PAGE, COOP_JOIN
// and COOP_ACCEPT_OFFER drive the Co-op tab (ui/coop_page.h coop_test_set). // and COOP_ACCEPT_OFFER drive the Co-op tab (ui/coop_page.h coop_test_set).
// Ocarina of Time: the options this port has, co-op (ui/coop_page.cpp) and the Lama patches tab (the RX 580 patches) // Ocarina of Time: the options this port has, and co-op (ui/coop_page.cpp)
enum { TAB_SCREEN, TAB_GAME, TAB_SOUND, TAB_CONTROLS, TAB_LAMA, TAB_COOP, TAB_COUNT }; // co-op last: tabs_shown enum { TAB_SCREEN, TAB_GAME, TAB_SOUND, TAB_CONTROLS, TAB_COOP, TAB_COUNT }; // co-op last: tabs_shown
enum { TEST_PAGE_FRAMES = 30, TEST_SETS = 16, TEST_OPENS = 8 }; enum { TEST_PAGE_FRAMES = 30, TEST_SETS = 16, TEST_OPENS = 8 };
struct TestSet { uint64_t frame; char key[64], value[64]; }; struct TestSet { uint64_t frame; char key[64], value[64]; };
static struct { static struct {
@@ -1398,14 +1398,14 @@ static void rows_saves(void) {
if (line[0]) opt_text_str(line, warn); if (line[0]) opt_text_str(line, warn);
} }
static void rows_low_end(void);
static void tab_game(float scale) { static void tab_game(float scale) {
opt_begin("##game", scale); opt_begin("##game", scale);
row_fps_limit(); // frame_rate.c: Ocarina steps by the clock, so the pacer alone sets its rate row_fps_limit(); // frame_rate.c: Ocarina steps by the clock, so the pacer alone sets its rate
row_game_lang(); row_game_lang();
static const UiTextId mode[] = {UI_MENU_MODE_DOCKED, UI_MENU_MODE_HANDHELD}; static const UiTextId mode[] = {UI_MENU_MODE_DOCKED, UI_MENU_MODE_HANDHELD};
opt_choice("NX2NAVI_OPERATION_MODE", UI_MENU_OPERATION_MODE, mode, 2, UI_MENU_OPERATION_MODE_DESC); opt_choice("NX2NAVI_OPERATION_MODE", UI_MENU_OPERATION_MODE, mode, 2, UI_MENU_OPERATION_MODE_DESC);
// cfg.c LOWEND: the defaults for older graphics cards, read at start
opt_toggle("NX2NAVI_LOW_END_GPU", UI_MENU_LOW_END_GPU, UI_MENU_LOW_END_GPU_DESC);
opt_toggle("NX2NAVI_ASSUME_FOCUS", UI_MENU_ASSUME_FOCUS, UI_MENU_ASSUME_FOCUS_DESC); opt_toggle("NX2NAVI_ASSUME_FOCUS", UI_MENU_ASSUME_FOCUS, UI_MENU_ASSUME_FOCUS_DESC);
// discord_rpc.c reads the setting on its own thread and connects or clears the status within half a second // discord_rpc.c reads the setting on its own thread and connects or clears the status within half a second
opt_toggle("NX2NAVI_DISCORD_RPC", UI_MENU_DISCORD_RPC, UI_MENU_DISCORD_RPC_DESC); opt_toggle("NX2NAVI_DISCORD_RPC", UI_MENU_DISCORD_RPC, UI_MENU_DISCORD_RPC_DESC);
@@ -1421,6 +1421,12 @@ static void tab_game(float scale) {
"of area: keep a copy of the save first.", on)) "of area: keep a copy of the save first.", on))
opt_apply("NX2NAVI_DEBUG_MENU", on ? "0" : "1"); opt_apply("NX2NAVI_DEBUG_MENU", on ? "0" : "1");
} }
// Last, as its own settings follow it while it is on (rows_low_end). cfg.c LOWEND: the defaults for older graphics
// cards, read at start.
opt_toggle("NX2NAVI_LOW_END_GPU", UI_MENU_LOW_END_GPU, UI_MENU_LOW_END_GPU_DESC);
// the mode's settings are read only while it is on (cfg.c LOWEND_ONLY), so their rows wait for the restart too
if (cfg_low_end_active()) rows_low_end();
else if (cfg_bool("NX2NAVI_LOW_END_GPU")) opt_text(UI_MENU_LOWEND_RESTART);
opt_end(); opt_end();
} }
@@ -1626,81 +1632,80 @@ static void tab_coop(float scale) {
coop_after_page(scale); coop_after_page(scale);
} }
// ---- the Lama patches tab: the settings the RX 580 patches add (apply_rx580_fix), each read where its patch reads it // ---- the settings of the low-end GPU mode, under its switch in the Game tab while that is on (tab_game): each is read
static void tab_lama(float scale) { // where the code it sets reads it
opt_begin("##lama", scale); static void rows_low_end(void) {
opt_text(UI_MENU_LAMA_INTRO); opt_text(UI_MENU_LOWEND_INTRO);
opt_group(UI_MENU_LAMA_MEMORY); opt_group(UI_MENU_LOWEND_MEMORY);
{ // vk_texture.c sweep_released { // vk_texture.c sweep_released
static const char *const values[] = {"", "512", "1024", "2048", "4096", "8192"}; static const char *const values[] = {"", "512", "1024", "2048", "4096", "8192"};
const char *names[] = {menu_text(UI_MENU_AUTO), "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_choice_list("NX2NAVI_TEX_RELEASED_MAX", UI_MENU_LOWEND_RELEASED, values, names, 6, UI_MENU_LOWEND_RELEASED_DESC);
} }
opt_slider("NX2NAVI_MIRROR_HOT", UI_MENU_LAMA_MIRROR_HOT, 0, 100, UI_MENU_LAMA_MIRROR_HOT_DESC, 5, "%.0f %%"); opt_slider("NX2NAVI_MIRROR_HOT", UI_MENU_LOWEND_MIRROR_HOT, 0, 100, UI_MENU_LOWEND_MIRROR_HOT_DESC, 5, "%.0f %%");
{ // vk_device.c vram_heap_limits { // vk_device.c vram_heap_limits
static const char *const values[] = {"auto", "0"}; static const char *const values[] = {"auto", "0"};
const char *names[] = {menu_text(UI_MENU_AUTO), menu_text(UI_MENU_OFF)}; const char *names[] = {menu_text(UI_MENU_AUTO), menu_text(UI_MENU_OFF)};
opt_choice_list("NX2NAVI_VRAM_HEAP_LIMIT", UI_MENU_LAMA_HEAP_LIMIT, values, names, 2, UI_MENU_LAMA_HEAP_LIMIT_DESC); opt_choice_list("NX2NAVI_VRAM_HEAP_LIMIT", UI_MENU_LOWEND_HEAP_LIMIT, values, names, 2, UI_MENU_LOWEND_HEAP_LIMIT_DESC);
} }
{ // vk_vma_budget.c reserve_bytes { // vk_vma_budget.c reserve_bytes
static const char *const values[] = {"512", "256", "768", "1024", "0"}; static const char *const values[] = {"512", "256", "768", "1024", "0"};
const char *names[] = {"512 MB", "256 MB", "768 MB", "1024 MB", menu_text(UI_MENU_OFF)}; const char *names[] = {"512 MB", "256 MB", "768 MB", "1024 MB", menu_text(UI_MENU_OFF)};
opt_choice_list("NX2NAVI_VRAM_RESERVE_MB", UI_MENU_LAMA_RESERVE, values, names, 5, UI_MENU_LAMA_RESERVE_DESC); opt_choice_list("NX2NAVI_VRAM_RESERVE_MB", UI_MENU_LOWEND_RESERVE, values, names, 5, UI_MENU_LOWEND_RESERVE_DESC);
} }
{ // vk_memory.c upload_batch_cap { // vk_memory.c upload_batch_cap
static const char *const values[] = {"128", "256", "512", "1024", "0"}; static const char *const values[] = {"128", "256", "512", "1024", "0"};
const char *names[] = {"128 MB", "256 MB", "512 MB", "1024 MB", menu_text(UI_MENU_LAMA_NO_LIMIT)}; const char *names[] = {"128 MB", "256 MB", "512 MB", "1024 MB", menu_text(UI_MENU_LOWEND_NO_LIMIT)};
opt_choice_list("NX2NAVI_UPLOAD_BATCH_MB", UI_MENU_LAMA_UPLOAD_BATCH, values, names, 5, UI_MENU_LAMA_UPLOAD_BATCH_DESC); opt_choice_list("NX2NAVI_UPLOAD_BATCH_MB", UI_MENU_LOWEND_UPLOAD_BATCH, values, names, 5, UI_MENU_LOWEND_UPLOAD_BATCH_DESC);
} }
opt_toggle("NX2NAVI_ASTC_SCRATCH_KEEP", UI_MENU_LAMA_ASTC_KEEP, UI_MENU_LAMA_ASTC_KEEP_DESC); opt_toggle("NX2NAVI_ASTC_SCRATCH_KEEP", UI_MENU_LOWEND_ASTC_KEEP, UI_MENU_LOWEND_ASTC_KEEP_DESC);
{ // vk_memory.c freeze_pass: submissions a region stays unwritten before it is frozen { // vk_memory.c freeze_pass: submissions a region stays unwritten before it is frozen
static const char *const values[] = {"1800", "1200", "600", "60", "0"}; static const char *const values[] = {"1800", "1200", "600", "60", "0"};
const char *names[] = {"1800", "1200", "600", "60", menu_text(UI_MENU_OFF)}; 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_choice_list("NX2NAVI_FREEZE_IDLE", UI_MENU_LOWEND_FREEZE, values, names, 5, UI_MENU_LOWEND_FREEZE_DESC);
} }
{ // vk_sync.c res_mask: the result kinds the submit wait counts (31 all, 30 all but events) { // vk_sync.c res_mask: the result kinds the submit wait counts (31 all, 30 all but events)
static const char *const values[] = {"31", "30"}; static const char *const values[] = {"31", "30"};
const char *names[] = {menu_text(UI_MENU_LAMA_RESULTS_ALL), menu_text(UI_MENU_LAMA_RESULTS_NO_EVENTS)}; const char *names[] = {menu_text(UI_MENU_LOWEND_RESULTS_ALL), menu_text(UI_MENU_LOWEND_RESULTS_NO_EVENTS)};
opt_choice_list("NX2NAVI_SUBMIT_FINISH_KINDS", UI_MENU_LAMA_RESULTS, values, names, 2, UI_MENU_LAMA_RESULTS_DESC); opt_choice_list("NX2NAVI_SUBMIT_FINISH_KINDS", UI_MENU_LOWEND_RESULTS, values, names, 2, UI_MENU_LOWEND_RESULTS_DESC);
} }
opt_toggle("NX2NAVI_ZSTD_NATIVE", UI_MENU_LAMA_ZSTD, UI_MENU_LAMA_ZSTD_DESC); // ov_zstd.c trusted opt_toggle("NX2NAVI_ZSTD_NATIVE", UI_MENU_LOWEND_ZSTD, UI_MENU_LOWEND_ZSTD_DESC); // ov_zstd.c trusted
opt_group(UI_MENU_LAMA_RENDER); opt_group(UI_MENU_LOWEND_RENDER);
opt_toggle("NX2NAVI_REPLAY_ASYNC", UI_MENU_LAMA_ASYNC, UI_MENU_LAMA_ASYNC_DESC); // vk_backend.c opt_toggle("NX2NAVI_REPLAY_ASYNC", UI_MENU_LOWEND_ASYNC, UI_MENU_LOWEND_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 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); if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
opt_toggle("NX2NAVI_MESH_EMULATION", UI_MENU_LAMA_MESH_EMU, UI_MENU_LAMA_MESH_EMU_DESC); opt_toggle("NX2NAVI_MESH_EMULATION", UI_MENU_LOWEND_MESH_EMU, UI_MENU_LOWEND_MESH_EMU_DESC);
{ // vk_exec_draw.c foliage_skip { // vk_exec_draw.c foliage_skip
static const char *const values[] = {"full", "reduced", "off"}; static const char *const values[] = {"full", "reduced", "off"};
const char *names[] = {menu_text(UI_MENU_LAMA_FOLIAGE_FULL), menu_text(UI_MENU_LAMA_FOLIAGE_REDUCED), menu_text(UI_MENU_OFF)}; const char *names[] = {menu_text(UI_MENU_LOWEND_FOLIAGE_FULL), menu_text(UI_MENU_LOWEND_FOLIAGE_REDUCED), menu_text(UI_MENU_OFF)};
opt_choice_list("NX2NAVI_FOLIAGE", UI_MENU_LAMA_FOLIAGE, values, names, 3, UI_MENU_LAMA_FOLIAGE_DESC); opt_choice_list("NX2NAVI_FOLIAGE", UI_MENU_LOWEND_FOLIAGE, values, names, 3, UI_MENU_LOWEND_FOLIAGE_DESC);
} }
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE); if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
opt_slider("NX2NAVI_MESH_EMU_MB", UI_MENU_LAMA_MESH_MB, 64, 2048, UI_MENU_LAMA_MESH_MB_DESC, 64, "%.0f MB"); opt_slider("NX2NAVI_MESH_EMU_MB", UI_MENU_LOWEND_MESH_MB, 64, 2048, UI_MENU_LOWEND_MESH_MB_DESC, 64, "%.0f MB");
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE); if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
opt_slider("NX2NAVI_MESH_EMU_TASKS", UI_MENU_LAMA_MESH_TASKS, 4096, 65536, UI_MENU_LAMA_MESH_TASKS_DESC, 4096, "%.0f"); opt_slider("NX2NAVI_MESH_EMU_TASKS", UI_MENU_LOWEND_MESH_TASKS, 4096, 65536, UI_MENU_LOWEND_MESH_TASKS_DESC, 4096, "%.0f");
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE); if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
opt_toggle("NX2NAVI_MESH_EMU_BATCH", UI_MENU_LAMA_MESH_BATCH, UI_MENU_LAMA_MESH_BATCH_DESC); // vk_exec_draw.c opt_toggle("NX2NAVI_MESH_EMU_BATCH", UI_MENU_LOWEND_MESH_BATCH, UI_MENU_LOWEND_MESH_BATCH_DESC); // vk_exec_draw.c
opt_toggle("NX2NAVI_TEX_CLOBBER", UI_MENU_LAMA_CLOBBER, UI_MENU_LAMA_CLOBBER_DESC); opt_toggle("NX2NAVI_TEX_CLOBBER", UI_MENU_LOWEND_CLOBBER, UI_MENU_LOWEND_CLOBBER_DESC);
static const UiTextId vec[] = {UI_MENU_OFF, UI_MENU_LAMA_VEC_AUTO, UI_MENU_ON}; // gfx_shader.c patch_vec_index static const UiTextId vec[] = {UI_MENU_OFF, UI_MENU_LOWEND_VEC_AUTO, UI_MENU_ON}; // gfx_shader.c patch_vec_index
opt_choice("NX2NAVI_VEC_INDEX_FIX", UI_MENU_LAMA_VEC_INDEX, vec, 3, UI_MENU_LAMA_VEC_INDEX_DESC); opt_choice("NX2NAVI_VEC_INDEX_FIX", UI_MENU_LOWEND_VEC_INDEX, vec, 3, UI_MENU_LOWEND_VEC_INDEX_DESC);
opt_group(UI_MENU_LAMA_BUILD); opt_group(UI_MENU_LOWEND_BUILD);
// tools/make_game.py reads it from nx2navi.ini at the next Rebuild the Game (guest_opt_ini) // tools/make_game.py reads it from nx2navi.ini at the next Rebuild the Game (guest_opt_ini)
opt_toggle_value("NX2NAVI_GUEST_OPT", UI_MENU_LAMA_GUEST_OPT, UI_MENU_LAMA_GUEST_OPT_DESC, "2", "1", opt_toggle_value("NX2NAVI_GUEST_OPT", UI_MENU_LOWEND_GUEST_OPT, UI_MENU_LOWEND_GUEST_OPT_DESC, "2", "1",
menu_text(UI_MENU_LAMA_GUEST_OPT_NOTE)); menu_text(UI_MENU_LOWEND_GUEST_OPT_NOTE));
opt_group(UI_MENU_LAMA_DIAG); opt_group(UI_MENU_LOWEND_DIAG);
opt_toggle("NX2NAVI_PASS_TIMES", UI_MENU_LAMA_PASS_TIMES, UI_MENU_LAMA_PASS_TIMES_DESC); // vk_crumbs.c opt_toggle("NX2NAVI_PASS_TIMES", UI_MENU_LOWEND_PASS_TIMES, UI_MENU_LOWEND_PASS_TIMES_DESC); // vk_crumbs.c
#ifdef _WIN32 #ifdef _WIN32
{ // vk_dump.c: the keys it knows { // vk_dump.c: the keys it knows
static const char *const values[] = {"", "pause", "scrolllock", "insert", "f12"}; static const char *const values[] = {"", "pause", "scrolllock", "insert", "f12"};
const char *names[] = {menu_text(UI_MENU_OFF), "Pause", "Scroll Lock", "Insert", "F12"}; const char *names[] = {menu_text(UI_MENU_OFF), "Pause", "Scroll Lock", "Insert", "F12"};
opt_choice_list("NX2NAVI_DUMP_KEY", UI_MENU_LAMA_DUMP_KEY, values, names, 5, UI_MENU_LAMA_DUMP_KEY_DESC); opt_choice_list("NX2NAVI_DUMP_KEY", UI_MENU_LOWEND_DUMP_KEY, values, names, 5, UI_MENU_LOWEND_DUMP_KEY_DESC);
} }
#endif #endif
opt_end();
} }
static const UiTextId kTabNames[TAB_COUNT] = {UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND, static const UiTextId kTabNames[TAB_COUNT] = {UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND,
UI_MENU_TAB_CONTROLS, UI_MENU_TAB_LAMA, UI_MENU_TAB_COOP}; UI_MENU_TAB_CONTROLS, UI_MENU_TAB_COOP};
static int g_tab; // the tab shown static int g_tab; // the tab shown
// The tabs the menu shows: the Co-op tab is a beta, shown only with coop_beta = 1 in nx2navi.ini (NX2NAVI_COOP_BETA), // The tabs the menu shows: the Co-op tab is a beta, shown only with coop_beta = 1 in nx2navi.ini (NX2NAVI_COOP_BETA),
@@ -1827,7 +1832,6 @@ static void layout_menu(uint32_t w, uint32_t h, float scale) {
case TAB_SOUND: tab_sound(scale); break; case TAB_SOUND: tab_sound(scale); break;
case TAB_CONTROLS: tab_controls(scale); break; case TAB_CONTROLS: tab_controls(scale); break;
case TAB_COOP: tab_coop(scale); break; case TAB_COOP: tab_coop(scale); break;
case TAB_LAMA: tab_lama(scale); break;
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }

View File

@@ -89,91 +89,91 @@ static const char *const text_en[UI_TEXT_COUNT] = {
[UI_MENU_TEX_DETAIL_DESC] = "Sharpness of large surface textures. Reduced and Low leave out their largest versions, so that an area fits the video memory of 6 and 8 GB cards; only surfaces seen up close look softer. Automatic picks by the card's video memory.", [UI_MENU_TEX_DETAIL_DESC] = "Sharpness of large surface textures. Reduced and Low leave out their largest versions, so that an area fits the video memory of 6 and 8 GB cards; only surfaces seen up close look softer. Automatic picks by the card's video memory.",
[UI_MENU_TEX_DETAIL_AUTO] = "Automatic: %s", [UI_MENU_TEX_DETAIL_AUTO] = "Automatic: %s",
[UI_MENU_TEX_DETAIL_FULL] = "Full", [UI_MENU_TEX_DETAIL_REDUCED] = "Reduced", [UI_MENU_TEX_DETAIL_LOW] = "Low", [UI_MENU_TEX_DETAIL_FULL] = "Full", [UI_MENU_TEX_DETAIL_REDUCED] = "Reduced", [UI_MENU_TEX_DETAIL_LOW] = "Low",
[UI_MENU_TAB_LAMA] = "Lama patches", [UI_MENU_LOWEND_INTRO] = "The settings of the low-end GPU mode. Each can be changed here; most take effect after a restart.",
[UI_MENU_LAMA_INTRO] = "Settings for older graphics cards and ones short of video memory. Most take effect after a restart.", [UI_MENU_LOWEND_RESTART] = "The mode turns on after a restart. Its settings are listed here then.",
[UI_MENU_LAMA_MEMORY] = "Video memory and textures", [UI_MENU_LOWEND_MEMORY] = "Video memory and textures",
[UI_MENU_LAMA_RENDER] = "Rendering", [UI_MENU_LOWEND_RENDER] = "Rendering",
[UI_MENU_LAMA_BUILD] = "Build", [UI_MENU_LOWEND_BUILD] = "Build",
[UI_MENU_LAMA_DIAG] = "Diagnostics", [UI_MENU_LOWEND_DIAG] = "Diagnostics",
[UI_MENU_LAMA_RELEASED] = "Released textures kept", [UI_MENU_LOWEND_RELEASED] = "Released textures kept",
[UI_MENU_LAMA_RELEASED_DESC] = "How many textures the game has released are kept as they are; past it only those that " [UI_MENU_LOWEND_RELEASED_DESC] = "How many textures the game has released are kept as they are; past it only those that "
"lose nothing when dropped go. Fewer leaves more video memory for the rest; more " "lose nothing when dropped go. Fewer leaves more video memory for the rest; more "
"saves making them again; too few lets some blink black for a moment. Auto: one per 2 MB " "saves making them again; too few lets some blink black for a moment. Auto: one per 2 MB "
"of the video memory budget, 2048 to 8192.", "of the video memory budget, 2048 to 8192.",
[UI_MENU_LAMA_CLOBBER] = "Fix overwritten textures", [UI_MENU_LOWEND_CLOBBER] = "Fix overwritten textures",
[UI_MENU_LAMA_CLOBBER_DESC] = "A texture the game reads after another image was drawn over its memory gets memory of " [UI_MENU_LOWEND_CLOBBER_DESC] = "A texture the game reads after another image was drawn over its memory gets memory of "
"its own. Fixes the teal splotches in Kokiri Forest's fog.", "its own. Fixes the teal splotches in Kokiri Forest's fog.",
[UI_MENU_LAMA_MIRROR_HOT] = "Pools copied every frame stay in system memory", [UI_MENU_LOWEND_MIRROR_HOT] = "Pools copied every frame stay in system memory",
[UI_MENU_LAMA_MIRROR_HOT_DESC] = "A game memory pool whose copies to and from video memory each frame reach this " [UI_MENU_LOWEND_MIRROR_HOT_DESC] = "A game memory pool whose copies to and from video memory each frame reach this "
"percentage of its size is read by the GPU from system memory instead, if the " "percentage of its size is read by the GPU from system memory instead, if the "
"CPU does not write it (a pool it refills each frame stays in video memory: read " "CPU does not write it (a pool it refills each frame stays in video memory: read "
"in place, the GPU saw the next frame's data). For GPUs and buses short of " "in place, the GPU saw the next frame's data). For GPUs and buses short of "
"bandwidth; 25 suits an RX 580. 0: off.", "bandwidth; 25 suits an RX 580. 0: off.",
[UI_MENU_LAMA_RESERVE] = "Video memory kept free", [UI_MENU_LOWEND_RESERVE] = "Video memory kept free",
[UI_MENU_LAMA_RESERVE_DESC] = "Room kept free in each video memory heap for what FidelityFX (FSR 3.1, frame generation) and the " [UI_MENU_LOWEND_RESERVE_DESC] = "Room kept free in each video memory heap for what FidelityFX (FSR 3.1, frame generation) and the "
"driver allocate on their own: a heap with less than this left takes no new allocation while " "driver allocate on their own: a heap with less than this left takes no new allocation while "
"another heap can. Off: video memory can fill up with frame generation on, and the game ends.", "another heap can. Off: video memory can fill up with frame generation on, and the game ends.",
[UI_MENU_LAMA_HEAP_LIMIT] = "Video memory heap limit", [UI_MENU_LOWEND_HEAP_LIMIT] = "Video memory heap limit",
[UI_MENU_LAMA_HEAP_LIMIT_DESC] = "Auto: on GPUs with a second video memory heap (an RX 580 shows 6 GB and 2 GB), " [UI_MENU_LOWEND_HEAP_LIMIT_DESC] = "Auto: on GPUs with a second video memory heap (an RX 580 shows 6 GB and 2 GB), "
"each heap is filled only to its budget before the next one is used, so the " "each heap is filled only to its budget before the next one is used, so the "
"driver does not run out. Off: no limit.", "driver does not run out. Off: no limit.",
[UI_MENU_LAMA_UPLOAD_BATCH] = "Upload batch limit", [UI_MENU_LOWEND_UPLOAD_BATCH] = "Upload batch limit",
[UI_MENU_LAMA_UPLOAD_BATCH_DESC] = "Texture uploads waiting in staging memory are sent to the GPU early once they " [UI_MENU_LOWEND_UPLOAD_BATCH_DESC] = "Texture uploads waiting in staging memory are sent to the GPU early once they "
"hold this much, so an area load cannot run video memory out.", "hold this much, so an area load cannot run video memory out.",
[UI_MENU_LAMA_NO_LIMIT] = "No limit", [UI_MENU_LOWEND_NO_LIMIT] = "No limit",
[UI_MENU_LAMA_ASTC_KEEP] = "Keep the ASTC decode buffer", [UI_MENU_LOWEND_ASTC_KEEP] = "Keep the ASTC decode buffer",
[UI_MENU_LAMA_ASTC_KEEP_DESC] = "The buffer that GPU-decodes compressed textures is kept between upload batches " [UI_MENU_LOWEND_ASTC_KEEP_DESC] = "The buffer that GPU-decodes compressed textures is kept between upload batches "
"instead of being allocated again for each one.", "instead of being allocated again for each one.",
[UI_MENU_LAMA_MESH_EMU] = "Mesh shader emulation", [UI_MENU_LOWEND_MESH_EMU] = "Mesh shader emulation",
[UI_MENU_LAMA_MESH_EMU_DESC] = "Draws grass, moss and other foliage on GPUs without mesh shaders (AMD RX 400/500 " [UI_MENU_LOWEND_MESH_EMU_DESC] = "Draws grass, moss and other foliage on GPUs without mesh shaders (AMD RX 400/500 "
"and Vega, GTX 10-series and older), with compute shaders. GPUs with mesh shaders " "and Vega, GTX 10-series and older), with compute shaders. GPUs with mesh shaders "
"ignore it.", "ignore it.",
[UI_MENU_LAMA_MESH_NATIVE] = "this GPU has mesh shaders", [UI_MENU_LOWEND_MESH_NATIVE] = "this GPU has mesh shaders",
[UI_MENU_LAMA_MESH_MB] = "Mesh emulation memory", [UI_MENU_LOWEND_MESH_MB] = "Mesh emulation memory",
[UI_MENU_LAMA_MESH_MB_DESC] = "Video memory for the emulated meshes' vertices and indices, in MB.", [UI_MENU_LOWEND_MESH_MB_DESC] = "Video memory for the emulated meshes' vertices and indices, in MB.",
[UI_MENU_LAMA_MESH_BATCH] = "Mesh emulation before the pass", [UI_MENU_LOWEND_MESH_BATCH] = "Mesh emulation before the pass",
[UI_MENU_LAMA_MESH_BATCH_DESC] = "The emulated mesh stages of a render pass run before the pass in a command buffer " [UI_MENU_LOWEND_MESH_BATCH_DESC] = "The emulated mesh stages of a render pass run before the pass in a command buffer "
"of their own, instead of splitting the pass at every emulated draw. Off: the " "of their own, instead of splitting the pass at every emulated draw. Off: the "
"split, as before.", "split, as before.",
[UI_MENU_LAMA_MESH_TASKS] = "Mesh emulation task records", [UI_MENU_LOWEND_MESH_TASKS] = "Mesh emulation task records",
[UI_MENU_LAMA_MESH_TASKS_DESC] = "Task records per submission for the emulated meshes. Raise it when the log reports " [UI_MENU_LOWEND_MESH_TASKS_DESC] = "Task records per submission for the emulated meshes. Raise it when the log reports "
"that a submission asked for more.", "that a submission asked for more.",
[UI_MENU_LAMA_VEC_INDEX] = "Vector index fix", [UI_MENU_LOWEND_VEC_INDEX] = "Vector index fix",
[UI_MENU_LAMA_VEC_INDEX_DESC] = "Shaders read uniform vector components at computed indices whole and select the " [UI_MENU_LOWEND_VEC_INDEX_DESC] = "Shaders read uniform vector components at computed indices whole and select the "
"component, for drivers that get such reads wrong. Auto: on AMD's own drivers.", "component, for drivers that get such reads wrong. Auto: on AMD's own drivers.",
[UI_MENU_LAMA_VEC_AUTO] = "Auto (AMD)", [UI_MENU_LOWEND_VEC_AUTO] = "Auto (AMD)",
[UI_MENU_LAMA_GUEST_OPT] = "Optimised game code (-O2)", [UI_MENU_LOWEND_GUEST_OPT] = "Optimised game code (-O2)",
[UI_MENU_LAMA_GUEST_OPT_DESC] = "The next Rebuild the Game in the launcher compiles the game's code at -O2 instead " [UI_MENU_LOWEND_GUEST_OPT_DESC] = "The next Rebuild the Game in the launcher compiles the game's code at -O2 instead "
"of -O1: the game's own threads run faster on a slower CPU. The build takes " "of -O1: the game's own threads run faster on a slower CPU. The build takes "
"several times longer.", "several times longer.",
[UI_MENU_LAMA_GUEST_OPT_NOTE] = "at the next rebuild", [UI_MENU_LOWEND_GUEST_OPT_NOTE] = "at the next rebuild",
[UI_MENU_LAMA_FREEZE] = "Freeze idle memory after", [UI_MENU_LOWEND_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 " [UI_MENU_LOWEND_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: " "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 game thaws regions all the time and every thaw stalls a frame. Off: no stalls, but "
"the tracking scans all memory every frame.", "the tracking scans all memory every frame.",
[UI_MENU_LAMA_FOLIAGE] = "Foliage", [UI_MENU_LOWEND_FOLIAGE] = "Foliage",
[UI_MENU_LAMA_FOLIAGE_DESC] = "Full: all of it. Reduced: no small grass or moss on the ground; ferns, leaves and " [UI_MENU_LOWEND_FOLIAGE_DESC] = "Full: all of it. Reduced: no small grass or moss on the ground; ferns, leaves and "
"other plants stay. Off: no foliage. Terrain, rocks and buildings always stay.", "other plants stay. Off: no foliage. Terrain, rocks and buildings always stay.",
[UI_MENU_LAMA_FOLIAGE_FULL] = "Full", [UI_MENU_LOWEND_FOLIAGE_FULL] = "Full",
[UI_MENU_LAMA_FOLIAGE_REDUCED] = "Reduced", [UI_MENU_LOWEND_FOLIAGE_REDUCED] = "Reduced",
[UI_MENU_LAMA_RESULTS] = "Wait for GPU results", [UI_MENU_LOWEND_RESULTS] = "Wait for GPU results",
[UI_MENU_LAMA_RESULTS_DESC] = "After a frame's first submission the game waits until the GPU wrote the results it " [UI_MENU_LOWEND_RESULTS_DESC] = "After a frame's first submission the game waits until the GPU wrote the results it "
"reads back. All: events, counter and occlusion reports, write-backs. Without events: " "reads back. All: events, counter and occlusion reports, write-backs. Without events: "
"a shorter wait; on an RX 580 nothing flickered.", "a shorter wait; on an RX 580 nothing flickered.",
[UI_MENU_LAMA_RESULTS_ALL] = "All", [UI_MENU_LOWEND_RESULTS_ALL] = "All",
[UI_MENU_LAMA_RESULTS_NO_EVENTS] = "Without events", [UI_MENU_LOWEND_RESULTS_NO_EVENTS] = "Without events",
[UI_MENU_LAMA_ZSTD] = "Native data decompression", [UI_MENU_LOWEND_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 " [UI_MENU_LOWEND_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.", "decoder translated from the console. Lighter streaming while you move.",
[UI_MENU_LAMA_ASYNC] = "Asynchronous replay", [UI_MENU_LOWEND_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 " [UI_MENU_LOWEND_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.", "the game prepares the next frame meanwhile.",
[UI_MENU_LAMA_PASS_TIMES] = "Pass times in the log", [UI_MENU_LOWEND_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 " [UI_MENU_LOWEND_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.", "viewport each kind of pass draws with. Costs a little frame time.",
[UI_MENU_LAMA_DUMP_KEY] = "Frame dump key", [UI_MENU_LOWEND_DUMP_KEY] = "Frame dump key",
[UI_MENU_LAMA_DUMP_KEY_DESC] = "Each press of this key in the game window dumps the next frame (images and the " [UI_MENU_LOWEND_DUMP_KEY_DESC] = "Each press of this key in the game window dumps the next frame (images and the "
"frame's passes) to the dump folder, for a glitch caught while it is on screen. " "frame's passes) to the dump folder, for a glitch caught while it is on screen. "
"Windows only.", "Windows only.",
[UI_MENU_SHARPNESS] = "FSR sharpness", [UI_MENU_SHARPNESS] = "FSR sharpness",

View File

@@ -332,26 +332,26 @@ typedef enum {
UI_MENU_FRAMEGEN_MULT_UPTO, // printf: "%d", the highest multiplier this GPU and driver allow UI_MENU_FRAMEGEN_MULT_UPTO, // printf: "%d", the highest multiplier this GPU and driver allow
UI_MENU_FRAMEGEN_MULT_OLD_DLL, // nx2navi_dlssg.dll is older than multi frame generation UI_MENU_FRAMEGEN_MULT_OLD_DLL, // nx2navi_dlssg.dll is older than multi frame generation
UI_MENU_FRAMEGEN_UNAVAILABLE, UI_MENU_FRAMEGEN_OFF_FILES, UI_MENU_FRAMEGEN_UNAVAILABLE, UI_MENU_FRAMEGEN_OFF_FILES,
// the Lama patches tab (ui/menu.cpp tab_lama): the settings of the RX 580 patches, English only // the settings of the low-end GPU mode (ui/menu.cpp rows_low_end), English only
UI_MENU_TAB_LAMA, UI_MENU_LAMA_INTRO, UI_MENU_LAMA_MEMORY, UI_MENU_LAMA_RENDER, UI_MENU_LAMA_BUILD, UI_MENU_LOWEND_INTRO, UI_MENU_LOWEND_RESTART, UI_MENU_LOWEND_MEMORY, UI_MENU_LOWEND_RENDER, UI_MENU_LOWEND_BUILD,
UI_MENU_LAMA_DIAG, UI_MENU_LOWEND_DIAG,
UI_MENU_LAMA_FREEZE, UI_MENU_LAMA_FREEZE_DESC, UI_MENU_LAMA_ZSTD, UI_MENU_LAMA_ZSTD_DESC, UI_MENU_LOWEND_FREEZE, UI_MENU_LOWEND_FREEZE_DESC, UI_MENU_LOWEND_ZSTD, UI_MENU_LOWEND_ZSTD_DESC,
UI_MENU_LAMA_FOLIAGE, UI_MENU_LAMA_FOLIAGE_DESC, UI_MENU_LAMA_FOLIAGE_FULL, UI_MENU_LAMA_FOLIAGE_REDUCED, UI_MENU_LOWEND_FOLIAGE, UI_MENU_LOWEND_FOLIAGE_DESC, UI_MENU_LOWEND_FOLIAGE_FULL, UI_MENU_LOWEND_FOLIAGE_REDUCED,
UI_MENU_LAMA_RESULTS, UI_MENU_LAMA_RESULTS_DESC, UI_MENU_LAMA_RESULTS_ALL, UI_MENU_LAMA_RESULTS_NO_EVENTS, UI_MENU_LOWEND_RESULTS, UI_MENU_LOWEND_RESULTS_DESC, UI_MENU_LOWEND_RESULTS_ALL, UI_MENU_LOWEND_RESULTS_NO_EVENTS,
UI_MENU_LAMA_ASYNC, UI_MENU_LAMA_ASYNC_DESC, UI_MENU_LOWEND_ASYNC, UI_MENU_LOWEND_ASYNC_DESC,
UI_MENU_LAMA_RELEASED, UI_MENU_LAMA_RELEASED_DESC, UI_MENU_LOWEND_RELEASED, UI_MENU_LOWEND_RELEASED_DESC,
UI_MENU_LAMA_CLOBBER, UI_MENU_LAMA_CLOBBER_DESC, UI_MENU_LOWEND_CLOBBER, UI_MENU_LOWEND_CLOBBER_DESC,
UI_MENU_LAMA_MIRROR_HOT, UI_MENU_LAMA_MIRROR_HOT_DESC, UI_MENU_LOWEND_MIRROR_HOT, UI_MENU_LOWEND_MIRROR_HOT_DESC,
UI_MENU_LAMA_HEAP_LIMIT, UI_MENU_LAMA_HEAP_LIMIT_DESC, UI_MENU_LAMA_RESERVE, UI_MENU_LAMA_RESERVE_DESC, UI_MENU_LOWEND_HEAP_LIMIT, UI_MENU_LOWEND_HEAP_LIMIT_DESC, UI_MENU_LOWEND_RESERVE, UI_MENU_LOWEND_RESERVE_DESC,
UI_MENU_LAMA_UPLOAD_BATCH, UI_MENU_LAMA_UPLOAD_BATCH_DESC, UI_MENU_LAMA_NO_LIMIT, UI_MENU_LOWEND_UPLOAD_BATCH, UI_MENU_LOWEND_UPLOAD_BATCH_DESC, UI_MENU_LOWEND_NO_LIMIT,
UI_MENU_LAMA_ASTC_KEEP, UI_MENU_LAMA_ASTC_KEEP_DESC, UI_MENU_LOWEND_ASTC_KEEP, UI_MENU_LOWEND_ASTC_KEEP_DESC,
UI_MENU_LAMA_MESH_EMU, UI_MENU_LAMA_MESH_EMU_DESC, UI_MENU_LAMA_MESH_NATIVE, UI_MENU_LOWEND_MESH_EMU, UI_MENU_LOWEND_MESH_EMU_DESC, UI_MENU_LOWEND_MESH_NATIVE,
UI_MENU_LAMA_MESH_MB, UI_MENU_LAMA_MESH_MB_DESC, UI_MENU_LAMA_MESH_TASKS, UI_MENU_LAMA_MESH_TASKS_DESC, UI_MENU_LOWEND_MESH_MB, UI_MENU_LOWEND_MESH_MB_DESC, UI_MENU_LOWEND_MESH_TASKS, UI_MENU_LOWEND_MESH_TASKS_DESC,
UI_MENU_LAMA_MESH_BATCH, UI_MENU_LAMA_MESH_BATCH_DESC, UI_MENU_LOWEND_MESH_BATCH, UI_MENU_LOWEND_MESH_BATCH_DESC,
UI_MENU_LAMA_VEC_INDEX, UI_MENU_LAMA_VEC_INDEX_DESC, UI_MENU_LAMA_VEC_AUTO, UI_MENU_LOWEND_VEC_INDEX, UI_MENU_LOWEND_VEC_INDEX_DESC, UI_MENU_LOWEND_VEC_AUTO,
UI_MENU_LAMA_GUEST_OPT, UI_MENU_LAMA_GUEST_OPT_DESC, UI_MENU_LAMA_GUEST_OPT_NOTE, UI_MENU_LOWEND_GUEST_OPT, UI_MENU_LOWEND_GUEST_OPT_DESC, UI_MENU_LOWEND_GUEST_OPT_NOTE,
UI_MENU_LAMA_PASS_TIMES, UI_MENU_LAMA_PASS_TIMES_DESC, UI_MENU_LOWEND_PASS_TIMES, UI_MENU_LOWEND_PASS_TIMES_DESC,
UI_MENU_LAMA_DUMP_KEY, UI_MENU_LAMA_DUMP_KEY_DESC, UI_MENU_LOWEND_DUMP_KEY, UI_MENU_LOWEND_DUMP_KEY_DESC,
UI_TEXT_COUNT UI_TEXT_COUNT
} UiTextId; } UiTextId;

View File

@@ -861,5 +861,5 @@ int probe_vkdevice(void) {
return g_errors_total ? 1 : 0; return g_errors_total ? 1 : 0;
} }
// The GPU has mesh shaders: the mesh emulation (NX2NAVI_MESH_EMULATION) does nothing there (the menu's Lama patches tab). // The GPU has mesh shaders: the mesh emulation (NX2NAVI_MESH_EMULATION) does nothing there (the low-end GPU rows of the menu's Game tab).
int vk_mesh_shader_native(void) { return g_vk.has_mesh_shader; } int vk_mesh_shader_native(void) { return g_vk.has_mesh_shader; }

View File

@@ -6124,7 +6124,7 @@ static int mesh_ring_entry(VkExec *ex, VkCommandBuffer cb, const p_draw_mesh_ind
return 1; return 1;
} }
// NX2NAVI_FOLIAGE (full, reduced, off; default full; the Lama patches tab): Ocarina draws its foliage with // NX2NAVI_FOLIAGE (full, reduced, off; default full; the low-end GPU rows of the menu's Game tab): Ocarina draws its foliage with
// DrawMeshTasksIndirect, the instances its compute passes culled on the GPU. With a task stage: the small grass and moss // DrawMeshTasksIndirect, the instances its compute passes culled on the GPU. With a task stage: the small grass and moss
// that carpet the ground; without one: ferns, leaves, clover and the other plants. Its other mesh draws (DrawMeshTasks // that carpet the ground; without one: ferns, leaves, clover and the other plants. Its other mesh draws (DrawMeshTasks
// with a count: terrain, rocks, buildings, doors) are not foliage. reduced skips the indirect draws with a task stage, // with a count: terrain, rocks, buildings, doors) are not foliage. reduced skips the indirect draws with a task stage,

View File

@@ -1426,20 +1426,25 @@ def fast_clang(msys, clang, env):
def guest_opt_ini(out): def guest_opt_ini(out):
"""NX2NAVI_GUEST_OPT from nx2navi.ini next to the exe (the menu's Lama patches tab writes it there) when the """NX2NAVI_GUEST_OPT from nx2navi.ini next to the exe (the low-end GPU rows of the menu's Game tab write it there)
environment does not set it: the next build of the game folder out takes it.""" when the environment does not set it: the next build of the game folder out takes it. Only while low_end_gpu = 1
is in the file too: the mode's settings count only with the mode on (runtime/cfg.c LOWEND_ONLY)."""
if os.environ.get('NX2NAVI_GUEST_OPT', '').strip(): if os.environ.get('NX2NAVI_GUEST_OPT', '').strip():
return return
found, low = '', False
try: try:
for line in (Path(out) / 'nx2navi.ini').read_text(encoding='utf-8', errors='replace').splitlines(): for line in (Path(out) / 'nx2navi.ini').read_text(encoding='utf-8', errors='replace').splitlines():
key, eq, value = line.partition('=') key, eq, value = line.partition('=')
key = key.strip().lower() key = key.strip().lower()
if eq and key in ('guest_opt', 'nx2navi_guest_opt'):
value = value.split('#')[0].split(';')[0].strip().strip('"') value = value.split('#')[0].split(';')[0].strip().strip('"')
if value: if eq and key in ('guest_opt', 'nx2navi_guest_opt') and value:
os.environ['NX2NAVI_GUEST_OPT'] = value found = value
if eq and key in ('low_end_gpu', 'nx2navi_low_end_gpu'):
low = value not in ('', '0')
except OSError: except OSError:
pass pass
if found and low:
os.environ['NX2NAVI_GUEST_OPT'] = found
def runtime_cmd(clang, clangxx, inc, level=0, fast=None, msys=None, first=()): def runtime_cmd(clang, clangxx, inc, level=0, fast=None, msys=None, first=()):