Implement Native NVIDIA Reflex Low Latency (VK_NV_low_latency2)

- Enable VK_NV_low_latency2 and VK_KHR_present_id with present ID features
- Add VkSwapchainLatencyCreateInfoNV to swapchain creation
- Link present and submission IDs with standard Vulkan latency types
- Insert latency markers: simulation start/end, input sample, render submit, and present
- Gate all extensions and latency chains on reflex != off (RESTART setting)
- Log graceful notice when Reflex is requested on unsupported hardware
- Add UI menu setting and translations for en, ru, pt-BR, zh-Hans
- Document reflex setting in totk.ini.example and docs/settings.md
This commit is contained in:
Tears of the SteelTemple authored and itaskaev2 committed 2026-11-10 18:20:16 +01:00
1 parent 7a37fc3c34
commit 3209ea4358
12 files changed
+196 -9

No files matched your search

+6
View File
@@ -19,6 +19,9 @@
#include "nvn_tex.h"
#include "platform/platform.h"
void vk_reflex_marker(int marker);
void vk_reflex_sleep(void);
// ---------- Descriptor pools
// NVNboolean nvnTexturePoolInitialize(NVNtexturePool *tp, const NVNmemoryPool *p, ptrdiff_t offset, int n)
NVN_API(nvnTexturePoolInitialize) {
@@ -687,6 +690,8 @@ NVN_API(nvnWindowAcquireTexture) {
sleep_until(at);
perf_end(PERF_PACE, p0);
}
vk_reflex_sleep();
vk_reflex_marker(0); // VK_LATENCY_MARKER_SIMULATION_START_NV
// The sync means "the display no longer reads this image". Presents are copies queued in submit order, so it is
// already satisfied: fenced = 3 with fence 0.
if (s) {
@@ -710,6 +715,7 @@ NVN_API(nvnQueuePresentTexture) {
if (o->magic != NVN_WIN_MAGIC || idx < 0 || idx >= o->ntex || idx >= 4 || !o->tex[idx])
rt_fatal("nvn: QueuePresentTexture of image %d on window %p", idx, (void *)o);
o->presents++;
vk_reflex_marker(1); // VK_LATENCY_MARKER_SIMULATION_END_NV
const tex_t *t = (const tex_t *)o->tex[idx];
uint64_t period = present_period(o), now = kern_now_ns();
uint64_t slot = now + pace(&o->pace, now, period);