vulkan/overlay: keep allocating draw data until it can be reused
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 9 May 2019 16:52:11 +0000 (17:52 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 10 May 2019 20:54:48 +0000 (21:54 +0100)
commitad2b4aa37806779bdfc15d704940136c3db21eb4
tree95874913c44760605123a7eef76b4b9f963d52d1
parent877b371cbb2c51cd569d8e5bb3f00ef6d9724336
vulkan/overlay: keep allocating draw data until it can be reused

The original implementation assumed that we could allocate the same
amount of command buffers as the number of images in the swapchain.
But the application could potentially render much faster and rerender
into images that have been submitted for presentation but not yet
presented.

This change keeps on allocating command buffers, vertex buffer, vertex
indices as well as a semaphore and a fence for as long as we can't
reuse a previously submitted one.

This fixes rendering issues in the overlay at high frame rates.

v2: Don't recreate semaphores constantly (Józef)

v3: Drop useless surface & FreeCommandBuffers (Józef)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110655
Cc: 19.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Józef Kucia <joseph.kucia@gmail.com>
src/vulkan/overlay-layer/overlay.cpp