April 2017
Intermediate to advanced
700 pages
21h 36m
English
Copying data between buffers is another way of updating the memory contents of a given resource. This operation needs to be recorded to the command buffer, like this:
if( regions.size() > 0 ) {
vkCmdCopyBuffer( command_buffer, source_buffer, destination_buffer, static_cast<uint32_t>(regions.size()), ®ions[0] );
}
For the best performance, resources that are used during rendering should have a device-local memory bound. But, we can't map such memory. Using the vkCmdCopyBuffer() function, we can copy data to such a buffer from another buffer that has a host-visible memory bound to it. Such memory can be mapped and updated directly from our application.
Buffers from which data can be copied must be created with a VK_BUFFER_USAGE_TRANSFER_SRC_BIT ...
Read now
Unlock full access