| 609 | } |
| 610 | |
| 611 | void SyncValidator::FinishDeviceSetup(const VkDeviceCreateInfo* pCreateInfo, const Location& loc) { |
| 612 | // The state tracker sets up the device state |
| 613 | BaseClass::FinishDeviceSetup(pCreateInfo, loc); |
| 614 | |
| 615 | // Returns queues in the same order as advertised by the driver. |
| 616 | // This allows to have deterministic QueueId between runs that simplifies debugging. |
| 617 | auto get_sorted_queues = [this]() { |
| 618 | std::vector<std::shared_ptr<vvl::Queue>> queues; |
| 619 | device_state->ForEachShared<vvl::Queue>( |
| 620 | [&queues](const std::shared_ptr<vvl::Queue>& queue) { queues.emplace_back(queue); }); |
| 621 | std::sort(queues.begin(), queues.end(), [](const auto& q1, const auto& q2) { |
| 622 | return (q1->queue_family_index < q2->queue_family_index) || |
| 623 | (q1->queue_family_index == q2->queue_family_index && q1->queue_index < q2->queue_index); |
| 624 | }); |
| 625 | return queues; |
| 626 | }; |
| 627 | queue_states_.reserve(device_state->Count<vvl::Queue>()); |
| 628 | for (const auto& queue : get_sorted_queues()) { |
| 629 | queue_states_.emplace_back(QueueState(queue, queue_id_limit_++)); |
| 630 | } |
| 631 | |
| 632 | const auto env_debug_command_number = GetEnvironment("VK_SYNCVAL_DEBUG_COMMAND_NUMBER"); |
| 633 | if (!env_debug_command_number.empty()) { |
| 634 | debug_command_number = static_cast<uint32_t>(std::stoul(env_debug_command_number)); |
| 635 | } |
| 636 | const auto env_debug_reset_count = GetEnvironment("VK_SYNCVAL_DEBUG_RESET_COUNT"); |
| 637 | if (!env_debug_reset_count.empty()) { |
| 638 | debug_reset_count = static_cast<uint32_t>(std::stoul(env_debug_reset_count)); |
| 639 | } |
| 640 | debug_cmdbuf_pattern = GetEnvironment("VK_SYNCVAL_DEBUG_CMDBUF_PATTERN"); |
| 641 | text::ToLower(debug_cmdbuf_pattern); |
| 642 | } |
| 643 | |
| 644 | void SyncValidator::PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator, |
| 645 | const RecordObject& record_obj) { |
nothing calls this directly
no test coverage detected