vulkan: Put the vertex buffer into the render object
authorBenjamin Otte <otte@redhat.com>
Sat, 8 Jul 2023 07:04:12 +0000 (09:04 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Jul 2023 10:13:00 +0000 (12:13 +0200)
commit70c9521caee8e4c13cbab40ddf1baad44b5f260e
tree98af2f79f102cb56c12be60d926f2d7e3ffe1788
parent1abcf3d48a8fa03ffaf5f4888a5534bcaea37f9f
vulkan: Put the vertex buffer into the render object

Renderpasses get recreated every frame, but we keep render objects
around. So if we keep the vertex buffer in the render object, we can
also keep it around and just reuse it.

Also, we only need one buffer for all the render passes, which is
another bonus.

The initial buffer size is chosen at 128kB. Maximized Nautilus,
gnome-text-editor with an open file and widget-factory take ~100kB when
doing a full redraw. Other apps are between 30-50kB usually.

So I chose a value that is not too big, but catches ~90% of cases.
gsk/vulkan/gskvulkanbuffer.c
gsk/vulkan/gskvulkanbufferprivate.h
gsk/vulkan/gskvulkanoffscreenop.c
gsk/vulkan/gskvulkanrender.c
gsk/vulkan/gskvulkanrenderpass.c
gsk/vulkan/gskvulkanrenderpassprivate.h