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

Method InitQueues

tests/framework/binding.cpp:297–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297void Device::InitQueues(const VkDeviceCreateInfo& info) {
298 uint32_t queue_node_count = physical_device_.queue_properties_.size();
299
300 queue_families_.resize(queue_node_count);
301 for (uint32_t i = 0; i < info.queueCreateInfoCount; i++) {
302 const auto& queue_create_info = info.pQueueCreateInfos[i];
303 auto queue_family_i = queue_create_info.queueFamilyIndex;
304 const auto& queue_family_prop = physical_device_.queue_properties_[queue_family_i];
305
306 QueueFamilyQueues& queue_storage = queue_families_[queue_family_i];
307 queue_storage.reserve(queue_create_info.queueCount);
308 for (uint32_t queue_i = 0; queue_i < queue_create_info.queueCount; ++queue_i) {
309 VkQueue queue = VK_NULL_HANDLE;
310 if (queue_create_info.flags) {
311 VkDeviceQueueInfo2 queue_info = vku::InitStructHelper();
312 queue_info.flags = queue_create_info.flags;
313 queue_info.queueFamilyIndex = queue_family_i;
314 queue_info.queueIndex = queue_i;
315 vk::GetDeviceQueue2(handle(), &queue_info, &queue);
316 } else {
317 vk::GetDeviceQueue(handle(), queue_family_i, queue_i, &queue);
318 }
319
320 // Store single copy of the queue object that will self destruct
321 queue_storage.emplace_back(new Queue(queue, queue_family_i));
322
323 if (queue_family_prop.queueFlags & VK_QUEUE_GRAPHICS_BIT) {
324 queues_[GRAPHICS].push_back(queue_storage.back().get());
325 }
326
327 if (queue_family_prop.queueFlags & VK_QUEUE_COMPUTE_BIT) {
328 queues_[COMPUTE].push_back(queue_storage.back().get());
329 }
330
331 if (queue_family_prop.queueFlags & VK_QUEUE_TRANSFER_BIT) {
332 queues_[TRANSFER].push_back(queue_storage.back().get());
333 }
334
335 if (queue_family_prop.queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) {
336 queues_[SPARSE].push_back(queue_storage.back().get());
337 }
338
339 if (queue_family_prop.queueFlags & VK_QUEUE_VIDEO_DECODE_BIT_KHR) {
340 queues_[VIDEO_DECODE].push_back(queue_storage.back().get());
341 }
342
343 if (queue_family_prop.queueFlags & VK_QUEUE_VIDEO_ENCODE_BIT_KHR) {
344 queues_[VIDEO_ENCODE].push_back(queue_storage.back().get());
345 }
346
347 if (queue_family_prop.queueFlags & VK_QUEUE_DATA_GRAPH_BIT_ARM) {
348 queues_[DATA_GRAPH].push_back(queue_storage.back().get());
349 }
350 }
351 }
352}
353
354const Device::QueueFamilyQueues& Device::QueuesFromFamily(uint32_t queue_family) const {

Callers

nothing calls this directly

Calls 8

GetDeviceQueue2Function · 0.85
GetDeviceQueueFunction · 0.85
emplace_backMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45
reserveMethod · 0.45
push_backMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected