14 Commits

Author SHA1 Message Date
Kawe Mazidjatari
a831494c43 NVIDIA: make vars static 2024-04-05 17:19:29 +02:00
Kawe Mazidjatari
fde79e9f93 NVIDIA: only run latency on success
Only run latency markers if NvAPI_D3D_SetSleepMode returned NVAPI_OK.
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
b162b10598 NVIDIA: always run PC Latency stats
PCLStats is not NVIDIA hardware bound as per Reflex's documentation, and runs separately from the NVIDIA Reflex code. Always enable!
2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
735a9e0489 NVIDIA: properly enqueue frame ID
Sync Frame ID between main thread and render thread, this changes makes the integration PASS the reflex test utility.
2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
1b2ce75e81 Add PCLSTATS marker 2024-04-05 16:49:30 +02:00
Kawe Mazidjatari
51b866f6a1 NVIDIA: check if adapter is from NVIDIA in GFX_SetLatencyMarker()
Moved adapter vendor check to its own func, added a global which could be used to fully disable the low latency system. Also added groundwork for the (future) PCL stats implementation.
2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
27493a25ae Make const
Const correctness.
2024-04-05 16:24:45 +02:00
Kawe Mazidjatari
d0887da27a Cleanup
No longer used.
2023-09-13 22:20:56 +02:00
Kawe Mazidjatari
688a76c358 Use correct types for frame numbering
Structure contains an NvU64 type for frame ID, use this type instead. Also no need to worry about overflowing it, as it would just 'wrap around'.
2023-09-13 17:42:47 +02:00
Kawe Mazidjatari
4927654da0 Bugfix: only run NVIDIA Reflex if we ran an actual engine frame
CEngine::Frame() tends to return out early if we are ahead of frame time, and therefore need to sleep. In this particular engine, CEngine::Frame() returns true if it had actually executed an engine frame, else it returns false.

Therefore, we end up calling 'NvAPI_D3D_Sleep()' multiple times a frame, and thus causing a major loss in performance. Now we check if we have actually ran a frame (incrementing reflex frame if so). If the frame was not incremented, but 'GFX_RunLowLatencyFrame()' was called, it will not call 'NvAPI_D3D_Sleep()'.

Code has been tested and appears to work on my system (never called twice or more per frame). Needs more testing on other systems to make sure its good.
2023-09-12 20:50:38 +02:00
Kawe Mazidjatari
51a3f4a1c4 Only call 'NvAPI_D3D_SetSleepMode(...)' on pending changes
No need to keep calling this if there are no pending changes.
2023-09-12 17:44:24 +02:00
Kawe Mazidjatari
ea6c15df4c Initial implementation of NVIDIA Reflex Low Latency timing
Propagated latency markers in an attempt to further reduce input latency. Code is pending rigorous testing on several systems, including systems powered by an AMD GPU to make sure we are not impacting performance on systems that does NOT support NVIDIA Reflex.
2023-09-12 11:06:16 +02:00
Kawe Mazidjatari
9df90d4a25 Add cvar for low latency timing (work in progress)
Work in progress NVIDIA Low Latency timing implementation.
2023-09-12 00:19:47 +02:00
Kawe Mazidjatari
804f96625b Move NVIDIA Reflex implementation to library function
Improve code, there will be more NVIDIA GeForce related stuff soon.
2023-09-12 00:08:46 +02:00