2020-10-21 11:43:18 +08:00
|
|
|
|
#include<hgl/graph/VKFramebuffer.h>
|
|
|
|
|
#include<hgl/graph/VKDevice.h>
|
|
|
|
|
#include<hgl/graph/VKImageView.h>
|
|
|
|
|
#include<hgl/graph/VKRenderPass.h>
|
|
|
|
|
#include<hgl/graph/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
|
|
|
|
|
2020-10-17 14:18:09 +08:00
|
|
|
|
Framebuffer::Framebuffer(VkDevice dev,VkFramebuffer fb,const VkExtent2D &ext,VkRenderPass rp,uint32_t cc,bool depth)
|
2020-10-15 22:13:15 +08:00
|
|
|
|
{
|
|
|
|
|
device=dev;
|
|
|
|
|
frame_buffer=fb;
|
2020-10-17 14:18:09 +08:00
|
|
|
|
render_pass=rp;
|
2020-10-15 22:13:15 +08:00
|
|
|
|
|
2020-10-17 14:18:09 +08:00
|
|
|
|
extent=ext;
|
|
|
|
|
color_count=cc;
|
2020-10-15 22:13:15 +08:00
|
|
|
|
has_depth=depth;
|
|
|
|
|
|
2020-10-17 14:18:09 +08:00
|
|
|
|
attachment_count=color_count;
|
|
|
|
|
|
|
|
|
|
if(has_depth)
|
|
|
|
|
++attachment_count;
|
2020-10-15 22:13:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-18 21:42:22 +08:00
|
|
|
|
Framebuffer::~Framebuffer()
|
|
|
|
|
{
|
|
|
|
|
vkDestroyFramebuffer(device,frame_buffer,nullptr);
|
|
|
|
|
}
|
|
|
|
|
VK_NAMESPACE_END
|