1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 22:29:15 +01:00

[dxvk] Add config variables for frame pacing

This commit is contained in:
netborg 2025-02-18 21:01:19 +01:00
parent 23067c48c7
commit 13ae0d218b
3 changed files with 71 additions and 3 deletions

View File

@ -18,6 +18,51 @@
# dxgi.enableHDR = True
# Frame pacing mode managing CPU-GPU synchronization.
# Defaults to "low-latency" in the draft-PR for demonstration purposes.
#
# "max-frame-latency" provides stable latency in the GPU-limit as long as
# GPU render times are stable. Latency generally is higher but offers great
# visual smoothness.
#
# "low-latency" provides lower latency in the GPU-limit and can be fine-tuned
# via dxvk.lowLatencyOffset and dxvk.lowLatencyAllowCpuFramesOverlap.
#
# "min-latency" possibly provides the lowest latency (low-latency can be
# quicker in some situations), and offers less fps in the GPU-limit
# due to stalling the GPU between frames. Generally not recommended,
# but helpful to get insights to fine-tune the low-latency mode and
# possibly is useful for running games in the CPU-limit.
#
# "low/min-latency" also supports its own fps-limiting enabled via common
# variables.
#
# Supported values: "max-frame-latency", "low-latency", "min-latency"
# dxvk.framePacing = ""
# Allows fine-tuning the low-latency frame pacing mode.
# Positive values make a frame begin later which might improve responsiveness,
# although only very slightly, but may be relevant for edge cases.
# Negative values make a frame begin earlier which might improve fps.
# Values are given in microseconds. Defaults to 0.
#
# Supported values: -10000 to 10000
# dxvk.lowLatencyOffset = 0
# Determines whether a frame is allowed to begin before finishing processing
# the cpu-part of the previous one, when low-latency frame pacing is used.
# Snappiness may be improved when disallowing overlap. On the other hand, this
# might also decrease fps in certain cases. Defaults to True.
#
# Supported values: True, False
# dxvk.lowLatencyAllowCpuFramesOverlap = True
# Expose support for dcomp swap chains with a dummy window.
#
# This is not a valid implementation of DirectComposition swapchains,
@ -104,8 +149,13 @@
# The implementation will either use VK_NV_low_latency2 if supported
# by the driver, or a custom algorithm.
# - False: Disable Reflex support as well as built-in latency reduction.
# This build defaults to False to enable dxvk.framePacing. You need to
# enable Reflex manually (Auto) until we support switching back and
# forth between Reflex and the low-latency frame pacing - for example
# via the ingame options - and more critically we want to enable
# low-latency frame pacing if the game doesn't support Reflex.
# dxvk.latencySleep = Auto
# dxvk.latencySleep = False
# Tolerance for the latency sleep heuristic, in microseconds. Higher values

View File

@ -12,12 +12,16 @@ namespace dxvk {
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto);
hud = config.getOption<std::string>("dxvk.hud", "");
tearFree = config.getOption<Tristate>("dxvk.tearFree", Tristate::Auto);
latencySleep = config.getOption<Tristate>("dxvk.latencySleep", Tristate::Auto);
latencySleep = config.getOption<Tristate>("dxvk.latencySleep", Tristate::False);
latencyTolerance = config.getOption<int32_t> ("dxvk.latencyTolerance", 1000);
disableNvLowLatency2 = config.getOption<Tristate>("dxvk.disableNvLowLatency2", Tristate::Auto);
hideIntegratedGraphics = config.getOption<bool> ("dxvk.hideIntegratedGraphics", false);
zeroMappedMemory = config.getOption<bool> ("dxvk.zeroMappedMemory", false);
allowFse = config.getOption<bool> ("dxvk.allowFse", false);
framePace = config.getOption<std::string>("dxvk.framePace", "");
lowLatencyOffset = config.getOption<int32_t> ("dxvk.lowLatencyOffset", 0);
lowLatencyAllowCpuFramesOverlap
= config.getOption<bool> ("dxvk.lowLatencyAllowCpuFramesOverlap", true);
deviceFilter = config.getOption<std::string>("dxvk.deviceFilter", "");
tilerMode = config.getOption<Tristate>("dxvk.tilerMode", Tristate::Auto);
}

View File

@ -38,7 +38,9 @@ namespace dxvk {
Tristate tearFree = Tristate::Auto;
/// Enables latency sleep
Tristate latencySleep = Tristate::Auto;
/// Defaults to false in this build to activate the FramePacer,
/// especially for the case when the game doesn't support Reflex
Tristate latencySleep = Tristate::False;
/// Latency tolerance, in microseconds
int32_t latencyTolerance = 0u;
@ -61,6 +63,18 @@ namespace dxvk {
/// Whether to enable tiler optimizations
Tristate tilerMode = Tristate::Auto;
/// Frame pacing
std::string framePace;
/// A value in microseconds to fine-tune the low-latency frame pacing.
/// Positive values make a frame begin later which might improve responsiveness.
/// Negative values make a frame begin earlier which might improve fps.
int32_t lowLatencyOffset;
/// Determines whether a frame is allowed to begin before finishing processing
/// the cpu-part of the previous one, when low-latency frame pacing is used.
bool lowLatencyAllowCpuFramesOverlap;
// Device name
std::string deviceFilter;
};