fix a bug, it don't check the Texture before get extent
This commit is contained in:
parent
6efa0ff8d4
commit
834b737e1a
@ -41,13 +41,16 @@ Framebuffer *Device::CreateFramebuffer(RenderPass *rp,ImageView **color_list,con
|
|||||||
if(*cf!=(*iv)->GetFormat())
|
if(*cf!=(*iv)->GetFormat())
|
||||||
return(nullptr);
|
return(nullptr);
|
||||||
|
|
||||||
attachments[i]=**iv;
|
*ap=**iv;
|
||||||
|
|
||||||
|
++ap;
|
||||||
++cf;
|
++cf;
|
||||||
++iv;
|
++iv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VkExtent2D extent;
|
||||||
|
|
||||||
if(depth)
|
if(depth)
|
||||||
{
|
{
|
||||||
if(rp->GetDepthFormat()!=depth->GetFormat())
|
if(rp->GetDepthFormat()!=depth->GetFormat())
|
||||||
@ -57,11 +60,15 @@ Framebuffer *Device::CreateFramebuffer(RenderPass *rp,ImageView **color_list,con
|
|||||||
}
|
}
|
||||||
|
|
||||||
attachments[color_count]=*depth;
|
attachments[color_count]=*depth;
|
||||||
}
|
|
||||||
|
|
||||||
VkExtent2D extent;
|
|
||||||
extent.width=depth->GetExtent().width;
|
extent.width=depth->GetExtent().width;
|
||||||
extent.height=depth->GetExtent().height;
|
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);
|
VkFramebuffer fbo=CreateVulkanFramebuffer(GetDevice(),rp,extent,attachments,att_count);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user