| 84 | } |
| 85 | |
| 86 | static LayerLayoutStatesMap gatherNextImageLayouts( LayerLayoutStatesMap currentLayouts |
| 87 | , std::vector< RunnablePassPtr >::iterator nextPassIt |
| 88 | , std::vector< RunnablePassPtr >::iterator endIt ) |
| 89 | { |
| 90 | LayerLayoutStatesMap result; |
| 91 | |
| 92 | while ( !currentLayouts.empty() |
| 93 | && endIt != nextPassIt ) |
| 94 | { |
| 95 | if ( auto const & nextPass = **nextPassIt; |
| 96 | nextPass.isEnabled() ) |
| 97 | { |
| 98 | auto & nextLayouts = nextPass.getImageLayouts(); |
| 99 | LayerLayoutStates layoutStates; |
| 100 | auto currIt = std::find_if( currentLayouts.begin() |
| 101 | , currentLayouts.end() |
| 102 | , [&nextLayouts, &layoutStates]( LayerLayoutStatesMap::value_type const & lookup ) |
| 103 | { |
| 104 | layoutStates = mergeRanges( nextLayouts, lookup ); |
| 105 | return !layoutStates.empty(); |
| 106 | } ); |
| 107 | |
| 108 | if ( currIt != currentLayouts.end() ) |
| 109 | { |
| 110 | result.try_emplace( currIt->first, layoutStates ); |
| 111 | currentLayouts.erase( currIt ); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | ++nextPassIt; |
| 116 | } |
| 117 | |
| 118 | return result; |
| 119 | } |
| 120 | |
| 121 | static PipelineState getNextState( PipelineState currentState |
| 122 | , std::vector< RunnablePassPtr >::iterator nextPassIt |