mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
Every report adds a line for video memory outside VMA (the driver's usage and budget per heap against VMA's blocks, and counts of pipelines by kind and by last use, stage libraries, compute pipelines, layouts and descriptor pools, with the swapchain, DLSS and FSR sizes), a line that splits the process's commit by owner (the game's heap and maps, device-local memory, VMA's host blocks, the C runtime heap with the shader caches, pipeline tables, texture cache, log queue and flight recorder in it, the driver's pipeline cache data and the rest), and a line naming what grew by more than 64 MiB since the report before and since play began. Every ten minutes of play and at exit a ranking line orders the categories by growth and marks those that only climbed; tests/mem_growth_check.py checks that bookkeeping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
4.0 KiB
C
52 lines
4.0 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 (live), where FSR 3.1 loads, with any upscaler or none
|
|
uint32_t vk_fg_queue_count(void); // graphics-family queues the device creates
|
|
// vk_device.c, after the device exists: the queues AMD's swapchain presents and acquires on, and their families (the
|
|
// graphics family's own where it has three queues, else queues of another family: AMD's Windows driver gives one)
|
|
void vk_fg_queues(VkQueue present, uint32_t present_family, VkQueue acquire, uint32_t acquire_family);
|
|
int vk_fg_has_queues(void); // vk_fg_queues got a present queue: frame generation can run here
|
|
int vk_fg_active(void); // the frame generation swapchain exists
|
|
int vk_fg_generating(void); // ... and the last frame had generation on (not paused for the menu)
|
|
// 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.
|
|
// pic: the picture's rectangle in the swapchain {x, y, w, h} (black bars around it when the window has another shape);
|
|
// frames are generated inside it only.
|
|
void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt, VkExtent2D ext, VkImage hudless, VkImageView hudless_view,
|
|
const int pic[4]);
|
|
uint64_t vk_fg_presents(VkSwapchainKHR sc); // frames the swapchain presented, generated ones included (0: off)
|
|
PFN_vkSetHdrMetadataEXT vk_fg_hdr_metadata_fn(void); // AMD's replacement for vkSetHdrMetadataEXT while active, else NULL
|
|
void vk_fg_release(void);
|
|
uint64_t vk_fg_vram(void); // the frame generation context's video memory, FSR 3.1's or FSR 4's; 0 none or not told
|
|
|
|
// The same through AMD's FSR SDK 2.4 (vk_fg4.cpp), for vk_fg.cpp alone: it takes this path while FSR 4 is the upscaler,
|
|
// and every call above goes to these while this path holds the swapchain.
|
|
int vk_fg4_available(void); // its libraries are beside the executable and list a frame generation for the device
|
|
int vk_fg4_failed(void); // it failed in this run: FSR 3.1's library generates the frames
|
|
const char *vk_fg4_name(void); // the frame generation version the loader lists first for the device ("3.1.6"), "" unknown
|
|
int vk_fg4_active(void);
|
|
int vk_fg4_generating(void);
|
|
void vk_fg4_queues(VkQueue present, uint32_t present_family, VkQueue acquire, uint32_t acquire_family);
|
|
VkResult vk_fg4_create_swapchain(const VkSwapchainCreateInfoKHR *ci, VkSwapchainKHR *sc);
|
|
void vk_fg4_destroy_swapchain(VkSwapchainKHR sc);
|
|
VkResult vk_fg4_get_images(VkSwapchainKHR sc, uint32_t *n, VkImage *img);
|
|
VkResult vk_fg4_acquire(VkSwapchainKHR sc, uint64_t timeout, VkSemaphore sem, uint32_t *idx);
|
|
VkResult vk_fg4_present(const VkPresentInfoKHR *pi);
|
|
void vk_fg4_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt, VkExtent2D ext, VkImage hudless, const int pic[4]);
|
|
uint64_t vk_fg4_presents(VkSwapchainKHR sc);
|
|
PFN_vkSetHdrMetadataEXT vk_fg4_hdr_metadata_fn(void);
|
|
void vk_fg4_release(void);
|
|
uint64_t vk_fg4_vram(void);
|