MCPcopy Create free account
hub / github.com/DragonJoker/RenderGraph / copyImage

Method copyImage

source/RenderGraph/RecordContext.cpp:467–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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, &region );
487
488 if ( finalLayout != ImageLayout::eUndefined )
489 memoryBarrier( commandBuffer, dstView, makeLayoutState( finalLayout ) );
490 }
491
492 void RecordContext::blitImage( VkCommandBuffer commandBuffer
493 , uint32_t index

Callers

nothing calls this directly

Calls 3

getSubresourceLayerFunction · 0.85
makeLayoutStateFunction · 0.85
createImageMethod · 0.45

Tested by

no test coverage detected