mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-21 04:55:56 +00:00
Implement Native NVIDIA Reflex Low Latency (VK_NV_low_latency2)
This commit is contained in:
1 parent
0f65b4ee07
commit
51fa4a982b
10 files changed
+137
-5
No files matched your search
@@ -16,6 +16,7 @@
|
||||
#include "nvn_api.h"
|
||||
#include "nvn_hmap.h"
|
||||
#include "nvn_tex.h"
|
||||
#include "vk.h"
|
||||
#include "platform/platform.h"
|
||||
|
||||
// ---------- Descriptor pools
|
||||
@@ -682,6 +683,9 @@ NVN_API(nvnWindowAcquireTexture) {
|
||||
sleep_until(at);
|
||||
perf_end(PERF_PACE, p0);
|
||||
}
|
||||
vk_reflex_sleep();
|
||||
vk_reflex_marker(0); // VK_LATENCY_MARKER_SIMULATION_START_NV
|
||||
vk_reflex_marker(6); // VK_LATENCY_MARKER_INPUT_SAMPLE_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) {
|
||||
@@ -704,6 +708,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);
|
||||
|
||||
Reference in new issue
Block a user