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

Function find_display_gpu

cube/cube.cpp:1453–1475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1451}
1452#if defined(VK_USE_PLATFORM_DISPLAY_KHR)
1453int find_display_gpu(int gpu_number, const std::vector<vk::PhysicalDevice> &physical_devices) {
1454 uint32_t display_count = 0;
1455 int gpu_return = gpu_number;
1456 if (gpu_number >= 0) {
1457 auto display_props_return = physical_devices[gpu_number].getDisplayPropertiesKHR();
1458 VERIFY(display_props_return.result == vk::Result::eSuccess);
1459 display_count = static_cast<uint32_t>(display_props_return.value.size());
1460 } else {
1461 for (uint32_t i = 0; i < physical_devices.size(); i++) {
1462 auto display_props_return = physical_devices[i].getDisplayPropertiesKHR();
1463 VERIFY(display_props_return.result == vk::Result::eSuccess);
1464 if (display_props_return.value.size() > 0) {
1465 display_count = static_cast<uint32_t>(display_props_return.value.size());
1466 gpu_return = i;
1467 break;
1468 }
1469 }
1470 }
1471 if (display_count > 0)
1472 return gpu_return;
1473 else
1474 return -1;
1475}
1476#endif
1477VKAPI_ATTR vk::Bool32 VKAPI_CALL Demo::debug_messenger_callback(vk::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
1478 vk::DebugUtilsMessageTypeFlagsEXT messageType,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected