#pragma once #include "vulkaninstance.h" #include #include #include #include #include class VulkanSwapChain; class VulkanSemaphore; class VulkanFence; class VulkanPhysicalDevice; class VulkanSurface; class VulkanCompatibleDevice; class VulkanDevice { public: VulkanDevice(std::shared_ptr instance, std::shared_ptr surface, const VulkanCompatibleDevice& selectedDevice); ~VulkanDevice(); std::set EnabledDeviceExtensions; VulkanDeviceFeatures EnabledFeatures; VulkanPhysicalDevice PhysicalDevice; std::shared_ptr Instance; std::shared_ptr Surface; VkDevice device = VK_NULL_HANDLE; VmaAllocator allocator = VK_NULL_HANDLE; VkQueue GraphicsQueue = VK_NULL_HANDLE; VkQueue PresentQueue = VK_NULL_HANDLE; int GraphicsFamily = -1; int PresentFamily = -1; bool GraphicsTimeQueries = false; bool SupportsDeviceExtension(const char* ext) const; void SetObjectName(const char* name, uint64_t handle, VkObjectType type); private: bool DebugLayerActive = false; void CreateDevice(); void CreateAllocator(); void ReleaseResources(); };