RenderTarget doesn't set extent, it's a bug.

This commit is contained in:
hyzboy 2020-10-18 18:35:03 +08:00
parent 7e2a7bf702
commit b8e332a109
2 changed files with 17 additions and 1 deletions

View File

@ -105,6 +105,7 @@ public:
bool PresentBackbuffer();
bool Submit(VkCommandBuffer);
bool Submit(VkCommandBuffer,GPUSemaphore *);
};//class SwapchainRenderTarget:public RenderTarget
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_RENDER_TARGET_INCLUDE

View File

@ -26,19 +26,29 @@ RenderTarget::RenderTarget(Device *dev,RenderPass *_rp,Framebuffer *_fb,CommandB
rp=_rp;
fb=_fb;
command_buffer=_cb;
depth_texture=dt;
color_count=cc;
if(color_count>0)
{
color_textures=new Texture2D *[color_count];
hgl_cpy<Texture2D *>(color_textures,ctl,color_count);
extent.width=color_textures[0]->GetWidth();
extent.height=color_textures[0]->GetHeight();
}
else
{
color_textures=nullptr;
if(depth_texture)
{
extent.width=depth_texture->GetWidth();
extent.height=depth_texture->GetHeight();
}
}
depth_texture=dt;
render_complete_semaphore=dev->CreateSemaphore();
}
@ -138,4 +148,9 @@ bool SwapchainRenderTarget::Submit(VkCommandBuffer cb)
{
return SubmitQueue::Submit(cb,present_complete_semaphore,render_complete_semaphore);
}
bool SwapchainRenderTarget::Submit(VkCommandBuffer cb,GPUSemaphore *pce)
{
return SubmitQueue::Submit(cb,pce,render_complete_semaphore);
}
VK_NAMESPACE_END