Skip to content

vulkan/wsi: Increasing the minimum image count for X11

Bas Nieuwenhuizen requested to merge bnieuwenhuizen/mesa:wsi-overhead2 into master

For IMMEDIATE and FIFO, most games work in a pipelined manner where the can produce frames at a rate of 1/MAX(CPU duration, GPU duration), but the render latency is CPU duration + GPU duration.

This means that with scanout from pageflipping we need 3 frames to run full speed:

  1. CPU rendering work
  2. GPU rendering work
  3. scanout

Once we have a nonblocking acquire that returns a semaphore we can merge 1 and 3. Hence the ideal implementation needs only 2 images, but games cannot tellwe currently do not have an ideal implementation and that hence they need to allocate 3 images. So let us do it for them.

This is a tradeoff as it uses more memory than needed for non-fullscreen and non-performance intensive applications. Since Vulkan is primarily used for gaming on desktop Linux right now I think this is the more useful side of the tradeoff.

If toolkits really are a huge issue, I noticed GTK always uses the engine name "GTK", so we could override via driconf.

Alternatively we could try to find some hacky heuristic for what constitutes fullscreen.

Edited by Bas Nieuwenhuizen

Merge request reports