2025-01-24 23:45:37 +08:00
|
|
|
|
#pragma once
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2020-10-21 11:43:18 +08:00
|
|
|
|
#include<hgl/graph/VK.h>
|
|
|
|
|
#include<hgl/graph/VKTexture.h>
|
2019-07-16 20:57:17 +08:00
|
|
|
|
#include<hgl/type/List.h>
|
2025-01-24 23:45:37 +08:00
|
|
|
|
#include<hgl/graph/VKFramebuffer.h>
|
2025-01-25 01:30:13 +08:00
|
|
|
|
#include<hgl/graph/VKCommandBuffer.h>
|
2019-07-13 02:37:19 +08:00
|
|
|
|
VK_NAMESPACE_BEGIN
|
2025-01-24 23:45:37 +08:00
|
|
|
|
|
|
|
|
|
struct SwapchainImage
|
|
|
|
|
{
|
|
|
|
|
Texture2D * color =nullptr;
|
|
|
|
|
Texture2D * depth =nullptr;
|
|
|
|
|
|
|
|
|
|
Framebuffer * fbo =nullptr;
|
|
|
|
|
|
2025-01-25 01:30:13 +08:00
|
|
|
|
RenderCmdBuffer * cmd_buf =nullptr;
|
|
|
|
|
|
2025-01-24 23:45:37 +08:00
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
~SwapchainImage()
|
|
|
|
|
{
|
2025-01-25 01:30:13 +08:00
|
|
|
|
delete cmd_buf;
|
2025-01-24 23:45:37 +08:00
|
|
|
|
delete fbo;
|
|
|
|
|
delete depth;
|
|
|
|
|
delete color;
|
|
|
|
|
}
|
|
|
|
|
};//struct SwapchainImage
|
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
struct Swapchain
|
2019-07-15 22:37:00 +08:00
|
|
|
|
{
|
2019-07-16 20:57:17 +08:00
|
|
|
|
public:
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2025-01-24 23:45:37 +08:00
|
|
|
|
VkDevice device =VK_NULL_HANDLE;
|
2019-07-16 20:57:17 +08:00
|
|
|
|
|
2025-01-24 23:45:37 +08:00
|
|
|
|
VkExtent2D extent;
|
|
|
|
|
VkSurfaceTransformFlagBitsKHR transform;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2025-01-24 23:45:37 +08:00
|
|
|
|
VkSwapchainKHR swap_chain =VK_NULL_HANDLE;
|
|
|
|
|
VkSurfaceFormatKHR surface_format;
|
|
|
|
|
VkFormat depth_format;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2025-01-25 00:15:00 +08:00
|
|
|
|
RenderPass * render_pass =nullptr;
|
|
|
|
|
|
2025-01-24 23:45:37 +08:00
|
|
|
|
uint32_t image_count =0;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2025-01-24 23:45:37 +08:00
|
|
|
|
SwapchainImage * sc_image =nullptr;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-07-15 22:37:00 +08:00
|
|
|
|
virtual ~Swapchain();
|
2019-07-16 20:57:17 +08:00
|
|
|
|
};//struct Swapchain
|
2019-07-13 02:37:19 +08:00
|
|
|
|
VK_NAMESPACE_END
|