April 2017
Intermediate to advanced
700 pages
21h 36m
English
Data copy from an image to a buffer is an operation that is recorded to the command buffer like this:
if( regions.size() > 0 ) {
vkCmdCopyImageToBuffer( command_buffer, source_image, image_layout, destination_buffer, static_cast<uint32_t>(regions.size()), ®ions[0] );
}
The command buffer must be already in a recording state.
For the data to be copied properly, we need to provide multiple parameters that define the source of the data and the destination to which the data will be copied. These parameters consist of an offset from the image's origin (from the upper-left corner in texels) for x, y, and z dimensions, the mipmap level and a base array layer from which data will be copied, and the number of layers that will ...
Read now
Unlock full access