chromium/third_party/vulkan-validation-layers/src/layers/sync/sync_access_state.cpp

/*
 * Copyright (c) 2019-2024 Valve Corporation
 * Copyright (c) 2019-2024 LunarG, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "sync/sync_utils.h"
#include "sync/sync_access_state.h"

ResourceAccessState::OrderingBarriers ResourceAccessState::kOrderingRules =;

// Apply a list of barriers, without resolving pending state, useful for subpass layout transitions
void ResourceAccessState::ApplyBarriers(const std::vector<SyncBarrier> &barriers, bool layout_transition) {}

// ApplyBarriers is design for *fully* inclusive barrier lists without layout tranistions.  Designed use was for
// inter-subpass barriers for lazy-evaluation of parent context memory ranges.  Subpass layout transistions are *not* done
// lazily, s.t. no previous access reports should need layout transitions.
void ResourceAccessState::ApplyBarriersImmediate(const std::vector<SyncBarrier> &barriers) {}
HazardResult ResourceAccessState::DetectHazard(const SyncStageAccessInfoType &usage_info) const {}

HazardResult ResourceAccessState::DetectHazard(const SyncStageAccessInfoType &usage_info, const SyncOrdering ordering_rule,
                                               QueueId queue_id) const {}

HazardResult ResourceAccessState::DetectHazard(const SyncStageAccessInfoType &usage_info, const OrderingBarrier &ordering,
                                               QueueId queue_id) const {}

HazardResult ResourceAccessState::DetectHazard(const ResourceAccessState &recorded_use, QueueId queue_id,
                                               const ResourceUsageRange &tag_range) const {}

// Asynchronous Hazards occur between subpasses with no connection through the DAG
HazardResult ResourceAccessState::DetectAsyncHazard(const SyncStageAccessInfoType &usage_info, const ResourceUsageTag start_tag,
                                                    QueueId queue_id) const {}

HazardResult ResourceAccessState::DetectAsyncHazard(const ResourceAccessState &recorded_use, const ResourceUsageRange &tag_range,
                                                    ResourceUsageTag start_tag, QueueId queue_id) const {}

HazardResult ResourceAccessState::DetectBarrierHazard(const SyncStageAccessInfoType &usage_info, QueueId queue_id,
                                                      VkPipelineStageFlags2KHR src_exec_scope,
                                                      const SyncStageAccessFlags &src_access_scope) const {}

HazardResult ResourceAccessState::DetectBarrierHazard(const SyncStageAccessInfoType &usage_info,
                                                      const ResourceAccessState &scope_state,
                                                      VkPipelineStageFlags2KHR src_exec_scope,
                                                      const SyncStageAccessFlags &src_access_scope, QueueId event_queue,
                                                      ResourceUsageTag event_tag) const {}
void ResourceAccessState::MergePending(const ResourceAccessState &other) {}

void ResourceAccessState::MergeReads(const ResourceAccessState &other) {}

// The logic behind resolves is the same as update, we assume that earlier hazards have be reported, and that no
// tranistive hazard can exists with a hazard between the earlier operations.  Yes, an early hazard can mask that another
// exists, but if you fix *that* hazard it either fixes or unmasks the subsequent ones.
void ResourceAccessState::Resolve(const ResourceAccessState &other) {}

void ResourceAccessState::Update(const SyncStageAccessInfoType &usage_info, SyncOrdering ordering_rule, ResourceUsageTagEx tag_ex) {}

void HazardResult::Set(const ResourceAccessState *access_state, const SyncStageAccessInfoType &usage_info, SyncHazard hazard,
                       const ResourceAccessWriteState &prior_write) {}

void HazardResult::Set(const ResourceAccessState *access_state, const SyncStageAccessInfoType &usage_info, SyncHazard hazard,
                       const SyncStageAccessFlags &prior, ResourceUsageTagEx tag_ex) {}

void HazardResult::AddRecordedAccess(const ResourceFirstAccess &first_access) {}
bool HazardResult::IsWAWHazard() const {}

// Clobber last read and all barriers... because all we have is DANGER, DANGER, WILL ROBINSON!!!
// if the last_reads/last_write were unsafe, we've reported them, in either case the prior access is irrelevant.
// We can overwrite them as *this* write is now after them.
//
// Note: intentionally ignore pending barriers and chains (i.e. don't apply or clear them), let ApplyPendingBarriers handle them.
void ResourceAccessState::SetWrite(const SyncStageAccessInfoType &usage_info, ResourceUsageTagEx tag_ex) {}

void ResourceAccessState::ClearWrite() {}

void ResourceAccessState::ClearRead() {}

void ResourceAccessState::ClearFirstUse() {}

void ResourceAccessState::ApplyPendingBarriers(const ResourceUsageTag tag) {}

// Assumes signal queue != wait queue
void ResourceAccessState::ApplySemaphore(const SemaphoreScope &signal, const SemaphoreScope wait) {}

// Read access predicate for queue wait
bool ResourceAccessState::WaitQueueTagPredicate::operator()(const ResourceAccessState::ReadState &read_access) const {}
bool ResourceAccessState::WaitQueueTagPredicate::operator()(const ResourceAccessState &access) const {}

// Read access predicate for queue wait
bool ResourceAccessState::WaitTagPredicate::operator()(const ResourceAccessState::ReadState &read_access) const {}
bool ResourceAccessState::WaitTagPredicate::operator()(const ResourceAccessState &access) const {}

// Present operations only matching only the *exactly* tagged present and acquire operations
bool ResourceAccessState::WaitAcquirePredicate::operator()(const ResourceAccessState::ReadState &read_access) const {}
bool ResourceAccessState::WaitAcquirePredicate::operator()(const ResourceAccessState &access) const {}

bool ResourceAccessState::FirstAccessInTagRange(const ResourceUsageRange &tag_range) const {}

void ResourceAccessState::OffsetTag(ResourceUsageTag offset) {}

static const SyncStageAccessFlags kAllSyncStageAccessBits =;
ResourceAccessState::ResourceAccessState()
    :{}

// This should be just Bits or Index, but we don't have an invalid state for Index
VkPipelineStageFlags2KHR ResourceAccessState::GetReadBarriers(const SyncStageAccessFlags &usage_bit) const {}

void ResourceAccessState::SetQueueId(QueueId id) {}

bool ResourceAccessState::IsWriteBarrierHazard(QueueId queue_id, VkPipelineStageFlags2KHR src_exec_scope,
                                               const SyncStageAccessFlags &src_access_scope) const {}

bool ResourceAccessState::WriteInSourceScopeOrChain(VkPipelineStageFlags2KHR src_exec_scope,
                                                    SyncStageAccessFlags src_access_scope) const {}

bool ResourceAccessState::WriteInQueueSourceScopeOrChain(QueueId queue, VkPipelineStageFlags2KHR src_exec_scope,
                                                         const SyncStageAccessFlags &src_access_scope) const {}

bool ResourceAccessState::WriteInEventScope(VkPipelineStageFlags2KHR src_exec_scope, const SyncStageAccessFlags &src_access_scope,
                                            QueueId scope_queue, ResourceUsageTag scope_tag) const {}

// As ReadStates must be unique by stage, this is as good a sort as needed
bool operator<(const ResourceAccessState::ReadState &lhs, const ResourceAccessState::ReadState &rhs) {}

void ResourceAccessState::Normalize() {}

void ResourceAccessState::GatherReferencedTags(ResourceUsageTagSet &used) const {}

bool ResourceAccessState::IsRAWHazard(const SyncStageAccessInfoType &usage_info) const {}

VkPipelineStageFlags2 ResourceAccessState::GetOrderedStages(QueueId queue_id, const OrderingBarrier &ordering) const {}

void ResourceAccessState::UpdateFirst(const ResourceUsageTagEx tag_ex, const SyncStageAccessInfoType &usage_info,
                                      SyncOrdering ordering_rule) {}

void ResourceAccessState::TouchupFirstForLayoutTransition(ResourceUsageTag tag, const OrderingBarrier &layout_ordering) {}

ResourceAccessState::ReadState::ReadState(VkPipelineStageFlags2KHR stage_, SyncStageAccessFlags access_,
                                          VkPipelineStageFlags2KHR barriers_, ResourceUsageTagEx tag_ex)
    :{}

void ResourceAccessState::ReadState::Set(VkPipelineStageFlags2KHR stage_, const SyncStageAccessFlags &access_,
                                         VkPipelineStageFlags2KHR barriers_, ResourceUsageTagEx tag_ex) {}

// Scope test including "queue submission order" effects.  Specifically, accesses from a different queue are not
// considered to be in "queue submission order" with barriers, events, or semaphore signalling, but any barriers
// that have bee applied (via semaphore) to those accesses can be chained off of.
bool ResourceAccessState::ReadState::ReadInQueueScopeOrChain(QueueId scope_queue, VkPipelineStageFlags2 exec_scope) const {}

VkPipelineStageFlags2 ResourceAccessState::ReadState::ApplyPendingBarriers() {}

ResourceAccessWriteState::ResourceAccessWriteState(const SyncStageAccessInfoType &usage_info, ResourceUsageTagEx tag_ex)
    :{}

bool ResourceAccessWriteState::IsWriteHazard(const SyncStageAccessInfoType &usage_info) const {}

bool ResourceAccessWriteState::IsOrdered(const OrderingBarrier &ordering, QueueId queue_id) const {}

bool ResourceAccessWriteState::IsWriteBarrierHazard(QueueId queue_id, VkPipelineStageFlags2KHR src_exec_scope,
                                                    const SyncStageAccessFlags &src_access_scope) const {}

void ResourceAccessWriteState::Set(const SyncStageAccessInfoType &usage_info, ResourceUsageTagEx tag_ex) {}

void ResourceAccessWriteState::MergeBarriers(const ResourceAccessWriteState &other) {}

void ResourceAccessWriteState::UpdatePendingBarriers(const SyncBarrier &barrier) {}

void ResourceAccessWriteState::ApplyPendingBarriers() {}

void ResourceAccessWriteState::UpdatePendingLayoutOrdering(const SyncBarrier &barrier) {}

void ResourceAccessWriteState::SetQueueId(QueueId id) {}

bool ResourceAccessWriteState::WriteInChain(VkPipelineStageFlags2KHR src_exec_scope) const {}

bool ResourceAccessWriteState::WriteInScope(const SyncStageAccessFlags &src_access_scope) const {}

bool ResourceAccessWriteState::WriteInSourceScopeOrChain(VkPipelineStageFlags2KHR src_exec_scope,
                                                         SyncStageAccessFlags src_access_scope) const {}

bool ResourceAccessWriteState::WriteInQueueSourceScopeOrChain(QueueId queue, VkPipelineStageFlags2KHR src_exec_scope,
                                                              const SyncStageAccessFlags &src_access_scope) const {}

bool ResourceAccessWriteState::WriteInEventScope(VkPipelineStageFlags2KHR src_exec_scope,
                                                 const SyncStageAccessFlags &src_access_scope, QueueId scope_queue,
                                                 ResourceUsageTag scope_tag) const {}

HazardResult::HazardState::HazardState(const ResourceAccessState *access_state_, const SyncStageAccessInfoType &usage_info_,
                                       SyncHazard hazard_, const SyncStageAccessFlags &prior_, ResourceUsageTagEx tag_ex)
    :{}

SyncExecScope SyncExecScope::MakeSrc(VkQueueFlags queue_flags, VkPipelineStageFlags2KHR mask_param,
                                     const VkPipelineStageFlags2KHR disabled_feature_mask) {}

SyncExecScope SyncExecScope::MakeDst(VkQueueFlags queue_flags, VkPipelineStageFlags2KHR mask_param) {}

SyncBarrier::SyncBarrier(const SyncExecScope &src, const SyncExecScope &dst)
    :{}

SyncBarrier::SyncBarrier(const SyncExecScope &src, const SyncExecScope &dst, const SyncBarrier::AllAccess &)
    :{}

SyncBarrier::SyncBarrier(VkQueueFlags queue_flags, const VkSubpassDependency2 &subpass) {}

SyncBarrier::SyncBarrier(const std::vector<SyncBarrier> &barriers) :{}
const char *string_SyncHazard(SyncHazard hazard) {}

const char *string_SyncHazardVUID(SyncHazard hazard) {}