#ifndef _VULKAN_UTILS_H #define _VULKAN_UTILS_H #include #include #include using namespace std; struct QueueFamilyIndices { optional graphicsFamily; optional presentFamily; bool isComplete() { return graphicsFamily.has_value() && presentFamily.has_value(); } }; struct SwapChainSupportDetails { VkSurfaceCapabilitiesKHR capabilities; vector formats; vector presentModes; }; class VulkanUtils { public: static bool checkValidationLayerSupport(const vector &validationLayers); static VkResult createDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pDebugMessenger); static void destroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT debugMessenger, const VkAllocationCallbacks* pAllocator); static QueueFamilyIndices findQueueFamilies(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface); static bool checkDeviceExtensionSupport(VkPhysicalDevice physicalDevice, const vector& deviceExtensions); static SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface); }; #endif // _VULKAN_UTILS_H