[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.
This commit is contained in:
Bill Currie 2022-04-01 15:14:56 +09:00
parent 56715e6796
commit 6d0abd42bb

View file

@ -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));