Vulkan API "tearFree" method

Talk to software developers and aspiring geeks. Programming tips. Improve motion fluidity. Reduce input lag. Come Present() yourself!
Post Reply
xyGvot
Posts: 1
Joined: 13 May 2020, 16:38

Vulkan API "tearFree" method

Post by xyGvot » 13 May 2020, 17:49

Hi there!
Long time lurker, finally decided to make an account just to bring your attention to this interesting development.

As some of you know, DXVK is a juggernaut effort made primarily by doitsujin and Joshua Ashton among others, even banked by Valve itself (it is afterall, the backbone upon which Proton runs); its main purpose is to translate D3D9, D3D10 and D3D11/DXGI to Vulkan via a layer/wrapper and allow 3D apps to run natively on Linux.

A few months ago, a Windows 10 user, frustrated by how his Radeon 5700 XT was performing on Sekiro, grabbed the latest release of DXVK then and just threw the dlls in the game's folder, to his surprise, the game ran and performed way better than previously.
It's not a silver bullet to bad performance, but it's worth a shot if you're struggling or suspect bad optimization (it works wonders in the Borderlands games, haha!).

Note: The project is not aimed at Windows nor offers support for users running the OS, it's not their focus.

With the surprising performance benefits on Windows and almost universal compatibility (most Unity games won't launch in my testing since they still call to native System32/SysWOW64 DirectX libraries, crashing), I started to follow the project closely out of curiosity.

Just the most recent version (1.6.1) added a new setting called "tearFree" that calls a particular Vulkan function; from their release log:
Added dxgi.tearFree option to enforce the Mailbox present mode when Vsync is disabled, which should prevent tearing. May not work on all setups.
The setting was only available for DXGI/10/11 games, but almost 2 weeks ago, another contributor opened the option for D3D9, which is already merged in the daily builds.

DXVK uses a configuration file which you put, along with the dlls, next to the game's exe.

tearFree's entry in the config file reads as follows:
# True enables the mailbox present mode in case regular Vsync is disabled.
# This should avoid tearing, but may be unsupported on some systems
# or require setting dxgi.numBackBuffers to a higher value in order
# to work properly.
#
# False enables the relaxed fifo present mode in case regular Vsync is enabled.
# This should result in tearing but reduce stutter if FPS are too low,
# but may be unsupported on some systems.
#
# Please do not report issues with this option.
#
# Supported values: Auto, True, False
I've been testing the setting on True, forcing VSync to off in NVCP and running games on my TV which is not VRR and it works!
I do have to limit the framerate to my refreshrate via RTSS, otherwise there's tearing, but the result is impressive!
Edit: I was wrong, frame limiting isn't necessary, presentation still shows no tearing when framerate is above the refresh rate.

My limited knowledge in the matter tells me it works in a way similar to Fastsync without the penalties that that method incurs, since it's part of the API itself and not an external solution, and I do wonder if DX12 has some such option in its code.

And well, that's about it, I invite you to give it a shot.

PD: I think it's obvious, but don't try to use it on multiplayer games/games with anti-cheat.

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Vulkan API "tearFree" method

Post by Chief Blur Buster » 17 May 2020, 14:07

xyGvot wrote:
13 May 2020, 17:49
Hi there!
Long time lurker, finally decided to make an account just to bring your attention to this interesting development.
Appreciate you posting this!

I have moved this to the Programming forum, since this is a programming topic, and will probably get more reads/viewership there. Many lurkers are probably interested in this finding;
xyGvot wrote:
13 May 2020, 17:49
My limited knowledge in the matter tells me it works in a way similar to Fastsync without the penalties that that method incurs, since it's part of the API itself and not an external solution, and I do wonder if DX12 has some such option in its code.
Yes, the tear-free method would be similar to Fast Sync or Enhanced Sync.

Very interesting development; appreciate you for posting this!
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

nuninho1980
Posts: 140
Joined: 26 Dec 2013, 09:49

Re: Vulkan API "tearFree" method

Post by nuninho1980 » 17 May 2020, 19:02

Yeah but we think this method software may impact performance of CPU and/or GPU. Therefore, I stay VSYNC enabled. You enable G-SYNC or FreeSync, if you don't want method software. ;)
CPU: [email protected]
RAM: 2x16GB DDR4@3600MHz
MB: MSI PRO Z690-A DDR4
GPU: Zotac RTX 4090 non-OC new! <3 :D
Opt. disc: LG BD-RE writer BH16NS40
HDD: SATA 1TB
SSDs: OCZ RD400 0.5TB+Crucial MX500 2TB
PSU: AEROCOOL 1kW 80+ Gold
Disly: CRT 21" Sony E530 :D

Post Reply