mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 07:09:57 -04:00
Hold the frame limit on screen while FSR 3.1 frame generation runs.
Frame generation presents a generated frame between each two of the game's, so a limit of 60 showed 120. While generation is on (not paused for the menu or for want of depth and motion), the game is paced at half the limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,7 @@ struct {
|
||||
uint64_t frame = 0;
|
||||
int failed = 0;
|
||||
uint64_t generated = 0, paused = 0, no_inputs = 0, hudless = 0;
|
||||
int on = 0; // the last configured frame had generation on (vk_fg_generating)
|
||||
} F;
|
||||
|
||||
VkResult submit_game(uint32_t n, const VkSubmitInfo *si, VkFence fence) {
|
||||
@@ -93,6 +94,8 @@ extern "C" void vk_fg_queues(VkQueue present, VkQueue acquire) { F.present = pre
|
||||
|
||||
extern "C" int vk_fg_active(void) { return F.sc != nullptr && !F.failed; }
|
||||
|
||||
extern "C" int vk_fg_generating(void) { return vk_fg_active() && __atomic_load_n(&F.on, __ATOMIC_RELAXED); }
|
||||
|
||||
extern "C" VkResult vk_fg_create_swapchain(const VkSwapchainCreateInfoKHR *ci, VkSwapchainKHR *sc) {
|
||||
if (F.sc) return F.fn.pOutCreateSwapchainFFXAPI(vk_ctx()->device, ci, nullptr, sc, F.sc);
|
||||
if (!vk_fg_wanted() || F.failed || !F.present || !vk_ffx_load()) return VK_ERROR_FEATURE_NOT_PRESENT;
|
||||
@@ -195,6 +198,7 @@ extern "C" void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt,
|
||||
int reset = 0;
|
||||
int have = vk_dlaa_fg_inputs(&depth, &mv, &jx, &jy, &reset);
|
||||
int on = have && !menu_is_open();
|
||||
__atomic_store_n(&F.on, on, __ATOMIC_RELAXED);
|
||||
if (!have) F.no_inputs++;
|
||||
else if (!on) F.paused++;
|
||||
F.frame++;
|
||||
|
||||
Reference in New Issue
Block a user