MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / RecordEndRenderPass

Method RecordEndRenderPass

layers/sync/sync_render_pass.cpp:938–977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

936}
937
938void RenderPassAccessContext::RecordEndRenderPass(AccessContext* external_context, const ResourceUsageTag store_tag,
939 const ResourceUsageTag transition_tag) {
940 const uint32_t view_mask = rp_state_->create_info.pSubpasses[current_subpass_].viewMask;
941
942 // Add the resolve and store accesses
943 UpdateAttachmentResolveAccess(*rp_state_, attachment_views_, render_pass_instance_id_, current_subpass_, view_mask, store_tag,
944 CurrentContext());
945 UpdateAttachmentStoreAccess(*rp_state_, attachment_views_, render_pass_instance_id_, current_subpass_, view_mask, store_tag,
946 CurrentContext());
947
948 // Export the accesses from the renderpass...
949 external_context->ResolveChildContexts(GetSubpassContexts());
950
951 // Add the "finalLayout" transitions to external
952 // Get them from where there we're hidding in the extra entry.
953 // Not that since *final* always comes from *one* subpass per view, we don't have to accumulate the barriers
954 // TODO Aliasing we may need to reconsider barrier accumulation... though I don't know that it would be valid for aliasing
955 // that had mulitple final layout transistions from mulitple final subpasses.
956 const auto& final_transitions = rp_state_->subpass_transitions.back();
957 for (const auto& transition : final_transitions) {
958 const AttachmentViewGen& view_gen = attachment_views_[transition.attachment];
959 const SubpassBarrier& dst_external_barrier = subpass_contexts_[transition.src_subpass].GetDstExternalSubpassBarrier();
960 assert(&subpass_contexts_[transition.src_subpass] == dst_external_barrier.src_subpass_context);
961
962 ImageRangeGen range_gen = view_gen.GetRangeGen(AttachmentViewGen::Gen::kViewSubresource);
963
964 ImageRangeGen markup_range_gen = range_gen; // second copy, preserve range_gen to use later
965 ApplyMarkupFunctor markup_action(true);
966 external_context->UpdateMemoryAccessState(markup_action, markup_range_gen);
967
968 PendingBarriers pending_barriers;
969 for (const auto& barrier : dst_external_barrier.barriers) {
970 const BarrierScope barrier_scope(barrier);
971 CollectBarriersFunctor collect_barriers(*external_context, barrier_scope, barrier, true, vvl::kNoIndex32,
972 pending_barriers);
973 external_context->UpdateMemoryAccessState(collect_barriers, range_gen);
974 }
975 pending_barriers.Apply(transition_tag);
976 }
977}
978
979AccessContext& RenderPassAccessContext::CurrentContext() {
980 assert(current_subpass_ < rp_state_->create_info.subpassCount);

Callers 1

RecordMethod · 0.45

Calls 5

ResolveChildContextsMethod · 0.80
ApplyMethod · 0.80
backMethod · 0.45
GetRangeGenMethod · 0.45

Tested by

no test coverage detected