/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include #include #include namespace OpenVulkano::Vulkan { class Device; class DeviceManager final { std::vector> devices; public: DeviceManager() = default; DeviceManager(const vk::Instance& instance) { Init(instance); } ~DeviceManager() { if (!devices.empty()) Close(); } void Init(const vk::Instance& instance); std::shared_ptr GetCompatibleDevice(const vk::ArrayProxy& deviceExtensions); std::string ProduceMissingDeviceCompatibilityReport(const vk::ArrayProxy& deviceExtensions); void Close() { devices.clear(); } }; }