// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Vulkan renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_VULKANRENDERER_VULKAN_HPP #define NAZARA_VULKANRENDERER_VULKAN_HPP #include #include #include #include #include #include #include #include #include #include #include #include namespace Nz { class VulkanDevice; class NAZARA_VULKANRENDERER_API Vulkan { public: struct QueueFamily { UInt32 familyIndex; float priority; }; Vulkan() = delete; ~Vulkan() = delete; static RenderDeviceInfo BuildRenderDeviceInfo(const Vk::PhysicalDevice& physDevice); static std::shared_ptr CreateDevice(const Vk::PhysicalDevice& deviceInfo, const RenderDeviceFeatures& enabledFeatures); static std::shared_ptr CreateDevice(const Vk::PhysicalDevice& deviceInfo, const RenderDeviceFeatures& enabledFeatures, const Vk::Surface& surface, UInt32* graphicsFamilyIndex, UInt32* presentableFamilyIndex, UInt32* transferFamilyIndex); static std::shared_ptr CreateDevice(const Vk::PhysicalDevice& deviceInfo, const RenderDeviceFeatures& enabledFeatures, const QueueFamily* queueFamilies, std::size_t queueFamilyCount); static Vk::Instance& GetInstance(); static const std::vector& GetPhysicalDevices(); static const Vk::PhysicalDevice& GetPhysicalDeviceInfo(VkPhysicalDevice physDevice); static bool Initialize(UInt32 targetApiVersion, const ParameterList& parameters); static bool IsInitialized(); static void Uninitialize(); private: static std::vector s_physDevices; static Vk::Instance s_instance; static ParameterList s_initializationParameters; }; } #endif // NAZARA_VULKANRENDERER_VULKAN_HPP