- tell the memory allocator when we are going to persistently map something

This commit is contained in:
Magnus Norddahl 2019-02-28 01:18:29 +01:00
commit 9a5112c1c9
3 changed files with 8 additions and 7 deletions

View file

@ -40,7 +40,7 @@ void VKBuffer::SetData(size_t size, const void *data, bool staticdata)
else
{
BufferBuilder builder;
builder.setUsage(mBufferType, VMA_MEMORY_USAGE_CPU_TO_GPU);
builder.setUsage(mBufferType, VMA_MEMORY_USAGE_CPU_TO_GPU, mPersistent ? VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT : 0);
builder.setSize(size);
mBuffer = builder.create(fb->device);