|
KiCad PCB EDA Suite
|
#include <algorithm>#include <chrono>#include <cstdint>#include <optional>#include <string>#include <vector>Go to the source code of this file.
Enumerations | |
| enum class | RHI_PRESENT_MODE : uint8_t { FIFO , MAILBOX , IMMEDIATE } |
| How a swapchain hands finished images to the display. More... | |
Functions | |
| RHI_PRESENT_MODE | RhiChoosePresentMode (const std::vector< RHI_PRESENT_MODE > &aOffered, bool aComposited, bool aImmediateUnderCompositor=false) |
| Choose the present mode for a swapchain from the modes the surface offers. | |
| template<typename TIME_POINT> | |
| TIME_POINT | RhiNextFrameAt (TIME_POINT aFrameStart, double aRefreshHz, std::optional< TIME_POINT > aVblank) |
The earliest time the frame after one started at aFrameStart may start, for a window whose presents do not wait for the display. | |
Variables | |
| constexpr int | RHI_PRESENTS_IN_FLIGHT = 2 |
| Presents allowed to wait for the display at once while frames are paced. | |
|
strong |
How a swapchain hands finished images to the display.
Definition at line 40 of file rhi_present_mode.h.
|
inline |
Choose the present mode for a swapchain from the modes the surface offers.
MAILBOX is preferred. Without it a composited window uses IMMEDIATE, since the compositor's vsynced frame keeps it from tearing, and anything else uses FIFO, which every surface offers. With aImmediateUnderCompositor a composited window prefers IMMEDIATE over MAILBOX because Mesa's MAILBOX adds latency under a compositor.
| aComposited | true when a compositor owns the final present. |
| aImmediateUnderCompositor | true on Linux. |
Definition at line 59 of file rhi_present_mode.h.
References FIFO, IMMEDIATE, and MAILBOX.
Referenced by RHI_VULKAN_DEVICE::ChoosePresentMode().
| TIME_POINT RhiNextFrameAt | ( | TIME_POINT | aFrameStart, |
| double | aRefreshHz, | ||
| std::optional< TIME_POINT > | aVblank ) |
The earliest time the frame after one started at aFrameStart may start, for a window whose presents do not wait for the display.
With a known vertical blank this is the next blank after aFrameStart, so at most one frame starts per refresh and frames do not drift against the display. Without one it is a refresh later.
| aRefreshHz | the display's refresh rate, above zero. |
| aVblank | a time the display refreshed, before or after aFrameStart. |
Division truncates towards zero, and a blank reported after the frame start needs the floor.
Definition at line 91 of file rhi_present_mode.h.
Referenced by KIGFX::RENDER_THREAD::ProcessActiveWindows().
|
constexpr |
Presents allowed to wait for the display at once while frames are paced.
Definition at line 34 of file rhi_present_mode.h.
Referenced by KIGFX::RENDER_THREAD::ProcessActiveWindows().