Exclusive Fullscreen with Vulkan?

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Guest

Exclusive Fullscreen with Vulkan?

Post by Guest »

Hello

how do i activate exclusive fullscreen with the vulkan api? i have serious input lag caued by dwm.exe because it does not run in fullscreen mode. opengl runs fine.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49143
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Exclusive Fullscreen with Vulkan?

Post by Graf Zahl »

GZDoom does not use exclusive fullscreen. It only uses borderless fullscreen windows.
What's your system specs? This is rather unusual.
Guest

Re: Exclusive Fullscreen with Vulkan?

Post by Guest »

AMD Phenom II X4 3.4 GHz
8GB DDR3
Nvidia Geforce GTX 1650 Super 4GB
Windows 10 Home & Windows 7 for backward compatibility.
60hz Full HD Display

Input lag feels like vsync on. The reason why i think it has to be the dwm.exe is because i'm getting the same results with other games running in borderless or windowed mode.
This does not happen with Windows 7 because i disabled Windows aero and dwm.exe.
User avatar
Rachael
Posts: 13737
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Exclusive Fullscreen with Vulkan?

Post by Rachael »

dwm.exe is indeed responsible for a lot of major sync issues especially with dual-GPU systems, but indeed single-GPU systems in some rare cases. Unfortunately there is nothing GZDoom can do about that - and exclusive fullscreen mode has never been available for any application other than Direct3D apps prior to DX12. It was never available to OpenGL, and it certainly was never available and won't ever be available to Vulkan.

That being said - dwm.exe *should* automatically disable itself when GZDoom is in full screen automatically. If it's not doing that, that means there's another application drawing to the screen, even if invisibly. Make sure nothing is running in the background when GZDoom is running - and make sure nothing (i.e. screen recorders and what not) is hooking GZDoom's Vulkan output. HyperCam is absolutely notorious for incompatibility with GZDoom and causing a whole huge slew of issues and it's recommended if you use it, uninstall it completely and replace it with OBS Studio, because honestly HyperCam is a hot steaming pile of shit anyway.

Make sure also to disable the XBox Game Bar and related stuff too.
User avatar
mjr4077au
Posts: 829
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: Exclusive Fullscreen with Vulkan?

Post by mjr4077au »

FWIW, Vulkan does have an exclusive fullscreen mode for Windows. I know vkQuake2 is at least using it, I'm sure a lot of other vendors are as well.

If we ever get to the point of being Vulkan-only once OpenGL could safely be deprecated or split out, could be worthwhile considering then but I probably wouldn't bother otherwise.

For the mean time, I completely second Rachael's advice about making sure nothing is hooking the output. This could be a capture program as said, or MSI Afterburner/RTSS or anything else that might be running. Whatever's going on here, I highly doubt it's on GZDoom's end, I've never had this issue myself or had to consider disabling DWM on Windows 10 like one might have back in the Windows Vista/7 days, things just work these days.
User avatar
Blackgrowl
Posts: 93
Joined: Sun Oct 06, 2019 8:47 am
Graphics Processor: nVidia with Vulkan support

Re: Exclusive Fullscreen with Vulkan?

Post by Blackgrowl »

Was gonna make a post but I noticed this myself, so I might as well post here.

With all that's said in mind, here's what I don't understand; how does VSync work on Vulkan, then?
From the little that I know, the game needs to be fullscreen instead of widowed (or borderless widowed) for VSync to work, right? I've heard about how Windows 7 and Windows 10 use some kind of "Double Buffered VSync" thing for windowed screens, and in Windows 10 you can't even disable that.
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: Exclusive Fullscreen with Vulkan?

Post by dpJudas »

In modern Windows, a monitor can run in three modes:

1) In the first mode the monitor is managed by a process on the computer called the Display Window Manager (dwm.exe). If the monitor runs at 144 hz, the DWM will repaint the monitor 144 times per second. Shortly before the monitor vsync the DWM process takes the contents of all the window textures and draws them (*). The output of the DWM is what you see when your computer is showing the desktop and its windows.

When GZDoom is running as a windowed application, it renders its output into such a window texture and then the DWM presents it. That means what you see on the screen is always vsync'ed, since it is the DWM that shows it. What the vsync off mode changes is how often GZDoom updates the texture that DWM uses.

With vsync on GZDoom will only update it once each time the monitor vsync happens. This means you'll typically have about 1 frame of monitor refresh rate latency added on top (4ms for 240 hz, 7 ms for 144 hz, 16 ms for 60 hz).

With vsync off GZDoom will keep on updating the window texture as fast as it can. When DWM presents the screen it will grab the latest version GZDoom produced, so if the game runs really fast it could shave off most of that input latency. This is because if the game runs at 1000 fps, GZDoom will have produced a frame less than 1 ms before the DWM presentation moment.

2) The second monitor mode is when the DWM turns itself off. This will happen if the DWM detected that a single undecorated window covers every pixel of the screen. Here there is no need to do any composition of anything, so the monitor can switch to simply showing the contents of the window texture directly. Since the application is now in direct control of what the monitor is currently drawing, vsync off can actually start to do screen tearing.

GZDoom's behavior in this mode is a bit different depending on whether you are using the OpenGL or the Vulkan backend. For OpenGL it will tear the screen. For Vulkan it will use the "mailbox" method, where it will show the last entire frame it produced for the entire duration of the sync. While Vulkan could also be set up to tear the screen, I'm personally of the school of thought that it gives you no actual advantage to see a tear. That just confuses your eyes. The goal here is to minimize the input latency, which means producing the frame as close to the vsync point as possible.

3) The last monitor mode is known as exclusive full screen. This mode is by far the most confusing to me, since I don't really understand why there should be any difference between this and when the DWM turned itself off. OpenGL never supported this mode - only DirectX and Vulkan does. GZDoom recently added support for this via the vk_exclusive_fullscreen CVAR. It is off by default, since I got some reports from the UT99 community that it doesn't always work, but its there for those that want to experiment with it. Note that you need a nightly build of GZDoom as of this writing to use it. I don't think it was there in the latest official release.

*) In some rare situations the DWM actually misses this deadline and you'll experience a micro-stutter. I haven't noticed it on my current computer, but it happened a lot on my old machine. Note sure if my new computer or Microsoft fixed the issue. In any case, it potentially can happen.
User avatar
Blackgrowl
Posts: 93
Joined: Sun Oct 06, 2019 8:47 am
Graphics Processor: nVidia with Vulkan support

Re: Exclusive Fullscreen with Vulkan?

Post by Blackgrowl »

dpJudas wrote: Sun Jan 15, 2023 9:24 am-snip-
Thank you very much for the detailed info.

In my case, I do like to have both the most smoothest, responsive and accurate input while also having no (or at least not visible) ugly screen tearing. So for that, I've found a way where having a frame or even three less can help, and it does, but ever since trying said method in GZDoom I've been having what I think might very well be what you mentioned right there as "microstutters", I know this because the screen just doesn't...Well, "feel" smooth, nor look smooth, and the input delay is small but yet again "feels" significant.

I just don't understand it, it's like yet another one of those nasty computer nocebo things.

Anyway, I have been trying to run at an FPS limit of 151 (this is the double of my 75hz) with VSync off, I haven't noticed any screen tearing, bad input or fuzzy smoothness. My past setup was 72 FPS limit with VSync on and it all felt off.

Also, don't "Pre-Rendered Frames" have a huge impact on this? In Nvidia it's now called "Low Latency Mode", no idea about AMD. I have noticed that setting it to On or Ultra actually makes the gameplay very crispy and the input feels "smooth" but in a bad way, as if enabling mouse smoothing.

Also it might be a tiny bit off-topic but still related; with Doom Eternal (which only uses Vulkan), if I set VSync on and limit frames to 72, there's a little bit of input lag but the screen is very smooth. However, with VSync off and frame limited to 100, it's a mess, hell even without frame limit it still feels crispy.
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: Exclusive Fullscreen with Vulkan?

Post by dpJudas »

GZDoom in vulkan mode will never show you any screen tearing. The vsync parameter simply controls if it should wait for the vsync interval before producing the next frame. In short: vsync off reduces the input latency with no side effects besides taxing the CPU and GPU more.

In GZDoom, both for OpenGL and Vulkan, the game never renders more than one frame at a time. Based on the description in the Nvidia control panel this means GZDoom always uses a Low Latency Mode. I'm not really sure what the difference is between "On" and "Ultra" here as Nvidia's description is not very clear. For the same reason I can't really explain why enabling the setting seems to introduce extra input lag?
User avatar
Blackgrowl
Posts: 93
Joined: Sun Oct 06, 2019 8:47 am
Graphics Processor: nVidia with Vulkan support

Re: Exclusive Fullscreen with Vulkan?

Post by Blackgrowl »

dpJudas wrote: Mon Jan 16, 2023 8:17 am GZDoom in vulkan mode will never show you any screen tearing. The vsync parameter simply controls if it should wait for the vsync interval before producing the next frame. In short: vsync off reduces the input latency with no side effects besides taxing the CPU and GPU more.

In GZDoom, both for OpenGL and Vulkan, the game never renders more than one frame at a time. Based on the description in the Nvidia control panel this means GZDoom always uses a Low Latency Mode. I'm not really sure what the difference is between "On" and "Ultra" here as Nvidia's description is not very clear. For the same reason I can't really explain why enabling the setting seems to introduce extra input lag?
Nice, this actually explains why it was hard for me to see a visible tear in RAZE as well.

About "Low Latency Mode", all I know is that back then it was called "Maximum Pre-Rendered Frames" and you could set it from 1 to as high as 8. Now it's "Low Latency Mode", which if I remember right it's either setting it to only 3 frames (Off), 1 frame (On) or apparently 0 frames (Ultra), which I can understand the confusion. It's likely that it's respectively 3, 2 and 1.
You say that in GZDoom it always renders at one, so could it be that Off and On has no difference but Ultra does? I think it's more likely another nocebo effect from me.

Anyway, before posting I have decided to give that "Low Latency Mode" a try again, with Off, On and Ultra, I have noticed that it was indeed a nocebo effect because it made no difference whatsoever in any way, only VSync and the frame limit does.

In my case, I've found that using Vulkan, setting VSync Off and the Frame Limit to 151 is the best case scenario for me. With VSync On (frame limit still 151) I get a small bit of input lag, but also some kind of frame stuttering despite being at constant 75 FPS, I think that's called bad frametime? Either way...

Thank you again dpJudas for all this info, it was driving me a bit crazy on setting this up, I can now have much smoother gameplay in GZdoom and RAZE.

Return to “Technical Issues”