Skip to content

Commit 373c595

Browse files
Ralithrpavlik
authored andcommitted
Defer Vulkan CPU sync until the next frame begins
Reduces the impact of the pipeline stall by moving it after presentation, and provides a simple test for whether a runtime properly synchronizes presentation with application work.
1 parent 1bafde7 commit 373c595

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/tests/hello_xr/graphicsplugin_vulkan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,8 @@ struct VulkanGraphicsPlugin : public IGraphicsPlugin {
15451545
auto swapchainContext = m_swapchainImageContextMap[swapchainImage];
15461546
uint32_t imageIndex = swapchainContext->ImageIndex(swapchainImage);
15471547

1548+
// XXX Should double-buffer the command buffers, for now just flush
1549+
m_cmdBuffer.Wait();
15481550
m_cmdBuffer.Reset();
15491551
m_cmdBuffer.Begin();
15501552

@@ -1605,8 +1607,6 @@ struct VulkanGraphicsPlugin : public IGraphicsPlugin {
16051607

16061608
m_cmdBuffer.End();
16071609
m_cmdBuffer.Exec(m_vkQueue);
1608-
// XXX Should double-buffer the command buffers, for now just flush
1609-
m_cmdBuffer.Wait();
16101610

16111611
#if defined(USE_MIRROR_WINDOW)
16121612
// Cycle the window's swapchain on the last view rendered

0 commit comments

Comments
 (0)