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

Method addOwnAttach

source/RenderGraph/FramePass.cpp:716–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714 }
715
716 Attachment const * FramePass::addOwnAttach( ImageViewIdArray views, std::string attachName
717 , Attachment::FlagKind flags, ImageAttachment::FlagKind imageFlags
718 , AttachmentLoadOp loadOp, AttachmentStoreOp storeOp
719 , AttachmentLoadOp stencilLoadOp, AttachmentStoreOp stencilStoreOp
720 , ClearValue clearValue, PipelineColorBlendAttachmentState blendState
721 , ImageLayout wantedLayout
722 , Attachment const * parent )
723 {
724 if ( views.front().data->source.empty() )
725 return addOwnAttach( new Attachment{ flags
726 , *this, std::move( attachName )
727 , imageFlags
728 , std::move( views )
729 , loadOp, storeOp
730 , stencilLoadOp, stencilStoreOp
731 , std::move( clearValue )
732 , std::move( blendState )
733 , wantedLayout
734 , Attachment::Token{} }
735 , parent );
736
737 // Dispatch merged views sources in source attachs views
738 std::vector< ImageViewIdArray > sourceAttachsViews;
739 sourceAttachsViews.resize( views.front().data->source.size() );
740 for ( auto view : views )
741 {
742 for ( uint32_t i = 0u; i < view.data->source.size(); ++i )
743 sourceAttachsViews[i].push_back( view.data->source[i] );
744 }
745
746 // Use these views to create attachs
747 uint32_t index{};
748 std::vector< AttachmentPtr > sources;
749 for ( auto & sourceViews : sourceAttachsViews )
750 {
751 sources.push_back( std::make_unique< Attachment >( flags
752 , *this, attachName + std::to_string( index )
753 , imageFlags
754 , std::move( sourceViews )
755 , loadOp, storeOp
756 , stencilLoadOp, stencilStoreOp
757 , clearValue, blendState
758 , wantedLayout
759 , Attachment::Token{} ) );
760 ++index;
761 }
762
763 // Create the resulting attach
764 auto result = addOwnAttach( new Attachment{ flags
765 , *this, std::move( attachName )
766 , imageFlags
767 , std::move( views )
768 , loadOp, storeOp
769 , stencilLoadOp, stencilStoreOp
770 , std::move( clearValue )
771 , std::move( blendState )
772 , wantedLayout
773 , Attachment::Token{} }

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.80
initSourcesMethod · 0.80
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected