Add targetFrameTime option for Vulkan backend

This commit is contained in:
2020-09-15 17:08:04 -04:00
parent bd5ea36659
commit 57cb96c1a7
9 changed files with 60 additions and 9 deletions

View File

@@ -2871,6 +2871,8 @@ struct VulkanCommandQueue final : IGraphicsCommandQueue {
std::vector<boo::ObjToken<boo::IObj>> m_drawResTokens[2];
Limiter m_frameLimiter;
void resetCommandBuffer() {
ThrowIfFailed(vk::ResetCommandBuffer(m_cmdBufs[m_fillBuf], 0));
VkCommandBufferBeginInfo cmdBufBeginInfo = {};
@@ -4076,6 +4078,7 @@ void VulkanCommandQueue::execute() {
present.pResults = nullptr;
ThrowIfFailed(vk::QueuePresentKHR(m_ctx->m_queue, &present));
m_frameLimiter.Sleep(m_ctx->m_targetFrameTime);
}
resetCommandBuffer();