| 631 | } |
| 632 | |
| 633 | std::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 | |
| 655 | QueueId QueueBatchContext::GetQueueId() const { |
| 656 | QueueId id = queue_state_ ? queue_state_->GetQueueId() : kQueueIdInvalid; |
no test coverage detected