mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 21:09:57 -04:00
Say a restart is needed only when one is, and drop the line under Preparing shaders.
The Upscaling row no longer carries "DLSS on or off: after restart". It shows "after restart" only while the upscaler picked cannot start in this run. Frame generation says so only for a change to or from NVIDIA's, since AMD's applies at once, and the HDR row no longer says it twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,8 @@ int wide_available(void);
|
||||
const char *const *vk_color_preset(const char *name);
|
||||
int vk_hdr_wanted(void);
|
||||
int vk_hdr_active(void);
|
||||
int vk_dlaa_needs_restart(void);
|
||||
int vk_dlssg_wanted(void);
|
||||
double frame_step_limit_hz(void);
|
||||
int frame_limit_adjustable(void);
|
||||
int rtss_limit_state(void);
|
||||
@@ -828,10 +830,9 @@ static void row_upscaling(void) {
|
||||
int cur = 0;
|
||||
for (int i = 0; i < n; i++)
|
||||
if (list[i].kind == now.kind && list[i].mode == now.mode) cur = i;
|
||||
bool temporal = now.kind >= DLSS;
|
||||
int nv = opt_choice_index("NX2NAVI_UPSCALER", UI_MENU_UPSCALING, names, n, cur, 1,
|
||||
dlss ? UI_MENU_UPSCALING_DESC : UI_MENU_UPSCALING_DESC_FSR,
|
||||
temporal && dlss ? menu_text(UI_MENU_UPSCALING_DLSS_NOTE) : nullptr);
|
||||
dlss && vk_dlaa_needs_restart() ? menu_text(UI_MENU_AFTER_RESTART) : nullptr);
|
||||
if (nv < 0 || nv >= n) return;
|
||||
const Entry e = list[nv];
|
||||
opt_apply("NX2NAVI_UPSCALER", e.kind == FSR1 ? "fsr" : "bilinear");
|
||||
@@ -842,10 +843,9 @@ static void row_upscaling(void) {
|
||||
}
|
||||
|
||||
// "in use: off" under the HDR value when the game started with HDR on but the swapchain is not HDR10 (the display or
|
||||
// Windows' HDR switch is off, vk_hdr_surface_format); else the restart note.
|
||||
// Windows' HDR switch is off, vk_hdr_surface_format). The row's "after restart" comes from the setting itself (cfg.c).
|
||||
static const char *hdr_note(void) {
|
||||
const char *restart = menu_text(UI_MENU_HDR_NOTE);
|
||||
if (!vk_hdr_wanted() || vk_hdr_active() || !*gfx_window_present_mode() || !cfg_bool("NX2NAVI_HDR")) return restart;
|
||||
if (!vk_hdr_wanted() || vk_hdr_active() || !*gfx_window_present_mode() || !cfg_bool("NX2NAVI_HDR")) return nullptr;
|
||||
static char note[96];
|
||||
snprintf(note, sizeof note, menu_text(UI_MENU_PRESENT_IN_USE), menu_text(UI_MENU_FRAMEGEN_OFF));
|
||||
return note;
|
||||
@@ -877,9 +877,11 @@ static void row_framegen(void) {
|
||||
// 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);
|
||||
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(dlss ? UI_MENU_FRAMEGEN_NOTE : UI_MENU_FRAMEGEN_NOTE_FSR));
|
||||
menu_text(restart ? UI_MENU_AFTER_RESTART : dlss ? UI_MENU_FRAMEGEN_NOTE : UI_MENU_FRAMEGEN_NOTE_FSR));
|
||||
if (nv >= 0 && nv < n) opt_apply("NX2NAVI_FRAMEGEN", values[nv]);
|
||||
}
|
||||
|
||||
@@ -1516,8 +1518,8 @@ extern "C" void menu_boot_set(int phase, long long done, long long total) {
|
||||
g_boot_phase.store(phase, std::memory_order_release);
|
||||
}
|
||||
|
||||
// A box in the middle of the screen in the menu's look (ui/menu_skin.cpp skin_boot_panel): the title, the step with its
|
||||
// count and a bar, and why it happens. The input queue is left alone: keys pressed now reach the menu once the game runs.
|
||||
// A box in the middle of the screen in the menu's look (ui/menu_skin.cpp skin_boot_panel): the title and the step with
|
||||
// its count and a bar. The input queue is left alone: keys pressed now reach the menu once the game runs.
|
||||
extern "C" int menu_boot_frame(const MenuTarget *t) {
|
||||
if (g_failed_flag() || g_boot_phase.load(std::memory_order_acquire) < 0) return 0; // -1: done, a black frame
|
||||
if (!g_ctx_ok) make_context();
|
||||
@@ -1550,7 +1552,7 @@ extern "C" int menu_boot_frame(const MenuTarget *t) {
|
||||
snprintf(step, sizeof step, ui_text(phase == 1 ? UI_BOOT_SHADERS : UI_BOOT_PIPELINES), done, total);
|
||||
else
|
||||
snprintf(step, sizeof step, "%s", ui_text(UI_BOOT_STARTING));
|
||||
const char *title = ui_text(UI_BOOT_TITLE), *hint = ui_text(UI_BOOT_HINT);
|
||||
const char *title = ui_text(UI_BOOT_TITLE);
|
||||
|
||||
// the box in the menu's look (ui/menu_skin.cpp): a filled bar while there is a count, else a sweeping segment
|
||||
ImFont *body = ImGui::GetFont();
|
||||
@@ -1560,7 +1562,7 @@ extern "C" int menu_boot_frame(const MenuTarget *t) {
|
||||
float frac = -1;
|
||||
if ((phase == 1 || phase == 2) && total > 0) frac = done <= 0 ? 0 : done >= total ? 1 : (float)done / (float)total;
|
||||
float s = (float)fmod((now - g_boot_t0) / 1e9 * 0.8, 2.0);
|
||||
skin_boot_panel(ImGui::GetForegroundDrawList(), head, head_px, body, body_px, title, step, hint, frac, s < 1 ? s : 2 - s,
|
||||
skin_boot_panel(ImGui::GetForegroundDrawList(), head, head_px, body, body_px, title, step, frac, s < 1 ? s : 2 - s,
|
||||
(float)t->width, (float)t->height, scale);
|
||||
ImGui::Render();
|
||||
return ImGui::GetDrawData()->TotalVtxCount > 0;
|
||||
|
||||
@@ -461,12 +461,11 @@ bool skin_tab_item(const char *id, const char *text, int flags, float s, ImFont
|
||||
}
|
||||
|
||||
void skin_boot_panel(ImDrawList *dl, ImFont *head, float head_px, ImFont *body, float body_px, const char *title,
|
||||
const char *step, const char *hint, float frac, float sweep, float w, float h, float s) {
|
||||
const char *step, float frac, float sweep, float w, float h, float s) {
|
||||
const float pad = 38 * s, gap = 16 * s, bar_h = 12 * s, fh = skin_filigree_height(s);
|
||||
ImVec2 ts = head->CalcTextSizeA(head_px, FLT_MAX, 0, title), ss = body->CalcTextSizeA(body_px, FLT_MAX, 0, step),
|
||||
hs = body->CalcTextSizeA(body_px * 0.8f, FLT_MAX, 0, hint);
|
||||
float pw = fminf(fmaxf(fmaxf(fmaxf(ts.x, hs.x), ss.x), 560 * s) + pad * 2, w - 24 * s);
|
||||
float ph = pad + ts.y + fh + gap * 0.4f + ss.y + gap * 0.7f + bar_h + gap * 1.4f + hs.y + pad;
|
||||
ImVec2 ts = head->CalcTextSizeA(head_px, FLT_MAX, 0, title), ss = body->CalcTextSizeA(body_px, FLT_MAX, 0, step);
|
||||
float pw = fminf(fmaxf(fmaxf(ts.x, ss.x), 560 * s) + pad * 2, w - 24 * s);
|
||||
float ph = pad + ts.y + fh + gap * 0.4f + ss.y + gap * 0.7f + bar_h + pad;
|
||||
ImVec2 a(floorf((w - pw) / 2), floorf((h - ph) / 2)), b(a.x + pw, a.y + ph);
|
||||
skin_panel(dl, a, b, s);
|
||||
float y = a.y + pad;
|
||||
@@ -493,6 +492,4 @@ void skin_boot_panel(ImDrawList *dl, ImFont *head, float head_px, ImFont *body,
|
||||
fill(x0 + run * at, x0 + run * at + span);
|
||||
}
|
||||
dl->AddRect(ba, bb, rgba(110, 90, 58, 1), 2 * s, 0, 1.3f * s);
|
||||
y += bar_h + gap * 1.4f;
|
||||
dl->AddText(body, body_px * 0.8f, ImVec2(floorf((w - hs.x) / 2), y), rgba(214, 198, 166, 0.85f), hint);
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ void skin_panel(ImDrawList *dl, ImVec2 a, ImVec2 b, float s, float alpha = 1);
|
||||
|
||||
// The boot screen's box (menu.cpp menu_boot_frame) centred in a w x h frame: the panel, the title in gold over the
|
||||
// divider, the step's line, a bar filled to frac (0..1; a negative frac: a short segment sweeping at position sweep
|
||||
// 0..1, no count yet) and the hint under it.
|
||||
// 0..1, no count yet).
|
||||
void skin_boot_panel(ImDrawList *dl, ImFont *head, float head_px, ImFont *body, float body_px, const char *title,
|
||||
const char *step, const char *hint, float frac, float sweep, float w, float h, float s);
|
||||
const char *step, float frac, float sweep, float w, float h, float s);
|
||||
|
||||
// A button widget drawn as skin_button with its label centred and skin_cursor round it while selected or hovered (the
|
||||
// save menu's Load and Cancel). True when pressed (click, A, Enter). size: as for ImGui::Button.
|
||||
|
||||
Reference in New Issue
Block a user