[Vulkan] Per-frame swapchain semaphores

This commit is contained in:
Triang3l
2020-10-18 19:23:34 +03:00
parent 7846245b66
commit afcf3c27c0
2 changed files with 40 additions and 37 deletions

View File

@@ -106,6 +106,10 @@ class VulkanContext : public GraphicsContext {
// recommended by Nvidia (Direct3D 12-like way):
// https://developer.nvidia.com/sites/default/files/akamai/gameworks/blog/munich/mschott_vulkan_multi_threading.pdf
VkFence fence = VK_NULL_HANDLE;
// One pair of semaphores per frame because queue operations may be done out
// of order.
VkSemaphore image_acquisition_semaphore = VK_NULL_HANDLE;
VkSemaphore render_completion_semaphore = VK_NULL_HANDLE;
VkCommandPool command_pool = VK_NULL_HANDLE;
VkCommandBuffer command_buffer;
uint32_t setup_command_buffer_index = UINT32_MAX;
@@ -114,9 +118,6 @@ class VulkanContext : public GraphicsContext {
uint64_t swap_submission_current_ = 1;
uint64_t swap_submission_completed_ = 0;
VkSemaphore swap_image_acquisition_semaphore_ = VK_NULL_HANDLE;
VkSemaphore swap_render_completion_semaphore_ = VK_NULL_HANDLE;
VkSurfaceKHR swap_surface_ = VK_NULL_HANDLE;
VkSurfaceFormatKHR swap_surface_format_ = {VK_FORMAT_UNDEFINED,
VK_COLOR_SPACE_SRGB_NONLINEAR_KHR};