mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
In-game mods (GameBanana browser, search and installs, with the Mask Salesman), code-patch and cheat mods, the devs' test18 to test45 work (full performance overlay, frame pacing on, steady frame rate, save export and import, bug capture, new options rows, Setup's Mods page and Add to Steam), occlusion queries and new defaults, Auto resolution that scales, replay helper threads and robust buffers off by default, the options in sections.
44 lines
2.5 KiB
C++
44 lines
2.5 KiB
C++
// NVIDIA Reflex through VK_NV_low_latency2 (vk_reflex.cpp): the driver paces the game's frames so that the CPU starts one
|
|
// as late as it can and the frame waits less in the queue, for less delay from input to the screen.
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "vk_internal.h"
|
|
|
|
namespace mkwvk {
|
|
|
|
/// The extensions it needs (VK_NV_low_latency2, VK_KHR_present_id), added to `want` when the device has them
|
|
void reflex_device_extensions(std::vector<const char*>& want, const std::vector<VkExtensionProperties>& all);
|
|
/// Its feature (presentId) into the device's feature chain (*tail), before the features are queried
|
|
void reflex_device_features(void**& tail);
|
|
/// After the device is made: whether Reflex can run (the feature there), its functions loaded
|
|
void reflex_device_created();
|
|
/// Reflex can run on this device (VK_NV_low_latency2 and its functions): the Insert menu's row offers it only then
|
|
bool reflex_available();
|
|
/// Into a swapchain's creation: latency mode on while the row is on, nothing while it is off (the chained struct lives until
|
|
/// the next call)
|
|
void reflex_swapchain_info(VkSwapchainCreateInfoKHR& ci);
|
|
/// The row was turned on or off since the swapchain was made: it is to be made again (present_image)
|
|
bool reflex_swapchain_stale();
|
|
/// A swapchain made: its sleep mode set as the menu has it
|
|
void reflex_swapchain_created(VkSwapchainKHR swapchain);
|
|
/// Before destroying the current swapchain, including a failed replacement: stop using it for latency calls
|
|
void reflex_swapchain_destroyed();
|
|
/// The frame's markers, at the game's present: its simulation ended and its rendering's submission starts
|
|
void reflex_present_begins();
|
|
/// Before the present's submit: the rendering's submission ended
|
|
void reflex_submit_ends();
|
|
/// The present: a VkPresentIdKHR for VkPresentInfoKHR's pNext (or null), and the present's start marker
|
|
const void* reflex_present_id(const void* next);
|
|
void reflex_presented();
|
|
/// After the present: the driver's sleep until the next frame should start, then that frame's start markers (left out while
|
|
/// the game's thread takes it where its frame starts: reflex_pace)
|
|
void reflex_sleep();
|
|
/// (Triforce, RX_VK_REFLEX_LIMIT=1) Where the game's frame starts (vk_pace.cpp frame_start), without DLSS frame generation:
|
|
/// true when Reflex's sleep holds this frame to the Game frame rate cap's period (period_ns; 0: none it may hold), taken
|
|
/// here; false, always without the switch: the game's own wait holds it
|
|
bool reflex_pace(int64_t period_ns);
|
|
|
|
} // namespace mkwvk
|