2019-04-30 16:42:59 +08:00
|
|
|
|
#include<hgl/graph/vulkan/VKFramebuffer.h>
|
|
|
|
|
#include<hgl/graph/vulkan/VKDevice.h>
|
|
|
|
|
#include<hgl/graph/vulkan/VKImageView.h>
|
|
|
|
|
#include<hgl/graph/vulkan/VKRenderPass.h>
|
2020-10-15 22:13:15 +08:00
|
|
|
|
#include<hgl/graph/vulkan/VKTexture.h>
|
2019-06-19 17:25:23 +08:00
|
|
|
|
#include<hgl/type/Smart.h>
|
2019-04-22 00:33:48 +08:00
|
|
|
|
|
2019-04-18 21:42:22 +08:00
|
|
|
|
VK_NAMESPACE_BEGIN
|
2020-10-15 22:13:15 +08:00
|
|
|
|
|
|
|
|
|
Framebuffer::Framebuffer(VkDevice dev,VkFramebuffer fb,VkFramebufferCreateInfo *fb_create_info,bool depth)
|
|
|
|
|
{
|
|
|
|
|
device=dev;
|
|
|
|
|
frame_buffer=fb;
|
|
|
|
|
fb_info=fb_create_info;
|
|
|
|
|
|
|
|
|
|
extent.width=fb_info->width;
|
|
|
|
|
extent.height=fb_info->height;
|
|
|
|
|
|
|
|
|
|
has_depth=depth;
|
|
|
|
|
if(has_depth)
|
|
|
|
|
color_count=fb_info->attachmentCount-1;
|
|
|
|
|
else
|
|
|
|
|
color_count=fb_info->attachmentCount;
|
|
|
|
|
|
|
|
|
|
depth_texture=nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-18 21:42:22 +08:00
|
|
|
|
Framebuffer::~Framebuffer()
|
|
|
|
|
{
|
2020-10-15 22:13:15 +08:00
|
|
|
|
SAFE_CLEAR(depth_texture);
|
|
|
|
|
color_texture.Clear();
|
|
|
|
|
|
2019-04-18 21:42:22 +08:00
|
|
|
|
vkDestroyFramebuffer(device,frame_buffer,nullptr);
|
|
|
|
|
}
|
|
|
|
|
VK_NAMESPACE_END
|