Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3568bfe0 authored by Ian Elliott's avatar Ian Elliott
Browse files

Have vkGetRefreshCycleDurationGOOGLE query SF every time.

When VK_GOOGLE_display_timing was first created, we assumed displays
never changed refresh rates.  Now that they are dynamic, we need to
query SF everytime the app requests it.

Test: ANGLE-on-Vulkan
Bug: b/130888074
Change-Id: I5eb9a20690f82b8663899a2ded8b5bb866cebe58
parent 790b6b9e
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -222,6 +222,15 @@ struct Swapchain {
            window,
            &refresh_duration);
    }
    uint64_t get_refresh_duration()
    {
        ANativeWindow* window = surface.window.get();
        native_window_get_refresh_cycle_duration(
            window,
            &refresh_duration);
        return static_cast<uint64_t>(refresh_duration);

    }

    Surface& surface;
    uint32_t num_images;
@@ -1730,8 +1739,7 @@ VkResult GetRefreshCycleDurationGOOGLE(
    Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle);
    VkResult result = VK_SUCCESS;

    pDisplayTimingProperties->refreshDuration =
            static_cast<uint64_t>(swapchain.refresh_duration);
    pDisplayTimingProperties->refreshDuration = swapchain.get_refresh_duration();

    return result;
}