vulkan: Create multiple render objects
authorBenjamin Otte <otte@redhat.com>
Wed, 24 May 2023 14:55:18 +0000 (16:55 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 4 Jun 2023 17:42:01 +0000 (19:42 +0200)
commit5409f0b35061e43c808b7ab4ae973a08562c5577
tree1e1b5b98032647a2eefc690c3a960a2ef337d6bb
parentf1b1aacc343f94ba03669e1e1765ccf098c5c0bd
vulkan: Create multiple render objects

Sometimes the GPU is still busy when the next frame starts (like when
no-vsync benchmarking), so we need to keep all those resources alone and
create new ones.
That's what the render object is for, so we just create another one.

However, when we create too many, we'll starve the CPU. So we'll limit
it. Currently, that limit is at 4, but I've never reached it (I've also
not starved the GPU yet), so that number may want to be set lower/higher
in the future.

Note that this is different from the number of outstanding buffers, as
those are not busy on the GPU but on the compositor, and as such a
buffer may have not finished rendering but have been returend from the
compositor (very busy GPU) or have finished rendering but not been
returned from the compositor (very idle GPU).
gsk/vulkan/gskvulkanrender.c
gsk/vulkan/gskvulkanrenderer.c
gsk/vulkan/gskvulkanrenderprivate.h