MCPcopy Create free account
hub / github.com/android/ndk-samples / pickPhysicalDevice

Method pickPhysicalDevice

hello-vulkan/app/src/main/cpp/hellovk.h:843–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841}
842
843void HelloVK::pickPhysicalDevice() {
844 uint32_t deviceCount = 0;
845 vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr);
846
847 assert(deviceCount > 0); // failed to find GPUs with Vulkan support!
848
849 std::vector<VkPhysicalDevice> devices(deviceCount);
850 vkEnumeratePhysicalDevices(instance, &deviceCount, devices.data());
851
852 for (const auto& device : devices) {
853 if (isDeviceSuitable(device)) {
854 physicalDevice = device;
855 break;
856 }
857 }
858
859 assert(physicalDevice != VK_NULL_HANDLE); // failed to find a suitable GPU!
860}
861// END DEVICE SUITABILITY
862
863void HelloVK::createLogicalDeviceAndQueue() {

Callers

nothing calls this directly

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected