#pragma once
#include "sync/sync_common.h"
#include "sync/sync_access_state.h"
struct SubpassDependencyGraphNode;
namespace vvl {
class Buffer;
class VideoSession;
class VideoPictureResource;
class Bindable;
class Event;
}
namespace syncval_state {
class ImageState;
class ImageViewState;
}
bool SimpleBinding(const vvl::Bindable &bindable);
VkDeviceSize ResourceBaseAddress(const vvl::Buffer &buffer);
template <typename RangeMap, typename RangeGen, typename Action>
bool ForEachEntryInRangesUntil(const RangeMap &map, RangeGen &range_gen, Action &action) { … }
struct NoopBarrierAction { … };
template <typename BarrierOp, typename OpVector = std::vector<BarrierOp>>
class ApplyBarrierOpsFunctor {
public:
using Iterator = ResourceAccessRangeMap::iterator;
inline Iterator Infill(ResourceAccessRangeMap *accesses, const Iterator &pos, const ResourceAccessRange &range) const { … }
void operator()(const Iterator &pos) const { … }
ApplyBarrierOpsFunctor(bool resolve, typename OpVector::size_type size_hint, ResourceUsageTag tag)
: … { … }
void EmplaceBack(const BarrierOp &op) { … }
private:
bool resolve_;
bool infill_default_;
OpVector barrier_ops_;
const ResourceUsageTag tag_;
};
template <typename BarrierOp>
class ApplyBarrierFunctor : public ApplyBarrierOpsFunctor<BarrierOp, small_vector<BarrierOp, 1>> { … };
class ResolvePendingBarrierFunctor : public ApplyBarrierOpsFunctor<NoopBarrierAction, small_vector<NoopBarrierAction, 1>> { … };
struct ApplySubpassTransitionBarriersAction { … };
struct QueueTagOffsetBarrierAction { … };
struct ApplyTrackbackStackAction { … };
template <typename SubpassNode>
struct SubpassBarrierTrackback { … };
class AttachmentViewGen { … };
AttachmentViewGenVector;
class AccessContext { … };
template <typename Action>
struct ActionToOpsAdapter { … };
template <typename Action>
void AccessContext::ApplyToContext(const Action &barrier_action) { … }
template <typename Action>
void AccessContext::UpdateMemoryAccessRangeState(ResourceAccessRangeMap &accesses, Action &action,
const ResourceAccessRange &range) { … }
template <typename Action, typename RangeGen>
void AccessContext::UpdateMemoryAccessState(const Action &action, RangeGen &range_gen) { … }
template <typename Action>
void AccessContext::ApplyUpdateAction(const AttachmentViewGen &view_gen, AttachmentViewGen::Gen gen_type, const Action &action) { … }
template <typename Detector, typename RangeGen>
HazardResult AccessContext::DetectAsyncHazard(const Detector &detector, const RangeGen &const_range_gen, ResourceUsageTag async_tag,
QueueId async_queue_id) const { … }
template <typename Detector>
HazardResult AccessContext::DetectHazardOneRange(Detector &detector, bool detect_prev, ResourceAccessRangeMap::const_iterator &pos,
const ResourceAccessRangeMap::const_iterator &the_end,
const ResourceAccessRange &range) const { … }
template <typename Detector>
HazardResult AccessContext::DetectHazardRange(Detector &detector, const ResourceAccessRange &range, DetectOptions options) const { … }
template <typename BarrierAction>
void AccessContext::ResolveAccessRange(const ResourceAccessRange &range, BarrierAction &barrier_action,
ResourceAccessRangeMap *resolve_map, const ResourceAccessState *infill_state,
bool recur_to_infill) const { … }
template <typename Detector, typename RangeGen>
HazardResult AccessContext::DetectHazardGeneratedRanges(Detector &detector, RangeGen &range_gen, DetectOptions options) const { … }
template <typename Detector>
HazardResult AccessContext::DetectPreviousHazard(Detector &detector, const ResourceAccessRange &range) const { … }
template <typename Predicate>
void AccessContext::EraseIf(Predicate &&pred) { … }
template <typename ResolveOp>
void AccessContext::ResolveFromContext(ResolveOp &&resolve_op, const AccessContext &from_context,
const ResourceAccessState *infill_state, bool recur_to_infill) { … }
template <typename ResolveOp, typename RangeGenerator>
void AccessContext::ResolveFromContext(ResolveOp &&resolve_op, const AccessContext &from_context, RangeGenerator range_gen,
const ResourceAccessState *infill_state, bool recur_to_infill) { … }
template <typename BarrierAction>
void AccessContext::ResolvePreviousAccessStack(const ResourceAccessRange &range, ResourceAccessRangeMap *descent_map,
const ResourceAccessState *infill_state,
const BarrierAction &previous_barrier) const { … }