Foundation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Foundation::RenderCore::Presenter Class Reference

#include <Presenter.hpp>

Public Member Functions

 Presenter (RHIDevice *device, RHIDeviceHandle< RHISwapchain > swapchain, Allocator *alloc)
 
 ~Presenter ()=default
 
RHISwapchainResult AcquireNextImage (uint32_t &imageIndex)
 Acquires the next swapchain image.
 
RHISwapchainResult Present (RHIDeviceSemaphore *waitSemaphore)
 Presents the most recently acquired image to the graphics queue.
 
RHIDeviceHandle< RHIDeviceSemaphoreGetImageAcquireSemaphore () const
 Binary semaphore to signal from RHISwapchain::GetNextImage for the next frame.
 
RHIDeviceHandle< RHISwapchainGetSwapchain () const
 Returns the currently used RHISwapchain object.
 
void SetSwapchain (RHIDeviceHandle< RHISwapchain > swapchain)
 

Private Attributes

RHIDevicemDevice
 
RHIDeviceHandle< RHISwapchainmSwapchain
 
Vector< RHIDeviceScopedHandle< RHIDeviceSemaphore > > mSyncs
 
uint32_t mCurrentSync = 0
 
uint32_t mCurrentSwap = 0
 
uint32_t mFrameSwaps = 0
 

Constructor & Destructor Documentation

◆ Presenter()

Foundation::RenderCore::Presenter::Presenter ( RHIDevice device,
RHIDeviceHandle< RHISwapchain swapchain,
Allocator alloc 
)

◆ ~Presenter()

Foundation::RenderCore::Presenter::~Presenter ( )
default

Member Function Documentation

◆ AcquireNextImage()

RHISwapchainResult Foundation::RenderCore::Presenter::AcquireNextImage ( uint32_t &  imageIndex)

Acquires the next swapchain image.

Returns
Swapchain result; !RHISwapchainResultMayPresent means the owner should recreate before retrying.

◆ GetImageAcquireSemaphore()

RHIDeviceHandle< RHIDeviceSemaphore > Foundation::RenderCore::Presenter::GetImageAcquireSemaphore ( ) const

Binary semaphore to signal from RHISwapchain::GetNextImage for the next frame.

◆ GetSwapchain()

RHIDeviceHandle< RHISwapchain > Foundation::RenderCore::Presenter::GetSwapchain ( ) const
inline

Returns the currently used RHISwapchain object.

◆ Present()

RHISwapchainResult Foundation::RenderCore::Presenter::Present ( RHIDeviceSemaphore waitSemaphore)

Presents the most recently acquired image to the graphics queue.

Returns
Swapchain result; !RHISwapchainResultMayPresent means the owner should recreate.
Note
Advances the internal frame-in-flight sync slot even on failure.

◆ SetSwapchain()

void Foundation::RenderCore::Presenter::SetSwapchain ( RHIDeviceHandle< RHISwapchain swapchain)

@breif Updates the current swapchain to the new one, resetting sync primitives.

Member Data Documentation

◆ mCurrentSwap

uint32_t Foundation::RenderCore::Presenter::mCurrentSwap = 0
private

◆ mCurrentSync

uint32_t Foundation::RenderCore::Presenter::mCurrentSync = 0
private

◆ mDevice

RHIDevice* Foundation::RenderCore::Presenter::mDevice
private

◆ mFrameSwaps

uint32_t Foundation::RenderCore::Presenter::mFrameSwaps = 0
private

◆ mSwapchain

RHIDeviceHandle<RHISwapchain> Foundation::RenderCore::Presenter::mSwapchain
private

◆ mSyncs

Vector<RHIDeviceScopedHandle<RHIDeviceSemaphore> > Foundation::RenderCore::Presenter::mSyncs
private

The documentation for this class was generated from the following files: