diff --git a/src/RenderDevice/Vulkan/VKFramebuffer.cpp b/src/RenderDevice/Vulkan/VKFramebuffer.cpp index 172fe108..5b7d7685 100644 --- a/src/RenderDevice/Vulkan/VKFramebuffer.cpp +++ b/src/RenderDevice/Vulkan/VKFramebuffer.cpp @@ -12,11 +12,6 @@ Framebuffer::~Framebuffer() Framebuffer *CreateFramebuffer(Device *dev,RenderPass *rp,ImageView **color_list,const uint color_count,ImageView *depth) { - if(!dev)return(nullptr); - if(!rp)return(nullptr); - - if(!color_count&&!depth)return(nullptr); - uint att_count=color_count; if(depth)++att_count; @@ -27,9 +22,6 @@ Framebuffer *CreateFramebuffer(Device *dev,RenderPass *rp,ImageView **color_list { const List &cf_list=rp->GetColorFormat(); - if(color_count!=cf_list.GetCount()) - return(nullptr); - const VkFormat *cf=cf_list.GetData(); ImageView **iv=color_list; for(uint i=0;i color,ImageView *depth) { + if(!dev)return(nullptr); + if(!rp)return(nullptr); + + if(rp->GetColorFormat().GetCount()!=color.GetCount())return(nullptr); + + if(color.GetCount()==0&&!depth)return(nullptr); + return CreateFramebuffer(dev,rp,color.GetData(),color.GetCount(),depth); }