You listed many UE4 games, so it can be just engine flaw.
Instead of adding exceptions for every (https://www.pcgamingwiki.com/wiki/List_of_games_that_use_Unreal_Engine_4) UE4 game it obviously simpler to just add safe default.
The option being set to true by default is not a workaround, it's the only way to guarantee consistent behaviour between depth passes and subsequent render passes drawing the same geometry again. If anything, the option still existing and being set to false for Nvidia in some games is the actual workaround here and even there i'm not sure if that's still required.
Why is this a problem all of the sudden? The perf impact should be roughly zero in practice. D3D drivers absolutely have invariance guarantees, otherwise half your games would flicker.
@pchome
You listed many UE4 games, so it can be just engine flaw.
Lets count games engines specified in config.cpp of DXVK 1.7.3 (https://github.com/doitsujin/dxvk/blob/v1.7.3/src/util/config/config.cpp):
3 Unreal Engine 4 games out of total 13 games.
Does not look like Unreal Engine 4 flaw. Specific engines, like Genome Engine, maybe. But it is still needs to be checked on newest DXVK.
@doitsujin
The option being set to true by default is not a workaround, it's the only way to guarantee consistent behaviour between depth passes and subsequent render passes drawing the same geometry again.
Release Notes of DXVK 1.8 - Feb 19, 2021 (https://github.com/doitsujin/dxvk/releases/tag/v1.8):
Enabled d3d11.invariantPosition option by default to fix common Z-fighting issues, especially on RDNA2 GPUs.
From this statement we can draw the following conclusion:
RDNA2 GPUs with AMDVLK or RADV driver or both drivers (it is not specified in release notes) are exhibiting Z-fighting issues in D3D11 more than other GPUs.
My guess that is because of different transformation paths for the same geometry.
Question 1: Why NVIDIA GPUs need "d3d11.invariantPosition = True"?
Question 2: Why Intel GPUs need "d3d11.invariantPosition = True"?
Question 3: Why other AMD GPUs need "d3d11.invariantPosition = True"?
These questions lead to another:
Question 4: Why "d3d11.invariantPosition = True" and "d3d9.invariantPosition = True" are enabled globally and unconditionally? If it was THAT important - "the only way to guarantee consistent behaviour" - how is any game rendered correctly at all before this change, for almost 3 years, starting from DXVK 0.20 - Jan 14, 2018 (https://github.com/doitsujin/dxvk/releases/tag/v0.20) up to DXVK 1.7.3 - Dec 2, 2020 (https://github.com/doitsujin/dxvk/releases/tag/v1.7.3)?
Why is this a problem all of the sudden? The perf impact should be roughly zero in practice.
It is not a problem. But as I wrote earlier:
As specified in DXVK documentation, setting d3d11.invariantPosition and d3d9.invariantPosition to "true", comes at a small performance cost. In my own testing I observed permanent 5-10% performance difference between "true" and "false" with the "false" option being most performant - similar performance difference to what you can obsereve in videos at https://gitlab.freedesktop.org/mesa/mesa/-/issues/2706#note_538316 - watch at GPU Load in DXVK HUD. It is worth to note, that it is GPU performance cost, which is obviously important for any platform, but more so for platforms with limited GPU performance and limited power packages, such as handheld devices (Steam Deck, etc.) and notebooks.
I do not think that 5-10% performance difference is "roughly zero in practice". It can be seen in videos at https://gitlab.freedesktop.org/mesa/mesa/-/issues/2706#note_538316
D3D drivers absolutely have invariance guarantees, otherwise half your games would flicker.
I am sure that they have. But only when it is needed - for specific cases - not globally and unconditionally.
Tests that I conducted:
I checked "d3d11.invariantPosition = False" on AMD Radeon RX 580 using DXVK 2.6.1 on Windows 10, AMD Software: Adrenalin Edition 23.8.2 in Final Fantasy XV and did not see any rendering issues, but observed performance improvement.
I checked "d3d9.invariantPosition = False" on AMD Radeon RX 580 using DXVK 2.6.1 on Windows 10, AMD Software: Adrenalin Edition 23.8.2 in Borderlands 2 - Remastered and did not see any rendering issues, but observed performance improvement.
I checked "d3d9.invariantPosition = False" on AMD Radeon RX 580 using DXVK 2.6.1 on Windows 10, AMD Software: Adrenalin Edition 23.8.2 in WarCraft 3 1.26a and did not see any rendering issues, but observed performance improvement.
Out of interest, I checked "d3d9.invariantPosition = False" on AMD Radeon R9 Nano using DXVK 1.10.3 on Windows 10, AMD Software: Adrenalin Edition 21.5.2 in Borderlands 2 - Remastered and did not see any rendering issues, but observed performance improvement.
I wrote it as a user report, based on a simple logic - if an option that has some performance cost is not needed everywhere for everyone, maybe it is right thing to make it active only for those who needs it? If you think otherwise - ok, as I wrote earlier it is only an enhancement proposal, nothing more.
Thank you for your time.
how is any game rendered correctly at all before this change, for almost 3 years, starting from DXVK 0.20
Because either the games in question simply don't do multiple geometry passes with the same depth buffer, or you got lucky and your driver happened to compile everything that contributes to SV_Position in exactly the same way across different shaders.
And yes, "getting lucky" is relatively common in practice, but it's not something to rely on.
If for whatever your AMD decides to generate unnecessarily shit code, then yeah feel free to turn it off I guess, but doing so by default in DXVK won't happen and that's non-negotiable, if I have the choice between my code working everywhere and it randomly breaking with specific hardware/drivers/games for a chance to maybe get a sub-1% perf improvement, I'll rather do the former.
3 Unreal Engine 4 games out of total 13 games.
Does not look like Unreal Engine 4 flaw. Specific engines, like Genome Engine, maybe. But it is still needs to be checked on newest DXVK.
Maybe not exclusive to UE4, but there is also Halo "Anniversary" UE4 versions, so I counted them as engine per title, where UE4 is almost half of them.
Nevermind.
@doitsujin
I thought about what you wrote and decided to propose option that will not violate your requirements. I will write here how I think it can be implemented, if you ever consider to do it, but I am not familiar with all the details - you know better how to implement it.
Proposal:
Implement environment variable DXVK_PERFMODE (example of name - not final) and add its description to README.md.
Example of description in README.md (not final):
DXVK_PERFMODE=True|False - Set to False by default. If set to False - does nothing. If set to True - activates a set of dxvk.conf options, that may give performance improvement, but may introduce issues in certain scenarios. Please do not report bugs with DXVK_PERFMODE option environment variable set to True.
It is important to implement additional logic that will not allow DXVK_PERFMODE environment variable to override existing DXVK config for specific games from config.cpp, but still will allow to change DXVK config by creating dxvk.conf or using DXVK_CONFIG environment variable.
DXVK_PERFMODE use-case example for DXVK 2.6.1, D3D9 API (you know better which options to activate - this example is only my expirience):
DXVK_PERFMODE=True activates next options for D3D9:
d3d9.floatEmulation = True
d3d9.lenientClear = True
d3d9.invariantPosition = False
Borderlands 2 has a DXVK existing config:
d3d9.floatEmulation = Strict
d3d9.lenientClear = True
d3d9.supportDFFormats = False
If user sets DXVK_PERFMODE=True and runs Borderlands 2, then effective configuration must be:
d3d9.floatEmulation = Strict
d3d9.lenientClear = True
d3d9.supportDFFormats = False
d3d9.invariantPosition = False
But, if user sets DXVK_PERFMODE=True and creates dxvk.conf or DXVK_CONFIG environment variable with d3d9.floatEmulation = True, then effective configuration must be:
d3d9.floatEmulation = True
d3d9.lenientClear = True
d3d9.supportDFFormats = False
d3d9.invariantPosition = False
DXVK_PERFMODE use-case example for DXVK 2.6.1, D3D11 API (you know better which options to activate - this example is only my expirience):
DXVK_PERFMODE=True activates next options for D3D11:
d3d11.maxTessFactor = 8
d3d11.relaxedGraphicsBarriers = True
d3d11.relaxedBarriers = True
d3d11.invariantPosition = False
Logic is the same as in Borderlands 2 D3D9 use-case example.
Pros:
DXVK_PERFMODE environment variable.Cons:
d3d11.invariantPosition = False and d3d9.invariantPosition = False option changes DXBC behaviour - and leads to invalidating GPU Shader Cache on user PC for every game (confirmed myself), which leads to shader stutters on first launch, if GPL is not used. I think this information should be added to the description of DXVK_PERFMODE environment variable in README.md, if aforementioned options will be activated.As I wrote earlier it is only an enhancement proposal, nothing more.
Jesus christ, wall of text.
Anyway, I don't see the point in adding more env vars with massively overcomplicated logic for... basically no reason. If users want to fiddle around with this then the config options are already there. We don't need an env var for this.
Linux has many config options, but no user friendliness and 5% of PCs user base, instead of 95%. You are making the same mistake.
You can make your own bash script to do that.
Linux has many config options, but no user friendliness and 5% of PCs user base, instead of 95%. You are making the same mistake.
Some launchers will do that for you. For example, Proton has its own configuration for specific games for better performance. Then, you add more environment configurations, which can be done by adding to the dxvk config. It just makes it more complicated and less user-friendly
I do not think that 5-10% performance difference is "roughly zero in practice". It can be seen in videos at https://gitlab.freedesktop.org/mesa/mesa/-/issues/2706#note_538316
The videos there show exactly 0% performance difference? Both are locked at 30 fps? I kind of doubt that you properly tested this and are just throwing placebo options at the wall that don't do anyuthing.
@mbriar
As I wrote earlier:
In my own testing I observed permanent 5-10% performance difference between "true" and "false" with the "false" option being most performant - similar performance difference to what you can obsereve in videos at https://gitlab.freedesktop.org/mesa/mesa/-/issues/2706#note_538316 - watch at GPU Load in DXVK HUD. It is worth to note, that it is GPU performance cost, which is obviously important for any platform, but more so for platforms with limited GPU performance and limited power packages, such as handheld devices (Steam Deck, etc.) and notebooks.
Both are locked at 30 fps?
Watch at GPU Load in DXVK HUD.
I kind of doubt that you properly tested this and are just throwing placebo options at the wall that don't do anyuthing.
You can properly test it by yourself, if you are in doubt. I provided my observations.
I wouldn't draw any conclusions from the estimated gpu load of the dxvk hud.
@mbriar
I did not. As I wrote earlier:
Tests that I conducted:
I checked "d3d11.invariantPosition = False" on AMD Radeon RX 580 using DXVK 2.6.1 on Windows 10, AMD Software: Adrenalin Edition 23.8.2 in Final Fantasy XV and did not see any rendering issues, but observed performance improvement.
I checked "d3d9.invariantPosition = False" on AMD Radeon RX 580 using DXVK 2.6.1 on Windows 10, AMD Software: Adrenalin Edition 23.8.2 in Borderlands 2 - Remastered and did not see any rendering issues, but observed performance improvement.
I checked "d3d9.invariantPosition = False" on AMD Radeon RX 580 using DXVK 2.6.1 on Windows 10, AMD Software: Adrenalin Edition 23.8.2 in WarCraft 3 1.26a and did not see any rendering issues, but observed performance improvement.
Out of interest, I checked "d3d9.invariantPosition = False" on AMD Radeon R9 Nano using DXVK 1.10.3 on Windows 10, AMD Software: Adrenalin Edition 21.5.2 in Borderlands 2 - Remastered and did not see any rendering issues, but observed performance improvement.
I would have not written it, if I did not check it.
@Zebra2711
Some launchers will do that for you. For example, Proton has its own configuration for specific games for better performance. Then, you add more environment configurations, which can be done by adding to the dxvk config. It just makes it more complicated and less user-friendly
I am using Windows.
Stop wasting yours and my time - author said that he is not interested in it.
DXVK_CONFIGx1 2025-05DXVK_PERFMODEx1 2025-05DXVK_PERFMODE=True`x1 2025-05DXVK_PERFMODE=True|False`x1 2025-05
New Proposal: https://github.com/doitsujin/dxvk/issues/4910#issuecomment-2888527064
Old Proposal:
Reasons:
This workaround was applied at DXVK 1.8 release to "fix common Z-fighting issues, especially on RDNA2 GPUs.". It was applied when DXVK required Vulkan 1.1 (DXVK 1.x branch). Since that time there were many improvments to different aspects of DXVK, especially in terms of requirements/constraints, and to RADV/AMDVLK/NVIDIA/etc. GPU drivers. As far as I understand nobody checked the necessity to set these options to "true" even for games that were specified in config.cpp at the moment of DXVK 1.7.3 (version before DXVK 1.8).
As specified in DXVK documentation, setting d3d11.invariantPosition and d3d9.invariantPosition to "true", comes at a small performance cost. In my own testing I observed permanent 5-10% performance difference between "true" and "false" with the "false" option being most performant - similar performance difference to what you can obsereve in videos at https://gitlab.freedesktop.org/mesa/mesa/-/issues/2706#note_538316 - watch at GPU Load in DXVK HUD. It is worth to note, that it is GPU performance cost, which is obviously important for any platform, but more so for platforms with limited GPU performance and limited power packages, such as handheld devices (Steam Deck, etc.) and notebooks.
If I understand correctly (and it was previously stated by various contributors to the DXVK), DXVK as a project tries to maintain behaviour similar to native DirectX drivers where it is possible and as much as possible, as long as the rendered result is correct and its performance at least similar/identical to native DirectX driver. "invariantPosition" workaround that applied globally and almost unconditionally is not a native DirectX driver behaviour.
Proposal:
Set d3d11.invariantPosition and d3d9.invariantPosition to "false" by default.
Set d3d11.invariantPosition and d3d9.invariantPosition to "true" using driver filter for RADV (if it is still not fixed for RDNA2) or for older RADV versions in which it is not fixed.
Set d3d11.invariantPosition and d3d9.invariantPosition to "true" for games that needed it at the moment of DXVK 1.7.3. Here is list of games from DXVK 1.7.3 (https://github.com/doitsujin/dxvk/blob/v1.7.3/src/util/config/config.cpp) that required such config (details not specified):
Pros:
DXVK behaviour is the same as the native DirectX driver where it is possible and as much as possible.
Small GPU-performance improvement where it is possible, which leads to higher energy efficiency especially in power-limited scenarios.
Cons:
Possible maintenance burden - if there will arise new games/drivers which would require d3d11.invariantPosition or d3d9.invariantPosition set to "true".
Not really a con, but still - since setting this option changes DXBC behaviour - it leads to invalidating all of game GPU Shader Cache on user PC (confirmed myself), which leads to shader stutters on first launch, if GPL is not used. So I recommend to combine this change with some other more important change to DXBC behaviour, to not burden user with shader recompiling more than it is needed.