| 465 | } |
| 466 | |
| 467 | void RecordContext::copyImage( VkCommandBuffer commandBuffer |
| 468 | , uint32_t index |
| 469 | , ImageViewId srcView |
| 470 | , ImageViewId dstView |
| 471 | , Extent2D const & extent |
| 472 | , ImageLayout finalLayout ) |
| 473 | { |
| 474 | runImplicitTransition( commandBuffer, index, srcView ); |
| 475 | auto & srcSubresource = getSubresourceRange( srcView ); |
| 476 | auto & dstSubresource = getSubresourceRange( dstView ); |
| 477 | VkImageCopy region{ getSubresourceLayer( srcSubresource ), VkOffset3D{ 0u, 0u, 0u } |
| 478 | , getSubresourceLayer( dstSubresource ), VkOffset3D{ 0u, 0u, 0u } |
| 479 | , { extent.width, extent.height, 1u } }; |
| 480 | memoryBarrier( commandBuffer, srcView, makeLayoutState( ImageLayout::eTransferSrc ) ); |
| 481 | memoryBarrier( commandBuffer, dstView, makeLayoutState( ImageLayout::eTransferDst ) ); |
| 482 | auto & resources = getResources(); |
| 483 | resources->vkCmdCopyImage( commandBuffer |
| 484 | , resources.createImage( srcView.data->image ), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL |
| 485 | , resources.createImage( dstView.data->image ), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL |
| 486 | , 1u, ®ion ); |
| 487 | |
| 488 | if ( finalLayout != ImageLayout::eUndefined ) |
| 489 | memoryBarrier( commandBuffer, dstView, makeLayoutState( finalLayout ) ); |
| 490 | } |
| 491 | |
| 492 | void RecordContext::blitImage( VkCommandBuffer commandBuffer |
| 493 | , uint32_t index |
nothing calls this directly
no test coverage detected