13#ifndef FCT_VK_SWAPCHAIN_H
14#define FCT_VK_SWAPCHAIN_H
58 vk::PresentModeKHR presentMode,
59 const vk::Extent2D& extent, uint32_t imageCount,
60 const vk::SurfaceCapabilitiesKHR& capabilities,
61 uint32_t graphicsQueueFamily);
79 vk::PresentModeKHR
chooseSwapPresentMode(
const std::vector<vk::PresentModeKHR>& availablePresentModes);
ImageRenderTarget * m_target
void setupQueueFamilies()
vk::PresentModeKHR chooseSwapPresentMode(const std::vector< vk::PresentModeKHR > &availablePresentModes)
Samples getSampleCount() const override
RHI::VK_Semaphore * m_prensentFinshSemphore
void cleanupOldResources()
void setPresentFinshSemaphore(RHI::Semaphore *semaphore) override
FCT::Image * image() const override
vk::Extent2D getExtent() const
void createImagesAndTargets()
Samples getSamples() const override
vk::SurfaceFormatKHR chooseSwapSurfaceFormat(const std::vector< vk::SurfaceFormatKHR > &availableFormats)
vk::Fence getInFlightFence() const
static constexpr uint32_t RECREATE_DEBOUNCE_MS
uint32_t m_pendingWidth
窗口resize的时候传递的大小
void present() override
提交present命令
std::vector< RHI::Image * > m_fctImages
uint32_t getCurrentImageIndex() const
VK_Swapchain(VK_Context *ctx)
vk::SwapchainKHR m_swapchain
MutilBufferImage * m_depthStencilImage
std::chrono::high_resolution_clock::time_point m_lastRecreateRequestTime
std::vector< vk::Queue > m_presentQueues
uint32_t m_currentImageIndex
void needRecreate(int width, int height) override
用于窗口通知需要 recreate
bool processRecreate(bool waitFence=false)
void createSwapchain(uint32_t width, uint32_t height)
std::vector< vk::Image > m_images
ImageRenderTarget * target() const override
获取交换链对应的target
uint32_t m_presentQueueFamilyIndex
RHI::Semaphore * getImageAvailableSemaphore() override
用于渲染命令同步的,获取到 图像,gpu可以执行渲染命令
void enableDepthBuffer(Format format) override
启用深度模板 缓存
Format getFormat() const override
uint32_t getImageCount() const override
vk::SwapchainCreateInfoKHR buildSwapchainCreateInfo(const vk::SurfaceFormatKHR &format, vk::PresentModeKHR presentMode, const vk::Extent2D &extent, uint32_t imageCount, const vk::SurfaceCapabilitiesKHR &capabilities, uint32_t graphicsQueueFamily)
MutilBufferImage * m_fctImage