cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

FilippoLeon
Adept I

vkAcquireNextImageKHR blocking when it shouldn't

So I have a problem with using Vulkan, with vSync and fullscreen windows on window. Basically we have noticed a lot of stutter when the game is in this configuration, on 5700 XTs. We are using SDL2, to create and manage the surface in fullscreen.

Some extra details: using a swapchain of size 3 and having 2 frames in flight. Present mode is either fifo or fifoRelaxed. Increasing the swapchain to 4 while having 3 frames is flight helps, but not lots.

Basically the call to vkAcquireNextImageKHR is blocking (timeout is set to UINT64_MAX) every other frame, but only when the window is in fullscreen and has focus. As a result the framerate is lowered to an average of 45 fps, instead of the normal 60 fps (in windowed or when the window lost focus).

Using Enhaced sync seems to help the behaviour.

Weird thing this happens only in this exact configuration.

(PS: can you whitelist me for the other forums).

0 Likes
4 Replies
dipak
Big Boss

Hi @FilippoLeon ,

I have whitelisted you and moved this post to the "OpenGL and Vulkan" forum.

 

Thanks.

dorisyan
Staff

Hi @FilippoLeon ,

Yes, Enhanced sync should be helpful for your problem, and you can also set frame rate in radeon settings.

Is this a driver bug? Or am I doing something horribly wrong?

The only workaround is to increase the SwapChain size to 4 (or even better to 5), but that just seems weird to me.

But I am to understand that "acquire" shouldn't really block, since only 2 frames are submitted, and "minSwapChainSize" is 1. Leaving at least 2 images of extra tolerance. And this happens only on fullScreen when focused.

The big issue here is that "vSync+FullScreen+enhanced sync off+SwapChain size of 3" is kinda the default configuration, so I would prefer it working out-of-the box.

EDIT: if anything I would expect blocking to happen when I wait for the fence for the draw command sent two frames prior, or, eventually, when doing "present".

0 Likes

Hi @FilippoLeon 

That sounds like a bug, could you please provide your app which can reproduce this problem?

BTW Does this problem also exit in NVida's card?

0 Likes