render/vulkan: Recycle memory maps for stage spans

Remapping buffers on every use causes a lot of unwanted pagefaults.
Reuse the mapping to significantly speed up the memcpy.
This commit is contained in:
Kenny Levinsen 2024-06-20 01:56:09 +02:00 committed by Alexander Orzechowski
parent 09603cdb0b
commit 47c578945c
3 changed files with 14 additions and 12 deletions

View file

@ -187,6 +187,10 @@ static void shared_buffer_destroy(struct wlr_vk_renderer *r,
if (buffer->memory) {
vkFreeMemory(r->dev->dev, buffer->memory, NULL);
}
if (buffer->cpu_mapping) {
vkUnmapMemory(r->dev->dev, buffer->memory);
buffer->cpu_mapping = NULL;
}
wl_list_remove(&buffer->link);
free(buffer);