#ifndef SWAP_CHAIN_STATE_VK_H #define SWAP_CHAIN_STATE_VK_H #include #include #include #include #include #include "vulkan/cereal/common/goldfish_vk_dispatch.h" class SwapChainStateVk { public: static std::vector getRequiredInstanceExtensions(); static std::vector getRequiredDeviceExtensions(); static bool validateQueueFamilyProperties( const goldfish_vk::VulkanDispatch &, VkPhysicalDevice, VkSurfaceKHR, uint32_t queueFamilyIndex); using VkSwapchainCreateInfoKHRPtr = std::unique_ptr>; static VkSwapchainCreateInfoKHRPtr createSwapChainCi( const goldfish_vk::VulkanDispatch &, VkSurfaceKHR, VkPhysicalDevice, uint32_t width, uint32_t height, const std::unordered_set &queueFamilyIndices); explicit SwapChainStateVk(const goldfish_vk::VulkanDispatch &, VkDevice, const VkSwapchainCreateInfoKHR &); ~SwapChainStateVk(); VkFormat getFormat(); const std::vector& getVkImages() const; const std::vector& getVkImageViews() const; VkSwapchainKHR getSwapChain() const; private: const static VkFormat k_vkFormat = VK_FORMAT_B8G8R8A8_UNORM; const static VkColorSpaceKHR k_vkColorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; const goldfish_vk::VulkanDispatch &m_vk; VkDevice m_vkDevice; VkSwapchainKHR m_vkSwapChain; std::vector m_vkImages; std::vector m_vkImageViews; }; #endif