| 728 | } |
| 729 | |
| 730 | bool QueueBatchContext::ValidateSubmit(const std::vector<CommandBufferConstPtr>& command_buffers, uint64_t submit_index, |
| 731 | uint32_t batch_index, std::vector<std::string>& current_label_stack, |
| 732 | const ErrorObject& error_obj) { |
| 733 | bool skip = false; |
| 734 | |
| 735 | BatchAccessLog::BatchRecord batch{queue_state_, submit_index, batch_index}; |
| 736 | uint32_t tag_count = 0; |
| 737 | for (const auto& cb : command_buffers) { |
| 738 | if (!cb) continue; |
| 739 | tag_count += static_cast<uint32_t>(SubState(*cb).access_context.GetTagCount()); |
| 740 | } |
| 741 | batch.base_tag = SetupBatchTags(tag_count); |
| 742 | |
| 743 | for (size_t index = 0; index < command_buffers.size(); index++) { |
| 744 | const auto& cb = SubState(*command_buffers[index]); |
| 745 | // Validate and resolve command buffers that has tagged commands |
| 746 | const CommandBufferAccessContext& access_context = cb.access_context; |
| 747 | if (access_context.GetTagCount() > 0) { |
| 748 | skip |= ReplayState(*this, access_context, error_obj, uint32_t(index), batch.base_tag).ValidateFirstUse(); |
| 749 | // The barriers have already been applied in ValidatFirstUse |
| 750 | batch_log_.Import(batch, access_context, current_label_stack); |
| 751 | ResolveSubmittedCommandBuffer(access_context.GetCurrentAccessContext(), batch.base_tag); |
| 752 | batch.base_tag += access_context.GetTagCount(); |
| 753 | } |
| 754 | // Apply debug label commands |
| 755 | vvl::CommandBuffer::ReplayLabelCommands(cb.base.GetLabelCommands(), current_label_stack); |
| 756 | batch.cb_index++; |
| 757 | } |
| 758 | return skip; |
| 759 | } |
| 760 | |
| 761 | QueueBatchContext::PresentResourceRecord::Base_::Record QueueBatchContext::PresentResourceRecord::MakeRecord() const { |
| 762 | return std::make_unique<PresentResourceRecord>(presented_); |
no test coverage detected