vulkan: Also wait on the draw semaphore when present()ing

That way we have a synchronization primitive at the start and at the
end.
This commit is contained in:
Benjamin Otte 2016-12-08 17:40:07 +01:00
parent 3c5b25b1d1
commit 747df7aa3c
2 changed files with 9 additions and 1 deletions

View File

@ -306,6 +306,10 @@ gdk_vulkan_context_end_frame (GdkDrawContext *draw_context,
GDK_VK_CHECK (vkQueuePresentKHR, gdk_vulkan_context_get_queue (context),
&(VkPresentInfoKHR) {
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
.waitSemaphoreCount = 1,
.pWaitSemaphores = (VkSemaphore[]) {
priv->draw_semaphore
},
.swapchainCount = 1,
.pSwapchains = (VkSwapchainKHR[]) {
priv->swapchain

View File

@ -237,13 +237,17 @@ gsk_vulkan_render_submit (GskVulkanRender *self,
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
.waitSemaphoreCount = 1,
.pWaitSemaphores = (VkSemaphore[1]) {
gdk_vulkan_context_get_draw_semaphore (self->vulkan),
gdk_vulkan_context_get_draw_semaphore (self->vulkan)
},
.pWaitDstStageMask = (VkPipelineStageFlags []) {
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
},
.commandBufferCount = 1,
.pCommandBuffers = &self->command_buffer,
.signalSemaphoreCount = 1,
.pSignalSemaphores = (VkSemaphore[1]) {
gdk_vulkan_context_get_draw_semaphore (self->vulkan)
}
},
fence);