Moved render_cmd_buffer to SwapchainImage from VulkanAppFramework

This commit is contained in:
2025-01-25 01:30:13 +08:00
parent c9b99dd125
commit d73966b1d0
4 changed files with 31 additions and 39 deletions

View File

@@ -80,7 +80,6 @@ public:
~RTSwapchain();
const uint32_t GetColorCount ()const override {return 1;} ///Swapchain的FBO颜色成份只有一个
const uint32_t GetImageCount ()const {return swapchain->image_count;}
Framebuffer * GetFramebuffer ()override {return swapchain->sc_image[current_frame].fbo;}
@@ -89,6 +88,11 @@ public:
virtual Texture2D * GetColorTexture (const int index=0) override{return swapchain->sc_image[current_frame].color;}
virtual Texture2D * GetDepthTexture () override{return swapchain->sc_image[current_frame].depth;}
RenderCmdBuffer *GetRenderCmdBuffer(const int index)
{
return swapchain->sc_image[index].cmd_buf;
}
public:
const uint32_t GetCurrentFrameIndices ()const {return current_frame;}

View File

@@ -4,6 +4,7 @@
#include<hgl/graph/VKTexture.h>
#include<hgl/type/List.h>
#include<hgl/graph/VKFramebuffer.h>
#include<hgl/graph/VKCommandBuffer.h>
VK_NAMESPACE_BEGIN
struct SwapchainImage
@@ -13,10 +14,13 @@ struct SwapchainImage
Framebuffer * fbo =nullptr;
RenderCmdBuffer * cmd_buf =nullptr;
public:
~SwapchainImage()
{
delete cmd_buf;
delete fbo;
delete depth;
delete color;