ULRE/src/RenderDevice/VKFramebuffer.cpp

31 lines
642 B
C++
Raw Normal View History

#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-18 21:42:22 +08:00
VK_NAMESPACE_BEGIN
Framebuffer::Framebuffer(VkDevice dev,VkFramebuffer fb,const VkExtent2D &ext,VkRenderPass rp,uint32_t cc,bool depth)
{
device=dev;
frame_buffer=fb;
render_pass=rp;
extent=ext;
color_count=cc;
has_depth=depth;
attachment_count=color_count;
if(has_depth)
++attachment_count;
}
2019-04-18 21:42:22 +08:00
Framebuffer::~Framebuffer()
{
vkDestroyFramebuffer(device,frame_buffer,nullptr);
}
VK_NAMESPACE_END