From 101dc3b820131a2abbd05c7429af3a03148aca6e Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 19 Jun 2019 17:35:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80Framebuffer=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9C=89=E6=95=88=E6=80=A7=E6=A3=80=E6=B5=8B=E5=88=B0?= =?UTF-8?q?=E5=90=84=E8=87=AA=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/RenderDevice/Vulkan/VKFramebuffer.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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); }