Always set use_presentation_thread flag in init_platform
authorIason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Fri, 15 Oct 2021 12:34:37 +0000 (13:34 +0100)
committerIason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Fri, 15 Oct 2021 12:34:37 +0000 (13:34 +0100)
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I1b917f5287c635dbb00b05607c5a36ce7b11767e

wsi/headless/swapchain.hpp
wsi/wayland/swapchain.cpp

index 23bcd09057955b98ab4b3e11972cf623fb3263f6..cdaf792ccb326659d00d1130da09580c2571a06b 100644 (file)
@@ -59,6 +59,7 @@ protected:
    VkResult init_platform(VkDevice device, const VkSwapchainCreateInfoKHR *swapchain_create_info,
                           bool &use_presentation_thread) override
    {
+      use_presentation_thread = true;
       return VK_SUCCESS;
    };
 
index 6bf61857238bba8f556a601580ac7bdf59815fcf..57f2badc039e8cdaf6f09ddb5ba9522a6e711ad9 100644 (file)
@@ -136,10 +136,7 @@ VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKH
     * initialize the page flip thread so the present_image function can be called
     * during vkQueuePresent.
     */
-   if (m_present_mode == VK_PRESENT_MODE_MAILBOX_KHR)
-   {
-      use_presentation_thread = false;
-   }
+   use_presentation_thread = (m_present_mode != VK_PRESENT_MODE_MAILBOX_KHR);
 
    return VK_SUCCESS;
 }