From 47307dc7c141464b2d3b115875ca312ad1da389f Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 16 Mar 2024 22:32:03 +0100 Subject: [PATCH] vulkan: Prefer cached buffer memory We write the buffers in small chunks, and we even sometimes read it. So prefer it when it's cached. Speeds up the text benchmarks by a factor of 3x on my dedicated GPU. --- gsk/gpu/gskvulkanbuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gsk/gpu/gskvulkanbuffer.c b/gsk/gpu/gskvulkanbuffer.c index 93dbba0b0f..7a5e79c76b 100644 --- a/gsk/gpu/gskvulkanbuffer.c +++ b/gsk/gpu/gskvulkanbuffer.c @@ -97,7 +97,8 @@ gsk_vulkan_buffer_new_internal (GskVulkanDevice *device, self->allocator = gsk_vulkan_device_find_allocator (device, requirements.memoryTypeBits, GSK_VULKAN_MEMORY_MAPPABLE, - GSK_VULKAN_MEMORY_MAPPABLE); + GSK_VULKAN_MEMORY_MAPPABLE | + VK_MEMORY_PROPERTY_HOST_CACHED_BIT); gsk_vulkan_alloc (self->allocator, requirements.size, requirements.alignment,