]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/buffer_backend.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / backends / vulkan / buffer_backend.cpp
index 750c926bf2e90c0ff5feacd7a299febaa3a453ba..bde76beaf8119b5985203b593117b0b799a2311b 100644 (file)
@@ -70,14 +70,13 @@ bool VulkanBuffer::can_map() const
 
 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;
 }
@@ -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, &region);
+                               vkCmd.CopyBuffer(staging_buf, buf.handle, 1, &region);
                        });
        }
 }