src/core/VulkanDevice.cpp
void VulkanDevice::copyBuffer(Buffer *src, Buffer *dst, VkQueue queue, VkBufferCopy *copyRegion) {
    assert(dst->size <= src->size);
    assert(src->buffer);
    VkCommandBuffer copyCmd = createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
    VkBufferCopy bufferCopy{};
    if (copyRegion == nullptr) {
        bufferCopy.size = src->size;
    } else {
        bufferCopy = *copyRegion;
    }

    vkCmdCopyBuffer(copyCmd, src->buffer, dst->buffer, 1, &bufferCopy);

    flushCommandBuffer(copyCmd, queue);
}
/**
* Copy Buffer data from src to dst using VkCmdCopyBuffer
*
* @param src Pointer to the source buffer to copy from
* @param dst Pointer to the destination buffer to copy to
* @param queue Pointer
* @param copyRegion (Optional) Pointer to a copy region, if NULL, the whole buffer is copied
*
* @note Source and destination pointers must have the appropriate transfer usage flags set (TRANSFER_SRC / TRANSFER_DST)
*/
Copy Buffer data from src to dst using VkCmdCopyBuffer
Copy Buffer data from src to dst using VkCmdCopyBuffer
void VulkanDevice::copyBuffer(Buffer *src, Buffer *dst, VkQueue queue, VkBufferCopy *copyRegion) {
    assert(dst->size <= src->size);
    assert(src->buffer);
    VkCommandBuffer copyCmd = createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
    VkBufferCopy bufferCopy{};
    if (copyRegion == nullptr) {
        bufferCopy.size = src->size;
    } else {
        bufferCopy = *copyRegion;
    }
    vkCmdCopyBuffer(copyCmd, src->buffer, dst->buffer, 1, &bufferCopy);
    flushCommandBuffer(copyCmd, queue);
}
void VulkanDevice :: copyBuffer ( Buffer * src , Buffer * dst , VkQueue queue , VkBufferCopy * copyRegion ) { assert ( dst -> size <= src -> size ) ; assert ( src -> buffer ) ; VkCommandBuffer copyCmd = createCommandBuffer ( VK_COMMAND_BUFFER_LEVEL_PRIMARY , true ) ; VkBufferCopy bufferCopy { } ; if ( copyRegion == nullptr ) { bufferCopy . size = src -> size ; } else { bufferCopy = * copyRegion ; } vkCmdCopyBuffer ( copyCmd , src -> buffer , dst -> buffer , 1 , & bufferCopy ) ; flushCommandBuffer ( copyCmd , queue ) ; }
Copy Buffer data from src to dst using VkCmdCopyBuffer
Copy Buffer data from src to dst using VkCmdCopyBuffer