diff --git a/runtime/ui/menu.cpp b/runtime/ui/menu.cpp index 68855d76..312612c7 100644 --- a/runtime/ui/menu.cpp +++ b/runtime/ui/menu.cpp @@ -748,6 +748,12 @@ static void tab_screen(float scale) { opt_slider("NX2NAVI_SHARPNESS", UI_MENU_SHARPNESS, 0, 100, UI_MENU_SHARPNESS_DESC, 5, "%.0f %%"); static const UiTextId aspect[] = {UI_MENU_ASPECT_FIT, UI_MENU_ASPECT_STRETCH}; opt_choice("NX2NAVI_ASPECT", UI_MENU_ASPECT, aspect, 2, UI_MENU_ASPECT_DESC); + // DLSS at the game's own resolution (vk_dlaa.c). This build cannot change the scene size (no scene patch set), so + // the quality modes would all render the same: there is no mode row, only the switch and the model. + opt_toggle("NX2NAVI_DLAA", UI_MENU_DLAA, UI_MENU_DLAA_GAME_DESC); + static const UiTextId preset[] = {UI_MENU_DLSS_PRESET_DEFAULT, UI_MENU_DLSS_PRESET_K, UI_MENU_DLSS_PRESET_J}; + if (!cfg_bool("NX2NAVI_DLAA")) opt_disable_next(UI_MENU_DLSS_PRESET_NEEDS_DLAA); + opt_choice("NX2NAVI_DLSS_PRESET", UI_MENU_DLSS_PRESET, preset, 3, UI_MENU_DLSS_PRESET_DESC); opt_end(); } diff --git a/runtime/ui_text.c b/runtime/ui_text.c index c7e7bf92..d1c10bf9 100644 --- a/runtime/ui_text.c +++ b/runtime/ui_text.c @@ -502,6 +502,11 @@ static const char *const text_en[UI_TEXT_COUNT] = { [UI_MENU_CHEAT_UNSUPPORTED_DESC] = "This cheat cannot be used with this version of the game:", [UI_BOOT_TITLE] = "Preparing shaders", [UI_BOOT_HINT] = "This happens once after an update or a graphics driver change.", [UI_BOOT_STARTING] = "Starting", [UI_BOOT_SHADERS] = "Shaders: %lld of %lld", [UI_BOOT_PIPELINES] = "Pipelines: %lld of %lld", + [UI_MENU_DLAA_GAME_DESC] = "NVIDIA DLSS anti-aliasing for the 3D scene at the game's own resolution (NVIDIA RTX GPUs; " + DLSS_FILE " next to the game's .exe). The HUD is not touched. Early version: it works on " + "each frame on its own for now, without the motion history that makes DLSS sharpest. " + "Takes effect after a restart.", + [UI_MENU_DLSS_PRESET_NEEDS_DLAA] = "only with DLSS on", [UI_MENU_CHEATS_REBUILD] = "Rebuild the game now", [UI_MENU_CHEATS_REBUILD_DESC] = "Some cheats change the game's code and are not built into it: they are new or " "edited, or their last rebuild failed or was cancelled. Closes the game; the setup " diff --git a/runtime/ui_text.h b/runtime/ui_text.h index 71836c5b..53150189 100644 --- a/runtime/ui_text.h +++ b/runtime/ui_text.h @@ -241,6 +241,8 @@ typedef enum { // the boot screen while the boot prewarm prepares shaders and pipelines (boot.c, ui/menu.cpp menu_boot_frame) UI_BOOT_TITLE, UI_BOOT_HINT, UI_BOOT_STARTING, UI_BOOT_SHADERS, UI_BOOT_PIPELINES, // printf: "%lld" done, "%lld" total + // the settings menu's DLSS row for this game (ui/menu.cpp tab_screen): DLSS at the game's own resolution + UI_MENU_DLAA_GAME_DESC, UI_MENU_DLSS_PRESET_NEEDS_DLAA, UI_TEXT_COUNT } UiTextId; diff --git a/tools/make_game.py b/tools/make_game.py index ce45bba9..967a8bfc 100644 --- a/tools/make_game.py +++ b/tools/make_game.py @@ -343,8 +343,11 @@ def step_compile(out, cache, msys, jobs): def cc(job): src, dst = job cpp = src.suffix in ('.cpp', '.cxx') - cmd = [str(clangxx if cpp else clang), '-c', '-std=gnu++17' if cpp else '-std=gnu11', '-O1', '-w', *inc, - '-o', str(dst), str(src)] + # the lifted code at -O1 (its size makes -O2 slow to build), the runtime at -O2; neither may assume strict aliasing: + # the lifted code reaches guest memory through casts of one address to several types (tools/build_game.py's flags) + guest = dst.name.startswith(('main_', 'sdk_', 'subsdk0_')) + cmd = [str(clangxx if cpp else clang), '-c', '-std=gnu++17' if cpp else '-std=gnu11', '-O1' if guest else '-O2', + '-fno-strict-aliasing', '-w', *inc, '-o', str(dst), str(src)] p = subprocess.run(cmd, capture_output=True, text=True, env=env) return src, p.returncode, p.stderr[-1500:]