void *VulkanBuffer::map()
{
- size_t size = static_cast<const Buffer *>(this)->size;
- mapped_address = device.get_allocator().map(memory_id, 0, size);
+ mapped_address = device.get_allocator().map(memory_id);
return mapped_address;
}
bool VulkanBuffer::unmap()
{
- device.get_allocator().unmap(mapped_address);
+ device.get_allocator().unmap(memory_id);
mapped_address = 0;
return true;
}
[&buf, off, sz](){
buf.device.get_synchronizer().write_buffer(buf.handle, off, sz);
},
- [&buf, off, sz](VkCommandBuffer cmd_buf, VkBuffer staging_buf, size_t src_off){
- const VulkanFunctions &vk = buf.device.get_functions();
-
+ [&buf, off, sz](const VulkanCommandRecorder &vkCmd, VkBuffer staging_buf, size_t src_off){
VkBufferCopy region = { };
region.srcOffset = src_off;
region.dstOffset = off;
region.size = sz;
- vk.CmdCopyBuffer(cmd_buf, staging_buf, buf.handle, 1, ®ion);
+ vkCmd.CopyBuffer(staging_buf, buf.handle, 1, ®ion);
});
}
}