-
Notifications
You must be signed in to change notification settings - Fork 893
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
Open
doitsujin
wants to merge
22
commits into
master
Choose a base branch
from
reflex
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Nvidia Reflex support #4632
+2,821
−128
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.