fix a bug, it don't check the Texture before get extent

This commit is contained in:
hyzboy 2020-10-17 16:25:59 +08:00
parent 6efa0ff8d4
commit 834b737e1a

View File

@ -41,13 +41,16 @@ Framebuffer *Device::CreateFramebuffer(RenderPass *rp,ImageView **color_list,con
if(*cf!=(*iv)->GetFormat())
return(nullptr);
attachments[i]=**iv;
*ap=**iv;
++ap;
++cf;
++iv;
}
}
VkExtent2D extent;
if(depth)
{
if(rp->GetDepthFormat()!=depth->GetFormat())
@ -57,11 +60,15 @@ Framebuffer *Device::CreateFramebuffer(RenderPass *rp,ImageView **color_list,con
}
attachments[color_count]=*depth;
}
VkExtent2D extent;
extent.width=depth->GetExtent().width;
extent.height=depth->GetExtent().height;
}
else
{
extent.width=color_list[0]->GetExtent().width;
extent.height=color_list[0]->GetExtent().height;
}
VkFramebuffer fbo=CreateVulkanFramebuffer(GetDevice(),rp,extent,attachments,att_count);