In Vulkan, to upload data to a buffer, we are not limited only to the memory mapping technique. It is possible to copy data between buffers, even if the memory objects bound to them were allocated from different memory types.
Copying data between buffers
How to do it...
- Take the handle of a command buffer. Store it in a variable of type VkCommandBuffer named command_buffer. Make sure the command buffer is in the recording state (refer to the Beginning a command buffer recording operation recipe from Chapter 3, Command Buffers and Synchronization).
- Take the buffer from which data will be copied. Represent this buffer with a variable of type VkBuffer named source_buffer.
- Take the buffer to which data will be uploaded. Represent this buffer using a variable of type...