118 VkImageSubresourceRange subresource_range = {
119 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
126 VkImageSubresourceLayers subresource_layers = {
127 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
133 VkImageCopy copy_region = {
134 .srcSubresource = subresource_layers,
135 .srcOffset.x = src_offset.x,
136 .srcOffset.y = src_offset.y,
138 .dstSubresource = subresource_layers,
139 .dstOffset.x = dst_offset.x,
140 .dstOffset.y = dst_offset.y,
142 .extent.width = size.width,
143 .extent.height = size.height,
147 VkMemoryBarrier mem_barrier = {
148 .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER,
150 .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
151 .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
154 vkCmdPipelineBarrier(cmd_buf,
155 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
161 vkCmdCopyImage(cmd_buf,
162 qvk.
images[src_image_index], VK_IMAGE_LAYOUT_GENERAL,
163 qvk.
images[dst_image_index], VK_IMAGE_LAYOUT_GENERAL,