MCPcopy Create free account
hub / github.com/a2flo/floor / create_queue_internal

Method create_queue_internal

compute/vulkan/vulkan_compute.cpp:2545–2573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2543}
2544
2545shared_ptr<compute_queue> vulkan_compute::create_queue_internal(const compute_device& dev, const uint32_t family_index,
2546 const compute_queue::QUEUE_TYPE queue_type,
2547 uint32_t& queue_index) const {
2548 const auto& vulkan_dev = (const vulkan_device&)dev;
2549
2550 // can only create a certain amount of queues per device with Vulkan, so handle this + handle the queue index
2551 if (queue_index >= vulkan_dev.queue_counts[family_index]) {
2552 log_warn("too many queues were created for family $ (max: $), wrapping around to #0 again",
2553 family_index, vulkan_dev.queue_counts[family_index]);
2554 queue_index = 0;
2555 }
2556 const auto next_queue_index = queue_index++;
2557
2558 VkQueue queue_obj;
2559 vkGetDeviceQueue(vulkan_dev.device, family_index, next_queue_index, &queue_obj);
2560 if (queue_obj == nullptr) {
2561 log_error("failed to retrieve Vulkan device queue");
2562 return {};
2563 }
2564
2565 const string queue_name = (family_index == vulkan_dev.all_queue_family_index ?
2566 "queue:" + (next_queue_index == 0 ? "default" : to_string(next_queue_index)) :
2567 "compute_queue:" + (next_queue_index == 0 ? "default" : to_string(next_queue_index)));
2568 set_vulkan_debug_label(vulkan_dev, VK_OBJECT_TYPE_QUEUE, uint64_t(queue_obj), queue_name);
2569
2570 auto ret = make_shared<vulkan_queue>(dev, queue_obj, family_index, next_queue_index, queue_type);
2571 queues.push_back(ret);
2572 return ret;
2573}
2574
2575shared_ptr<compute_queue> vulkan_compute::create_queue(const compute_device& dev) const {
2576 const auto& vulkan_dev = (const vulkan_device&)dev;

Callers

nothing calls this directly

Calls 1

to_stringFunction · 0.50

Tested by

no test coverage detected