Issues with AMD Enhanced Sync

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Dwailing
Posts: 72
Joined: Wed Jun 28, 2017 3:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Issues with AMD Enhanced Sync

Post by Dwailing »

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.
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Issues with AMD Enhanced Sync

Post by dpJudas »

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.
Dwailing
Posts: 72
Joined: Wed Jun 28, 2017 3:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Issues with AMD Enhanced Sync

Post by Dwailing »

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...
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Issues with AMD Enhanced Sync

Post by dpJudas »

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.
Dwailing
Posts: 72
Joined: Wed Jun 28, 2017 3:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Issues with AMD Enhanced Sync

Post by Dwailing »

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.
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Issues with AMD Enhanced Sync

Post by dpJudas »

I pushed a change so it always applies vid_maxfps regardless if vid_vsync is enabled. That should solve the issue reported here.
Post Reply

Return to “Closed Bugs [GZDoom]”