mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 23:39:57 -04:00
Frame generation now gets the picture without the HUD each frame: the upscaler's output before the HUD is drawn over it, encoded to sRGB as the game's last pass encodes its picture and put through the same colour, scaling and borders as the presented frame, so it tells the HUD apart and leaves it unwarped in the generated frames (NX2NAVI_FG_HUDLESS_SHOW=1 shows that picture, a test). The performance overlay gains an FG row and the fps line the display's rate, generated frames included. The device enables VK_KHR_get_memory_requirements2 whenever AMD's frame generation is on, which crashed at start with DLSS upscaling. DLSS Frame Generation through NVIDIA Streamline (vk_dlssg.c, and nx2navi_dlssg.dll from runtime/dlssg, built with MSVC by tools/build_dlssg.py against the SDK kept outside the repository) creates the instance and device through Streamline's proxies and calls its swapchain hooks; Streamline still fails in its plugin start-up here, so the menu lists it only while it is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.8 KiB
C
24 lines
1.8 KiB
C
// Frame generation with AMD FSR 3.1 (vk_fg.cpp): AMD's frame generation swapchain in gfx_present.c's place.
|
|
#pragma once
|
|
#include <stdint.h>
|
|
#include <vulkan/vulkan.h>
|
|
|
|
int vk_fg_wanted(void); // NX2NAVI_FRAMEGEN = fsr3 with DLSS or FSR 3.1 upscaling on (read once)
|
|
uint32_t vk_fg_queue_count(void); // graphics-family queues the device creates: 3 with frame generation, else 1
|
|
void vk_fg_queues(VkQueue present, VkQueue acquire); // vk_device.c, after the device exists
|
|
int vk_fg_active(void); // the frame generation swapchain exists
|
|
// gfx_present.c's swapchain calls while vk_fg_wanted: the first create makes AMD's swapchain context, later ones
|
|
// (window resizes) its swapchain again. Non-success from the first: the plain swapchain path stays.
|
|
VkResult vk_fg_create_swapchain(const VkSwapchainCreateInfoKHR *ci, VkSwapchainKHR *sc);
|
|
void vk_fg_destroy_swapchain(VkSwapchainKHR sc);
|
|
VkResult vk_fg_get_images(VkSwapchainKHR sc, uint32_t *n, VkImage *img);
|
|
VkResult vk_fg_acquire(VkSwapchainKHR sc, uint64_t timeout, VkSemaphore sem, uint32_t *idx);
|
|
VkResult vk_fg_present(const VkPresentInfoKHR *pi); // on the game's queue, its lock held by the caller
|
|
// Each present, before its command buffer is submitted: configures generation for this frame and records its
|
|
// preparation (the frame's depth and motion vectors, vk_dlaa_fg_inputs) into cb.
|
|
// hudless: this frame's picture without the HUD at the swapchain's size and format, in GENERAL (VK_NULL_HANDLE: none),
|
|
// from which generation tells the HUD apart and keeps it out of the generated frames.
|
|
void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt, VkExtent2D ext, VkImage hudless, VkImageView hudless_view);
|
|
uint64_t vk_fg_presents(VkSwapchainKHR sc); // frames the swapchain presented, generated ones included (0: off)
|
|
void vk_fg_release(void);
|