Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::render::SwapchainResizeState Class Reference

Decides when a presentable swapchain has to be (re)configured. More...

#include <gpu_surface.hpp>

Public Member Functions

void request (uint32_t width, uint32_t height)
 Record the size the host wants. Configures nothing.
void mark_configured ()
 The swapchain now matches the requested size.
void invalidate ()
 Make the next frame configure even at an unchanged size, for a swapchain the surface reported as suboptimal.
bool presentable () const
 A zero dimension (a minimised or collapsed window) has nothing to present, and a swapchain cannot be configured at that size.
bool needs_configure () const
 True when the next frame must configure before it acquires a texture.
void note_frame (bool configured)
 Record a presented frame.
bool settled () const
 Settled: the last kSettleFrames frames presented without configuring, and no resize is pending, so a live resize is over and width()/height() are the final size.
uint32_t width () const
 The requested size, which is what GpuSurface::width()/height() report.
uint32_t height () const

Static Public Attributes

static constexpr uint32_t kSettleFrames = 2

Detailed Description

Decides when a presentable swapchain has to be (re)configured.

A host resize only records the size it wants. The swapchain is rebuilt at most once, when the next frame acquires its texture. Live resize delivers several size events per frame and a rebuild costs milliseconds on Vulkan and D3D12, so configuring on every event rebuilt it for sizes no frame ever presented.

Member Function Documentation

◆ height()

uint32_t pulp::render::SwapchainResizeState::height ( ) const
inline

◆ invalidate()

void pulp::render::SwapchainResizeState::invalidate ( )
inline

Make the next frame configure even at an unchanged size, for a swapchain the surface reported as suboptimal.

◆ mark_configured()

void pulp::render::SwapchainResizeState::mark_configured ( )
inline

The swapchain now matches the requested size.

◆ needs_configure()

bool pulp::render::SwapchainResizeState::needs_configure ( ) const
inline

True when the next frame must configure before it acquires a texture.

◆ note_frame()

void pulp::render::SwapchainResizeState::note_frame ( bool configured)
inline

Record a presented frame.

configured says whether it had to configure first; a frame that did restarts the settle count.

◆ presentable()

bool pulp::render::SwapchainResizeState::presentable ( ) const
inline

A zero dimension (a minimised or collapsed window) has nothing to present, and a swapchain cannot be configured at that size.

◆ request()

void pulp::render::SwapchainResizeState::request ( uint32_t width,
uint32_t height )
inline

Record the size the host wants. Configures nothing.

◆ settled()

bool pulp::render::SwapchainResizeState::settled ( ) const
inline

Settled: the last kSettleFrames frames presented without configuring, and no resize is pending, so a live resize is over and width()/height() are the final size.

Nothing in the surface acts on it; it is a signal for callers that want to wait out a drag, such as a GPU cache trim or a final-size check.

◆ width()

uint32_t pulp::render::SwapchainResizeState::width ( ) const
inline

The requested size, which is what GpuSurface::width()/height() report.

Member Data Documentation

◆ kSettleFrames

uint32_t pulp::render::SwapchainResizeState::kSettleFrames = 2
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/render/include/pulp/render/gpu_surface.hpp