Raise the frame rate in Kokiri Forest and apply more settings during a run.

The foliage's sun shadows took most of the GPU time: one mesh draw shaded about 1,000 million fragments in the far cascade. The far cascade now shades them at a 2x2 rate, and the two far cascades drop one side of the double-sided cards. At the forest entrance the frame rate went from 18 to about 43 fps on an RX 7900 XT.

FSR 3.1, its frame generation and the console mode now take effect without a restart. The full performance overlay lists the settings shown in the options menu.

NX2NAVI_GPU_PASSES times each pass and counts its fragments, and NX2NAVI_SET_AT changes settings at a given frame for test runs. Both are off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
epicmeme546
2026-11-09 02:40:51 -05:00
parent 5b37fb5986
commit 754ded99e0
26 changed files with 438 additions and 102 deletions

View File

@@ -33,7 +33,6 @@ extern "C" {
namespace {
struct {
int wanted = -1;
VkQueue present = VK_NULL_HANDLE, acquire = VK_NULL_HANDLE;
ffxContext sc = nullptr; // the swapchain context
ffxContext fg = nullptr; // the frame generation context
@@ -78,18 +77,14 @@ void fail(const char *what, unsigned r) {
} // namespace
// Follows the setting: gfx_present.c's window_settings_live remakes the swapchain when this stops matching vk_fg_active.
// It needs DLSS's or FSR 3.1's motion vectors, so it also needs one of them on.
extern "C" int vk_fg_wanted(void) {
if (F.wanted < 0) {
F.wanted = !strcmp(cfg_value("NX2NAVI_FRAMEGEN"), "fsr3");
if (F.wanted && !vk_dlaa_wanted()) {
rt_log("fg: frame generation needs DLSS or FSR 3.1 upscaling (any mode): off");
F.wanted = 0;
}
}
return F.wanted;
return !strcmp(cfg_value("NX2NAVI_FRAMEGEN"), "fsr3") && cfg_bool("NX2NAVI_DLAA") && vk_dlaa_wanted();
}
extern "C" uint32_t vk_fg_queue_count(void) { return vk_fg_wanted() ? 3 : 1; }
// Always the three queues: the setting can be switched on during a run, and idle queues cost nothing.
extern "C" uint32_t vk_fg_queue_count(void) { return 3; }
extern "C" void vk_fg_queues(VkQueue present, VkQueue acquire) { F.present = present, F.acquire = acquire; }
@@ -268,4 +263,5 @@ extern "C" void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt,
extern "C" void vk_fg_release(void) {
if (F.fg) vk_ffx_destroy(&F.fg), F.fg = nullptr;
if (F.sc) vk_ffx_destroy(&F.sc), F.sc = nullptr;
__atomic_store_n(&F.on, 0, __ATOMIC_RELAXED);
}