From 0b912795d0daf33c234b97f7d1cc35ecd991fbe9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 1 Apr 2022 15:14:56 +0900 Subject: [PATCH] [vulkan] Use host-cached memory for staging buffers It makes a significant difference to level load times (approximately halves them for demo1 and demo2). Nicely, it turns out I had implemented the rest of the staging buffer code (in particular, flushing) correctly in that it seems there's no corruption any of the data. --- libs/video/renderer/vulkan/staging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/video/renderer/vulkan/staging.c b/libs/video/renderer/vulkan/staging.c index 660e61a64..e16aa49df 100644 --- a/libs/video/renderer/vulkan/staging.c +++ b/libs/video/renderer/vulkan/staging.c @@ -55,7 +55,7 @@ QFV_CreateStagingBuffer (qfv_device_t *device, const char *name, size_t size, QFV_duSetObjectName (device, VK_OBJECT_TYPE_BUFFER, stage->buffer, dsprintf (str, "staging:buffer:%s", name)); stage->memory = QFV_AllocBufferMemory (device, stage->buffer, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT, size, 0); QFV_duSetObjectName (device, VK_OBJECT_TYPE_DEVICE_MEMORY, stage->memory, dsprintf (str, "staging:memory:%s", name));