18#ifndef INCLUDED_RENDERER_BACKEND_VULKAN_SWAPCHAIN
19#define INCLUDED_RENDERER_BACKEND_VULKAN_SWAPCHAIN
23#include <glad/vulkan.h>
26#include <unordered_map>
40class CRingCommandContext;
57 void Present(VkSemaphore submitDone, VkQueue queue);
72 static std::unique_ptr<CSwapChain>
Create(
73 CDevice* device, VkSurfaceKHR surface,
int surfaceDrawableWidth,
int surfaceDrawableHeight,
74 std::unique_ptr<CSwapChain> oldSwapChain);
Represents a texture object.
Definition: TextureManager.h:262
Definition: Framebuffer.h:41
A simple helper class to decouple command buffers rotation from frames presenting.
Definition: RingCommandContext.h:48
Definition: SwapChain.h:44
bool m_IsValid
Definition: SwapChain.h:80
std::unique_ptr< CTexture > m_DepthTexture
Definition: SwapChain.h:87
VkSwapchainKHR GetVkSwapchain()
Definition: SwapChain.h:48
CTexture * GetDepthTexture()
Definition: SwapChain.h:67
CDevice * m_Device
Definition: SwapChain.h:78
void Present(VkSemaphore submitDone, VkQueue queue)
Definition: SwapChain.cpp:325
bool IsValid() const
Definition: SwapChain.h:50
std::vector< VkImage > m_Images
Definition: SwapChain.h:85
void SubmitCommandsAfterAcquireNextImage(CRingCommandContext &commandContext)
Definition: SwapChain.cpp:289
CFramebuffer * GetCurrentBackbuffer(const AttachmentLoadOp colorAttachmentLoadOp, const AttachmentStoreOp colorAttachmentStoreOp, const AttachmentLoadOp depthStencilAttachmentLoadOp, const AttachmentStoreOp depthStencilAttachmentStoreOp)
Definition: SwapChain.cpp:354
std::vector< SwapChainBackbuffer > m_Backbuffers
Definition: SwapChain.h:110
VkSwapchainKHR m_SwapChain
Definition: SwapChain.h:81
VkFormat m_ImageFormat
Definition: SwapChain.h:88
bool AcquireNextImage(VkSemaphore acquireImageSemaphore)
Definition: SwapChain.cpp:267
~CSwapChain()
Definition: SwapChain.cpp:240
void SubmitCommandsBeforePresent(CRingCommandContext &commandContext)
Definition: SwapChain.cpp:313
std::vector< std::unique_ptr< CTexture > > m_Textures
Definition: SwapChain.h:86
CTexture * GetCurrentBackbufferTexture()
Definition: SwapChain.cpp:388
static std::unique_ptr< CSwapChain > Create(CDevice *device, VkSurfaceKHR surface, int surfaceDrawableWidth, int surfaceDrawableHeight, std::unique_ptr< CSwapChain > oldSwapChain)
Definition: SwapChain.cpp:45
uint32_t m_CurrentImageIndex
Definition: SwapChain.h:83
AttachmentStoreOp
Store operation is set for each attachment, what should be done with its content on EndFramebufferPas...
Definition: IFramebuffer.h:52
Backend
Definition: Backend.h:28
AttachmentLoadOp
Load operation is set for each attachment, what should be done with its content on BeginFramebufferPa...
Definition: IFramebuffer.h:37
Definition: VideoMode.h:29
Definition: SwapChain.h:96
size_t operator()(const BackbufferKey &key) const
Definition: SwapChain.cpp:251
Definition: SwapChain.h:91
SwapChainBackbuffer & operator=(SwapChainBackbuffer &&other)
SwapChainBackbuffer(const SwapChainBackbuffer &)=delete
SwapChainBackbuffer & operator=(const SwapChainBackbuffer &)=delete
std::unordered_map< BackbufferKey, std::unique_ptr< CFramebuffer >, BackbufferKeyHash > backbuffers
Definition: SwapChain.h:100
SwapChainBackbuffer(SwapChainBackbuffer &&other)
std::tuple< AttachmentLoadOp, AttachmentStoreOp, AttachmentLoadOp, AttachmentStoreOp > BackbufferKey
Definition: SwapChain.h:94
unsigned int uint32_t
Definition: wposix_types.h:53
pthread_key_t key
Definition: wpthread.cpp:140