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

Method RegisterAsyncContexts

layers/sync/sync_submit.cpp:633–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

631}
632
633std::vector<BatchContextPtr> QueueBatchContext::RegisterAsyncContexts(const std::vector<BatchContextPtr>& batches_resolved) {
634 // Gather async context information for hazard checks and conserve the QBC's for the async batches
635 auto skip_resolved_filter = [&batches_resolved](auto& batch) { return !vvl::Contains(batches_resolved, batch); };
636 std::vector<BatchContextPtr> async_batches = sync_state_.GetLastBatches(skip_resolved_filter);
637 for (const auto& async_batch : async_batches) {
638 const QueueId async_queue = async_batch->GetQueueId();
639 ResourceUsageTag sync_tag;
640 if (async_queue < queue_sync_tag_.size()) {
641 sync_tag = queue_sync_tag_[async_queue];
642 } else {
643 // If this isn't from a tracked queue, just check the batch itself
644 sync_tag = async_batch->tag_range_.begin;
645 }
646
647 // The start of the asynchronous access range for a given queue is one more than the highest tagged reference
648 access_context_.AddAsyncContext(async_batch->GetCurrentAccessContext(), sync_tag, async_batch->GetQueueId());
649 // We need to snapshot the async log information for async hazard reporting
650 batch_log_.Import(async_batch->batch_log_);
651 }
652 return async_batches;
653}
654
655QueueId QueueBatchContext::GetQueueId() const {
656 QueueId id = queue_state_ ? queue_state_->GetQueueId() : kQueueIdInvalid;

Callers 3

ProcessQueuePresentMethod · 0.80
ProcessQueueSubmitMethod · 0.80

Calls 6

ContainsFunction · 0.85
GetLastBatchesMethod · 0.80
AddAsyncContextMethod · 0.80
GetQueueIdMethod · 0.45
sizeMethod · 0.45
ImportMethod · 0.45

Tested by

no test coverage detected