Skip to content

Commit 2368c98

Browse files
authored
Merge pull request #277 from Ralith/vulkan-stall
Defer Vulkan CPU sync until the next frame begins
2 parents 9cf1ca6 + 8bfd90c commit 2368c98

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello_xr: Defer Vulkan CPU sync until the next frame begins.

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)