X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Ftransferqueue.cpp;h=f6f3c6f5079f2c2a01812348616d8b1fb83ef367;hb=e9d24b3844110f8a545083bb0acbc504737aca88;hp=9fc941401ed90ef954b4a156ae7b1b801baf149f;hpb=7d221b1fd6194e59bc0783740a2a17ac71fa4da5;p=libs%2Fgl.git diff --git a/source/backends/vulkan/transferqueue.cpp b/source/backends/vulkan/transferqueue.cpp index 9fc94140..f6f3c6f5 100644 --- a/source/backends/vulkan/transferqueue.cpp +++ b/source/backends/vulkan/transferqueue.cpp @@ -27,7 +27,8 @@ void TransferQueue::allocate_staging(PendingTransfer &transfer, size_t size) transfer.size = size; transfer.staging_address = static_cast(i->mapped_address)+transfer.offset; - i->used += size; + i->used += size+47; + i->used -= i->used%48; ++i->async_count; } @@ -126,7 +127,7 @@ TransferQueue::StagingBuffer::StagingBuffer(Device &d, size_t s): MemoryAllocator &allocator = device.get_allocator(); memory_id = allocator.allocate(buffer, STAGING_MEMORY); - mapped_address = allocator.map(memory_id, 0, size); + mapped_address = allocator.map(memory_id); } TransferQueue::StagingBuffer::StagingBuffer(StagingBuffer &&other): @@ -149,7 +150,7 @@ TransferQueue::StagingBuffer::~StagingBuffer() if(mapped_address) { - allocator.unmap(mapped_address); + allocator.unmap(memory_id); allocator.release(memory_id); } if(buffer)