Attempt at synchronizing swap image writes between the main window and graphics backend.

Disabled for now due to device timeouts.
This commit is contained in:
Dr. Chat
2016-10-21 19:44:11 -05:00
parent 26d81abf52
commit 69be82c786
6 changed files with 157 additions and 100 deletions

View File

@@ -53,6 +53,9 @@ class VulkanSwapChain {
// torn down and recreated with the new surface properties (size/etc).
bool Reinitialize();
// Waits on and signals a semaphore in this operation.
void WaitAndSignalSemaphore(VkSemaphore sem);
// Begins the swap operation, preparing state for rendering.
bool Begin();
// Ends the swap operation, finalizing rendering and presenting the results.
@@ -86,6 +89,7 @@ class VulkanSwapChain {
VkSemaphore image_usage_semaphore_ = nullptr;
uint32_t current_buffer_index_ = 0;
std::vector<Buffer> buffers_;
std::vector<VkSemaphore> wait_and_signal_semaphores_;
};
} // namespace vulkan