MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Tools / DumpGroups

Function DumpGroups

vulkaninfo/vulkaninfo.cpp:315–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313#endif // defined(VULKANINFO_WSI_ENABLED)
314
315void DumpGroups(Printer &p, AppInstance &inst) {
316 if (inst.CheckExtensionEnabled(VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME)) {
317 auto groups = GetGroups(inst);
318 if (groups.size() == 0) {
319 p.SetHeader();
320 ObjectWrapper obj(p, "Groups");
321 p.PrintString("No Device Groups Found");
322 p.AddNewline();
323 return;
324 }
325
326 p.SetHeader();
327 ObjectWrapper obj_device_groups(p, "Device Groups");
328 IndentWrapper indent(p);
329
330 int group_id = 0;
331 for (auto &group : groups) {
332 ObjectWrapper obj_group(p, "Group " + std::to_string(group_id));
333 auto group_props = GetGroupProps(inst, group);
334 {
335 ObjectWrapper obj_properties(p, "Properties");
336 {
337 ArrayWrapper arr(p, "physicalDevices", group.physicalDeviceCount);
338 int id = 0;
339 for (auto &prop : group_props) {
340 p.PrintString(std::string(prop.deviceName) + " (ID: " + p.DecorateAsValue(std::to_string(id++)) + ")");
341 }
342 }
343 p.PrintKeyValue("subsetAllocation", group.subsetAllocation);
344 }
345 p.AddNewline();
346
347 auto group_capabilities = GetGroupCapabilities(inst, group);
348 if (!group_capabilities) {
349 p.PrintKeyString("Present Capabilities",
350 "Group does not support VK_KHR_device_group, skipping printing present capabilities");
351 } else {
352 ObjectWrapper obj_caps(p, "Present Capabilities");
353 for (uint32_t i = 0; i < group.physicalDeviceCount; i++) {
354 ObjectWrapper obj_device(
355 p, std::string(group_props[i].deviceName) + " (ID: " + p.DecorateAsValue(std::to_string(i)) + ")");
356 ArrayWrapper arr(p, "Can present images from the following devices", group.physicalDeviceCount);
357
358 for (uint32_t j = 0; j < group.physicalDeviceCount; j++) {
359 uint32_t mask = 1 << j;
360 if (group_capabilities->presentMask[i] & mask) {
361 p.PrintString(std::string(group_props[j].deviceName) + " (ID: " + p.DecorateAsValue(std::to_string(j)) +
362 ")");
363 }
364 }
365 }
366 DumpVkDeviceGroupPresentModeFlagsKHR(p, "Present modes", group_capabilities->modes);
367 }
368 p.AddNewline();
369 group_id++;
370 }
371 p.AddNewline();
372 }

Callers 1

RunPrinterFunction · 0.85

Calls 11

GetGroupsFunction · 0.85
GetGroupPropsFunction · 0.85
GetGroupCapabilitiesFunction · 0.85
CheckExtensionEnabledMethod · 0.80
PrintStringMethod · 0.80
AddNewlineMethod · 0.80
DecorateAsValueMethod · 0.80
PrintKeyValueMethod · 0.80
PrintKeyStringMethod · 0.80
to_stringFunction · 0.70

Tested by

no test coverage detected