mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
Merge the Linux pull requests into the 0.7.0 release line.
Eighteen commits, one per Linux pull request that was not in yet: the build fix for a source checkout, NVIDIA's shader disk cache only with NVIDIA's driver, tools/run_game.py for a Linux game folder, a memory limit the low-memory handling can read, the recording thread's core on Linux, shadow storage on Linux and Proton, the Steam Deck profile and prompts, FSR 3.1 offered only where its library loads, DLSS frame generation through NGX on Linux, the AppImage with its window and its workflow, and the processor level from /proc/cpuinfo. Two conflicts: the settings table keeps the area-load settings under the new comment, and the example file keeps the lazy write-back as off by default and adds that it stays off with shadow storage. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -67,6 +67,10 @@ int vk_hdr_wanted(void);
|
||||
int vk_hdr_active(void);
|
||||
int vk_hdr_needs_restart(void);
|
||||
int vk_dlaa_needs_restart(void);
|
||||
int vk_ngxfg_wanted(void); // vk_dlaa.c: DLSS's frame generation through NGX itself can run in this run
|
||||
int vk_ngxfg_max(void); // ... and how many frames it may generate per rendered one (0: it cannot)
|
||||
int vk_ffx_available(void); // vk_ffx.cpp: FSR 3.1 upscaling can run (asked without loading the library)
|
||||
int vk_ffx_framegen_available(void); // ... and FSR 3.1 frame generation
|
||||
double frame_step_limit_hz(void);
|
||||
int frame_limit_follows_display(void);
|
||||
int frame_limit_adjustable(void);
|
||||
@@ -798,14 +802,15 @@ static bool dlss_offered(void) {
|
||||
// (DLSS or FSR 3.1 on) with NX2NAVI_TAA (which of them) and NX2NAVI_DLSS (the mode, the render scale: widescreen.c
|
||||
// wide_present). A temporal mode fits the picture with bilinear, the upscaler having made it; DLSS's model is NVIDIA's own
|
||||
// for the mode (vk_dlaa.c evaluate, dlss_preset at its default). The list: bilinear, FSR 1, the DLSS modes where DLSS
|
||||
// runs (dlss_offered), the FSR 3.1 modes; a DLSS mode still set where DLSS does not run stays listed last until another
|
||||
// choice replaces it, so the row shows what is set.
|
||||
// runs (dlss_offered), the FSR 3.1 modes where FSR 3.1 loads (vk_ffx_available); a DLSS or FSR 3.1 mode still set where
|
||||
// it does not run stays listed last until another choice replaces it, so the row shows what is set.
|
||||
// The Upscaling row's name of what is set now, for the performance overlay.
|
||||
static void upscaling_name(char *out, size_t size) {
|
||||
static const char *const modes[] = {"dlaa", "quality", "balanced", "performance", "ultra_performance"};
|
||||
static const UiTextId dlss[] = {UI_MENU_DLSS_DLAA, UI_MENU_DLSS_QUALITY, UI_MENU_DLSS_BALANCED, UI_MENU_DLSS_PERFORMANCE, UI_MENU_DLSS_ULTRA};
|
||||
static const UiTextId fsr3[] = {UI_MENU_FSR3_NATIVE, UI_MENU_DLSS_QUALITY, UI_MENU_DLSS_BALANCED, UI_MENU_DLSS_PERFORMANCE, UI_MENU_DLSS_ULTRA};
|
||||
if (!cfg_bool("NX2NAVI_DLAA")) {
|
||||
// FSR 3.1 set where it cannot load runs nothing (vk_dlaa.c vk_dlaa_fsr3): the game scales the picture as the rest says
|
||||
if (!cfg_bool("NX2NAVI_DLAA") || (!strcmp(cfg_value("NX2NAVI_TAA"), "fsr3") && !vk_ffx_available())) {
|
||||
if (strcmp(cfg_value("NX2NAVI_UPSCALER"), "fsr")) snprintf(out, size, "%s", menu_text(UI_MENU_UPSCALER_BILINEAR));
|
||||
else snprintf(out, size, menu_text(UI_MENU_OV_FMT_FSR), cfg_int("NX2NAVI_SHARPNESS"));
|
||||
return;
|
||||
@@ -849,18 +854,23 @@ static void row_upscaling(void) {
|
||||
for (int i = 0; i < 5; i++)
|
||||
if (!strcmp(cfg_value("NX2NAVI_DLSS"), modes[i])) now.mode = i;
|
||||
}
|
||||
const bool dlss = dlss_offered();
|
||||
const bool dlss = dlss_offered(), fsr = vk_ffx_available();
|
||||
add(BILINEAR, 0);
|
||||
add(FSR1, 0);
|
||||
for (int i = 0; dlss && i < 5; i++) add(DLSS, i);
|
||||
for (int i = 0; i < 5; i++) add(FSR3, i);
|
||||
for (int i = 0; fsr && i < 5; i++) add(FSR3, i);
|
||||
if (!dlss && now.kind == DLSS) add(DLSS, now.mode);
|
||||
if (!fsr && now.kind == FSR3) add(FSR3, now.mode);
|
||||
int cur = 0;
|
||||
for (int i = 0; i < n; i++)
|
||||
if (list[i].kind == now.kind && list[i].mode == now.mode) cur = i;
|
||||
// FSR 3.1 still set where it cannot load: nothing upscales, so the row says so under its value
|
||||
const char *note = nullptr;
|
||||
if (!fsr && now.kind == FSR3) note = menu_text(UI_MENU_FSR3_OFF);
|
||||
else if (dlss && vk_dlaa_needs_restart()) note = menu_text(UI_MENU_AFTER_RESTART);
|
||||
int nv = opt_choice_index("NX2NAVI_UPSCALER", UI_MENU_UPSCALING, names, n, cur, 1,
|
||||
dlss ? UI_MENU_UPSCALING_DESC : UI_MENU_UPSCALING_DESC_FSR,
|
||||
dlss && vk_dlaa_needs_restart() ? menu_text(UI_MENU_AFTER_RESTART) : nullptr);
|
||||
!fsr ? UI_MENU_UPSCALING_DESC_NO_FSR : dlss ? UI_MENU_UPSCALING_DESC : UI_MENU_UPSCALING_DESC_FSR,
|
||||
note);
|
||||
if (nv < 0 || nv >= n) return;
|
||||
const Entry e = list[nv];
|
||||
opt_apply("NX2NAVI_UPSCALER", e.kind == FSR1 ? "fsr" : "bilinear");
|
||||
@@ -933,28 +943,78 @@ static void row_framegen_mult(bool restart) {
|
||||
if (nv >= 0 && nv < n) opt_apply("NX2NAVI_FRAMEGEN_MULTIPLIER", values[nv]);
|
||||
}
|
||||
|
||||
// NVIDIA's frame generation runs through NGX itself, not through Streamline (vk_dlaa.c vk_ngxfg_*, gfx_present.c
|
||||
// ng_*): every build but the Windows one.
|
||||
static bool framegen_ngx(void) {
|
||||
#ifdef _WIN32
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Its multiplier there (cfg.c FG_MULT, gfx_present.c ng_multiplier): 2x up to what the GPU allows, or Dynamic. Left out
|
||||
// while frame generation is set but cannot run: the frame generation row says why.
|
||||
static void row_framegen_mult_ngx(void) {
|
||||
static const char *const mult[] = {"2", "3", "4", "5", "6"};
|
||||
static const char *const mult_names[] = {"2x", "3x", "4x", "5x", "6x"};
|
||||
const int max = vk_ngxfg_max(); // generated frames per rendered one
|
||||
if (max < 1) return;
|
||||
const char *values[6], *names[6];
|
||||
int n = 0;
|
||||
for (; n < max && n < 5; n++) values[n] = mult[n], names[n] = mult_names[n];
|
||||
const int top = n - 1;
|
||||
values[n] = "dynamic", names[n++] = menu_text(UI_MENU_FG_MULT_DYNAMIC);
|
||||
const char *v = cfg_value("NX2NAVI_FG_MULT");
|
||||
int cur = strcmp(v, "dynamic") ? top : n - 1; // a multiplier above what the GPU allows shows as the highest
|
||||
for (int i = 0; i < n; i++)
|
||||
if (!strcmp(v, values[i])) cur = i;
|
||||
int nv = opt_choice_index("NX2NAVI_FG_MULT", UI_MENU_FRAMEGEN_MULT, names, n, cur, 0, UI_MENU_FG_MULT_DESC, nullptr);
|
||||
if (nv >= 0 && nv < n) opt_apply("NX2NAVI_FG_MULT", values[nv]);
|
||||
}
|
||||
|
||||
// Frame generation (vk_fg.cpp, at once; NVIDIA's after a restart); it needs a temporal upscaler's motion vectors
|
||||
static void row_framegen(void) {
|
||||
// the generated frames are made from DLSS's or FSR 3.1's motion vectors: without one of them it would do nothing
|
||||
const bool dlss = dlss_offered(), upscaled = cfg_bool("NX2NAVI_DLAA");
|
||||
if (!upscaled) opt_disable_next(dlss ? UI_MENU_FRAMEGEN_NEEDS : UI_MENU_FRAMEGEN_NEEDS_FSR);
|
||||
static const char *const values[] = {"off", "fsr3", "dlss"};
|
||||
const char *names[] = {menu_text(UI_MENU_FRAMEGEN_OFF), "AMD FSR 3.1", "NVIDIA DLSS"};
|
||||
// the generated frames are made from DLSS's or FSR 3.1's motion vectors: without one of them it would do nothing,
|
||||
// and FSR 3.1 set where it cannot load (vk_ffx_available) is none
|
||||
const bool dlss = dlss_offered(), fsr = vk_ffx_framegen_available();
|
||||
const bool upscaled = cfg_bool("NX2NAVI_DLAA") && (strcmp(cfg_value("NX2NAVI_TAA"), "fsr3") || vk_ffx_available());
|
||||
const char *v = cfg_value("NX2NAVI_FRAMEGEN");
|
||||
int cur = !strcmp(v, "fsr3") ? 1 : !strcmp(v, "dlss") ? 2 : 0;
|
||||
// NVIDIA DLSS (vk_dlssg.c, through Streamline and nx2navi_dlssg.dll) is listed on NVIDIA GPUs now that Reflex paces it
|
||||
// from the frame's start and generated frames are presented; elsewhere only while it is set
|
||||
int n = dlss || cur == 2 ? 3 : 2;
|
||||
// AMD's follows the setting; NVIDIA's is set up with the device, so only a change to or from it waits for a restart
|
||||
const bool restart = dlss && (cur == 2) != (vk_dlssg_wanted() != 0);
|
||||
UiTextId note = restart ? UI_MENU_AFTER_RESTART : dlss ? UI_MENU_FRAMEGEN_NOTE : UI_MENU_FRAMEGEN_NOTE_FSR;
|
||||
// NVIDIA's set since the start but not running: "in use: off" and why (vk_dlssg_status; the log has the details)
|
||||
const int st = cur == 2 && !restart ? vk_dlssg_status() : DLSSG_RUNS;
|
||||
// what the texts promise follows what runs here: DLSS's frame generation, AMD's, both or neither
|
||||
const UiTextId desc = dlss ? (fsr ? UI_MENU_FRAMEGEN_DESC : UI_MENU_FRAMEGEN_DESC_DLSS)
|
||||
: (fsr ? UI_MENU_FRAMEGEN_DESC_FSR : UI_MENU_FRAMEGEN_DESC_NONE);
|
||||
UiTextId note = dlss ? (fsr ? UI_MENU_FRAMEGEN_NOTE : UI_MENU_FRAMEGEN_NOTE_DLSS)
|
||||
: (fsr ? UI_MENU_FRAMEGEN_NOTE_FSR : UI_MENU_FRAMEGEN_NOTE); // neither: the general note
|
||||
if (!dlss && !fsr && cur == 0) opt_disable_next(UI_MENU_FRAMEGEN_NEEDS_NONE);
|
||||
else if (!upscaled) opt_disable_next(dlss ? (fsr ? UI_MENU_FRAMEGEN_NEEDS : UI_MENU_FRAMEGEN_NEEDS_DLSS)
|
||||
: (fsr ? UI_MENU_FRAMEGEN_NEEDS_FSR : UI_MENU_FRAMEGEN_NEEDS_NONE));
|
||||
// Off, AMD's where FSR 3.1 loads and NVIDIA DLSS (vk_dlssg.c, through Streamline and nx2navi_dlssg.dll) on NVIDIA GPUs,
|
||||
// now that Reflex paces it from the frame's start and generated frames are presented; elsewhere one stays listed
|
||||
// while it is set
|
||||
static const char *const all_values[] = {"off", "fsr3", "dlss"};
|
||||
const char *all_names[] = {menu_text(UI_MENU_FRAMEGEN_OFF), "AMD FSR 3.1", "NVIDIA DLSS"};
|
||||
const char *values[3], *names[3];
|
||||
int n = 0, at = 0;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if ((i == 1 && !fsr && cur != 1) || (i == 2 && !dlss && cur != 2)) continue;
|
||||
if (i == cur) at = n;
|
||||
values[n] = all_values[i], names[n++] = all_names[i];
|
||||
}
|
||||
// AMD's follows the setting; NVIDIA's is set up with the device, so only a change to or from it waits for a restart.
|
||||
// Through NGX it follows the setting too, once NGX is up, which needs DLSS upscaling on when the game starts.
|
||||
const bool ngx = framegen_ngx();
|
||||
const bool restart = ngx ? dlss && cur == 2 && !vk_ngxfg_wanted() : dlss && (cur == 2) != (vk_dlssg_wanted() != 0);
|
||||
if (restart) note = UI_MENU_AFTER_RESTART;
|
||||
else if (cur == 1 && !fsr) note = UI_MENU_FSR3_OFF; // set where it cannot load: "in use: off" and why
|
||||
// NVIDIA's set since the start but not running: "in use: off" and why (vk_dlssg_status; the log has the details).
|
||||
// Through NGX that is NVIDIA's frame generation library missing beside the game, or a GPU it does not run on.
|
||||
const int st = cur != 2 || restart ? DLSSG_RUNS : ngx ? (vk_ngxfg_max() ? DLSSG_RUNS : DLSSG_NO_FILES) : vk_dlssg_status();
|
||||
if (st == DLSSG_NO_GPU) note = UI_MENU_FRAMEGEN_OFF_GPU;
|
||||
else if (st == DLSSG_NO_FILES) note = UI_MENU_FRAMEGEN_OFF_FILES;
|
||||
int nv = opt_choice_index("NX2NAVI_FRAMEGEN", UI_MENU_FRAMEGEN, names, n, cur, 0,
|
||||
dlss ? UI_MENU_FRAMEGEN_DESC : UI_MENU_FRAMEGEN_DESC_FSR, menu_text(note));
|
||||
int nv = opt_choice_index("NX2NAVI_FRAMEGEN", UI_MENU_FRAMEGEN, names, n, at, 0, desc, menu_text(note));
|
||||
if (nv >= 0 && nv < n) opt_apply("NX2NAVI_FRAMEGEN", values[nv]);
|
||||
else if (cur == 2 && upscaled && dlss && ngx) row_framegen_mult_ngx();
|
||||
else if (cur == 2 && upscaled && dlss) row_framegen_mult(restart);
|
||||
}
|
||||
|
||||
@@ -994,7 +1054,7 @@ static void tab_screen(float scale) {
|
||||
row_hdr();
|
||||
// The sharpening runs under FSR 1 (vk_fsr.c vk_fsr_record, RCAS) and FSR 3.1 (vk_ffx.cpp, its own RCAS); with
|
||||
// bilinear or DLSS the slider would do nothing
|
||||
int dl = cfg_bool("NX2NAVI_DLAA"), fsr3 = dl && !strcmp(cfg_value("NX2NAVI_TAA"), "fsr3");
|
||||
int dl = cfg_bool("NX2NAVI_DLAA"), fsr3 = dl && !strcmp(cfg_value("NX2NAVI_TAA"), "fsr3") && vk_ffx_available();
|
||||
if (!fsr3 && (strcmp(cfg_value("NX2NAVI_UPSCALER"), "fsr") || dl)) opt_disable_next(UI_MENU_SHARPNESS_NEEDS_FSR);
|
||||
opt_slider("NX2NAVI_SHARPNESS", UI_MENU_SHARPNESS, 0, 100, UI_MENU_SHARPNESS_DESC, 5, "%.0f %%");
|
||||
// Anisotropic filtering of the surface textures that tile (vk_texture.c aniso_raised), at once (vk_sampler_aniso_live)
|
||||
@@ -1256,12 +1316,12 @@ static void tab_controls(float scale) {
|
||||
static const UiTextId layout[] = {UI_MENU_PAD_LAYOUT_AUTO, UI_MENU_PAD_LAYOUT_NINTENDO, UI_MENU_PAD_LAYOUT_XBOX,
|
||||
UI_MENU_PAD_LAYOUT_PLAYSTATION};
|
||||
opt_choice("NX2NAVI_PAD_LAYOUT", UI_MENU_PAD_LAYOUT, layout, 4, UI_MENU_PAD_LAYOUT_DESC, pad_layout_note());
|
||||
// The setting's values in their cfg.c order (nintendo, xbox, playstation, pc). The game reads its prompts at start:
|
||||
// the row's note says when a restart would bring others, and the bar's Restart button does it.
|
||||
// The setting's values in their cfg.c order (nintendo, xbox, playstation, steamdeck, pc). The game reads its prompts
|
||||
// at start: the row's note says when a restart would bring others, and the bar's Restart button does it.
|
||||
static const UiTextId prompts[] = {UI_MENU_PROMPTS_NINTENDO, UI_MENU_PROMPTS_XBOX, UI_MENU_PROMPTS_PLAYSTATION,
|
||||
UI_MENU_PROMPTS_PC};
|
||||
UI_MENU_PROMPTS_STEAMDECK, UI_MENU_PROMPTS_PC};
|
||||
bool restart;
|
||||
opt_choice("NX2NAVI_PROMPTS", UI_MENU_PROMPTS, prompts, 4, UI_MENU_PROMPTS_DESC, prompts_note(&restart));
|
||||
opt_choice("NX2NAVI_PROMPTS", UI_MENU_PROMPTS, prompts, 5, UI_MENU_PROMPTS_DESC, prompts_note(&restart));
|
||||
opt_toggle("NX2NAVI_MOTION", UI_MENU_MOTION, UI_MENU_MOTION_DESC);
|
||||
opt_slider("NX2NAVI_RUMBLE_STRENGTH", UI_MENU_RUMBLE_STRENGTH, 0, 300, UI_MENU_RUMBLE_STRENGTH_DESC, 10, "%.0f %%");
|
||||
opt_slider("NX2NAVI_RUMBLE_CURVE", UI_MENU_RUMBLE_CURVE, 0.2f, 1.5f, UI_MENU_RUMBLE_CURVE_DESC, 0.05f, "%.2f");
|
||||
@@ -1545,7 +1605,8 @@ static void perf_picture(const MenuTarget *t, PerfPanel *p) {
|
||||
const char *hdr = cfg_value("NX2NAVI_HDR");
|
||||
snprintf(v[8], sizeof v[8], "%s", menu_text(!strcmp(hdr, "native") ? UI_MENU_HDR_NATIVE : cfg_bool("NX2NAVI_HDR") ? UI_MENU_HDR_TONEMAPPED : UI_MENU_FRAMEGEN_OFF));
|
||||
const char *fg = cfg_value("NX2NAVI_FRAMEGEN");
|
||||
snprintf(v[9], sizeof v[9], "%s", !strcmp(fg, "fsr3") ? "AMD FSR 3.1" : !strcmp(fg, "dlss") ? "NVIDIA DLSS" : menu_text(UI_MENU_FRAMEGEN_OFF));
|
||||
const bool fsr_fg = !strcmp(fg, "fsr3") && vk_ffx_framegen_available(); // set but not loadable: off
|
||||
snprintf(v[9], sizeof v[9], "%s", fsr_fg ? "AMD FSR 3.1" : !strcmp(fg, "dlss") ? "NVIDIA DLSS" : menu_text(UI_MENU_FRAMEGEN_OFF));
|
||||
if (!strcmp(fg, "dlss") && vk_dlssg_active()) // its multiplier as set, clamped to what this GPU allows
|
||||
snprintf(v[9], sizeof v[9], "NVIDIA DLSS %dx",
|
||||
vk_dlssg_multiplier_of(cfg_value("NX2NAVI_FRAMEGEN_MULTIPLIER"), vk_dlssg_multiplier_max(nullptr), nullptr));
|
||||
|
||||
Reference in New Issue
Block a user