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

Method FinishDeviceSetup

layers/sync/sync_validation.cpp:611–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610
611void 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
644void SyncValidator::PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator,
645 const RecordObject& record_obj) {

Callers

nothing calls this directly

Calls 8

QueueStateClass · 0.85
GetEnvironmentFunction · 0.85
ToLowerFunction · 0.85
emplace_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
reserveMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected