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

Method blitImage

source/RenderGraph/RecordContext.cpp:492–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490 }
491
492 void RecordContext::blitImage( VkCommandBuffer commandBuffer
493 , uint32_t index
494 , ImageViewId srcView
495 , ImageViewId dstView
496 , Rect2D const & srcRect
497 , Rect2D const & dstRect
498 , FilterMode filter
499 , ImageLayout finalLayout )
500 {
501 runImplicitTransition( commandBuffer, index, srcView );
502 auto & srcSubresource = getSubresourceRange( srcView );
503 auto & dstSubresource = getSubresourceRange( dstView );
504 memoryBarrier( commandBuffer, srcView, makeLayoutState( ImageLayout::eTransferSrc ) );
505 memoryBarrier( commandBuffer, dstView, makeLayoutState( ImageLayout::eTransferDst ) );
506 auto & resources = getResources();
507 VkImageBlit region{ getSubresourceLayer( srcSubresource ), { VkOffset3D{ srcRect.offset.x, srcRect.offset.y, 0u }, VkOffset3D{ int32_t( srcRect.extent.width ), int32_t( srcRect.extent.height ), 1 } }
508 , getSubresourceLayer( dstSubresource ), { VkOffset3D{ dstRect.offset.x, dstRect.offset.y, 0u }, VkOffset3D{ int32_t( dstRect.extent.width ), int32_t( dstRect.extent.height ), 1 } } };
509 resources->vkCmdBlitImage( commandBuffer
510 , resources.createImage( srcView.data->image ), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
511 , resources.createImage( dstView.data->image ), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
512 , 1u, &region, convert( filter ) );
513
514 if ( finalLayout != ImageLayout::eUndefined )
515 memoryBarrier( commandBuffer, dstView, makeLayoutState( finalLayout ) );
516 }
517
518 void RecordContext::clearAttachment( VkCommandBuffer commandBuffer
519 , ImageViewId dstView

Callers

nothing calls this directly

Calls 4

makeLayoutStateFunction · 0.85
getSubresourceLayerFunction · 0.85
convertFunction · 0.70
createImageMethod · 0.45

Tested by

no test coverage detected