VKDevice内义RenderFrame,将frame_buffer,present_complete_semaphore,render_complete_semaphore,draw_fence等成对分配

This commit is contained in:
2019-06-15 22:02:20 +08:00
parent 5bad17d281
commit 6c8cf14abe
3 changed files with 73 additions and 42 deletions

View File

@@ -195,20 +195,17 @@ private:
device->AcquireNextImage();
}
void Submit(const VkCommandBuffer cmd_buf)
{
device->SubmitDraw(&cmd_buf);
device->Wait();
device->QueuePresent();
}
public:
virtual void Draw()
{
const vulkan::CommandBuffer *cb=cmd_buf[device->GetCurrentFrameIndices()];
uint32_t index=device->GetCurrentFrameIndices();
Submit(*cb);
VkCommandBuffer cb=*cmd_buf[index];
device->SubmitDraw(&cb);
device->Wait(&index);
device->QueuePresent();
}
bool Run()