[Fixed] Issues with AMD Enhanced Sync

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Issues with AMD Enhanced Sync

Postby Dwailing » Tue Apr 30, 2019 12:59 am

Hey, got another stuttering issue, lol. Using AMD's Enhanced Sync technology with GZDoom's Vulkan renderer causes what I can only assume are some MAJOR frame pacing issues, and it also seems to circumvent GZDoom's internal frame rate cap. I don't know if Nvidia cards have the same problem with Adaptive Sync, but it wouldn't surprise me since they do pretty much the same thing. It's easy enough to just turn off Enhanced Sync when I play GZDoom, but I figured I should mention it. Turning off VSync in GZDoom also stops the stuttering, but I'm assuming that's just because it's not trying to use Enhanced Sync with VSync off in the application. I'm using an AMD Radeon RX 580 with the 19.4.3 drivers.
Dwailing
 
Joined: 28 Jun 2017
Discord: 5896

Re: Issues with AMD Enhanced Sync

Postby dpJudas » Tue Apr 30, 2019 11:22 am

I'm not familiar enough with AMD hardware to say for sure what Enhanced Sync does. AMD bought one of those modern web designs where we see pretty pictures and have to scroll 5 pages for every paragraph of text, so I gave up trying to read any official description of this feature. If someone can give me a description of this feature in somewhat technical terms it would help.

Vulkan supports a couple of different swap chain presentation modes: FIFO, FIFO Relaxed, Mailbox and Immediate. When vid_vsync is enabled the code picks FIFO relaxed, if available, otherwise FIFO. If vsync is off it picks Mailbox, if available, otherwise Immediate.

FIFO Relaxed is described like this in the spec: the presentation engine generally waits for the next vertical blanking period to update the current image. If a vertical blanking period has already passed since the last update of the current image then the presentation engine does not wait for another vertical blanking period for the update, meaning this mode may result in visible tearing in this case

And FIFO is: the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed.

When vid_vsync is enabled it indeed does not apply vid_maxfps at all. I did this intentionally since I figured the natural vertical sync speed was a more natural limit in this case. Is this bad for AMD hardware?

Edit: I probably should mention that because it uses Mailbox instead of Immediate when vsync is off there is never any tearing. Mailbox shows the last supplied image at the sync time, but it doesn't replace it in the middle of the update like in the OpenGL backend.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Issues with AMD Enhanced Sync

Postby Dwailing » Tue Apr 30, 2019 1:27 pm

So basically the layman's explanation is that Enhanced Sync reduces input lag by allowing the GPU to render as many frames as possible while dropping frames unnecessary to display a frame rate that's synced with the display's vertical refresh rate. Thus, when it's on and VSync is enabled in GZDoom the GPU is rendering about 220 frames every second but it's trying to only display 60 of those. Since I'm assuming you have an Nvidia GPU I'd suggest enabling Nvidia's Fast Sync option (I got the name wrong in my original post, sorry) and seeing if that causes the same problem I'm having since Fast Sync does the same thing. It's possible it's an issue with the idea rather than AMD's specific implementation of it. I can't give a more detailed explanation because I can't find one. However, if I'm reading this correctly it almost sounds like turning VSync off in GZDoom's settings actually has the same effect when using Vulkan. Hmm...
Dwailing
 
Joined: 28 Jun 2017
Discord: 5896

Re: Issues with AMD Enhanced Sync

Postby dpJudas » Tue Apr 30, 2019 1:45 pm

Is this a setting you are forcing on the application? It sounds like this feature is known as Mailbox in vulkan and GZD vulkan supports and uses it natively when vid_vsync is disabled.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Issues with AMD Enhanced Sync

Postby Dwailing » Tue Apr 30, 2019 3:36 pm

That very well might be the case. I normally leave it enabled globally in Radeon Settings since it doesn't cause problems otherwise and it stops the application from telling me I should turn it on all the time, lol. Yeah, I guess it's probably the interaction between Radeon Settings trying to force Mailbox while GZDoom is trying to use FIFO if VSync is turned on in the application. Interesting.
Dwailing
 
Joined: 28 Jun 2017
Discord: 5896

Re: Issues with AMD Enhanced Sync

Postby dpJudas » Mon May 13, 2019 3:52 pm

I pushed a change so it always applies vid_maxfps regardless if vid_vsync is enabled. That should solve the issue reported here.
dpJudas
 
 
 
Joined: 28 May 2016


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest