MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / pickPhysicalDevice

Method pickPhysicalDevice

src/Renderer/vkRenderer.cpp:230–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void vkRenderer::pickPhysicalDevice() {
231 uint32_t deviceCount = 0;
232 vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr);
233
234 if (deviceCount == 0) {
235 throw std::runtime_error("failed to find GPUs with Vulkan support!");
236 }
237
238 std::vector<VkPhysicalDevice> devices(deviceCount);
239 vkEnumeratePhysicalDevices(instance, &deviceCount, devices.data());
240
241 for (const auto &device : devices) {
242 if (isDeviceSuitable(device)) {
243 physicalDevice = device;
244 break;
245 }
246 }
247
248 if (physicalDevice == VK_NULL_HANDLE) {
249 throw std::runtime_error("failed to find a suitable GPU!");
250 }
251}
252
253void vkRenderer::createLogicalDevice() {
254 QueueFamilyIndices indices = findQueueFamilies(physicalDevice);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected