X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fbuffer_backend.cpp;h=bde76beaf8119b5985203b593117b0b799a2311b;hb=HEAD;hp=750c926bf2e90c0ff5feacd7a299febaa3a453ba;hpb=b294ef47df0ae87c42fe8114987817fb28326f10;p=libs%2Fgl.git diff --git a/source/backends/vulkan/buffer_backend.cpp b/source/backends/vulkan/buffer_backend.cpp index 750c926b..bde76bea 100644 --- a/source/backends/vulkan/buffer_backend.cpp +++ b/source/backends/vulkan/buffer_backend.cpp @@ -70,14 +70,13 @@ bool VulkanBuffer::can_map() const void *VulkanBuffer::map() { - size_t size = static_cast(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; } @@ -122,14 +121,12 @@ void Buffer::AsyncTransfer::allocate() [&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); }); } }