-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nvidia Reflex support #4632
Nvidia Reflex support #4632
Conversation
Matches std::vector.
We'll need this in more places.
Implements a basic latency sleep solution that is intended to work without requiring games to support any related vendor features. This alone is not enough to expose the Reflex API to applications via dxvk-nvapi, but since that relies on NV_low_latency2 specifics anyway, we are going to add an implementation based on that extension later with an extended interface.
Introduces two queues and allows us to dispatch chunks to the ordered queue without disrupting the sequence number.
I've tested out I haven't run into any ill effects or instability, beside a minor quirk in Aquanox 2 - it, for some reason, seems to halve its framerate at times with the setting enabled, which doesn't happen with it disabled. |
Suggest game for test: My Time at Sandrock (D3D11, Unity 2021, Single player game without anticheat) The full list of Reflex enabled games: https://www.nvidia.com/en-au/geforce/technologies/reflex/supported-products/ |
I'm aware of the full list, but 99% of the games on that are D3D12 only so it's kinda hard to really pick something out. Anyway, will give that Unity game a go. |
Nevermind my previous comment, it does actually do something, just wasn't testing the correct dxvk branch 🐸 Too bad the game is CPU-bound like hell so there's no actual latency sleep happening. |
This implements Reflex support through dxvk-nvapi's
ID3DLowLatencyDevice
on drivers that supportVK_NV_low_latency2
. Fairly invasive change since we need to pass frame IDs all over the place and mess around with certain markers to account for internal threading.Tested in a few games:
Not sure if there are any other Reflex-enabled D3D11 games that aren't simultaneously blocked by anti-cheat measures,
it's a bit unfortunate that the only UE4 test case seems to be bugged at a game level.This also adds a HUD item (
latency
) that will show up when a game uses latency markers, and will display the average time it takes from the game setting theSIMULATION_START
(orINPUT_SAMPLING
, if it uses that) marker to presentation of the given frame completing on the GPU, as well as the average latency sleep duration.Things that are not really supported very well include non-monitonic frame IDs (dxvk-nvapi sorts these out for us so that should never happen anyway), and the whole thing probably isn't very well behaved when a game randomly skips markers for a frame since it breaks our way of correlating app-provided frame IDs with the ones we use for the Vulkan swapchain.
Finally, this adds an option to enable latency sleep for older games; the obvious downside here is that we can only really sleep after Present, so this isn't going to do all that much in games that have an asynchronous render thread, besides reducing some buffering inside DXVK. This can be enabled by setting
dxvk.latencySleep = True
in the configuration file.Supersedes #4623, #3690.