|
|
| ~VulkanSwapchain () |
| | Destructor; proves this surface's native work complete, then destroys the swapchain and the surface too when this object created it. A failed proof poisons the shared lifetime state so the owner retains all native prerequisites fail-closed.
|
|
| VulkanSwapchain (const VulkanSwapchain &)=delete |
|
VulkanSwapchain & | operator= (const VulkanSwapchain &)=delete |
| Status | prepareForDestruction () |
| | Proves that every native object owned by this surface is no longer in use.
|
| void | setRetirementSignal (std::shared_ptr< VulkanSurfaceRetirement > retirement) |
| | Binds the exact external-surface retirement record after backend acceptance.
|
|
void | markRetirementUnproven () |
| | Marks platform prerequisites permanently retained after destruction proof fails.
|
|
void | retainBefore (std::unique_ptr< VulkanSwapchain > next) |
| | Retains next behind this surface while failed teardown quarantines a whole owner.
|
|
std::unique_ptr< VulkanSwapchain > | retainedNext () |
| | Unlinks and returns the next retained surface.
|
|
VulkanSwapchain * | retainedNextForPreparation () const |
| | Borrows the next retained surface while the owner prepares the complete chain.
|
|
Result< SurfaceCapabilities > | capabilities () const |
| | What this surface supports, read from the physical device. Every value reported is accepted by configure, and every value absent from it is refused.
|
| Status | configure (const SurfaceConfiguration &configuration) |
| | Creates the swapchain configuration describes, replacing any previous one.
|
| Result< SurfaceStatus > | acquire () |
| | Acquires the next frame.
|
|
VkImage | currentImage () const |
| | Image of the frame currently held, or null when none is.
|
|
SurfaceWaitSync | takeAcquireWait () |
| | Hands over the wait the next submission must carry, and marks it taken. Empty once taken, or when no frame is held.
|
| void | restoreAcquireWait (VkSemaphore semaphore) |
| | Gives a taken wait back, for a submission that was never handed to the queue.
|
|
const std::optional< uint32_t > & | frameTextureSlot () const |
| | The texture slot the runtime gave this surface's frame, for deciding which submissions are writing it. Empty while no frame is held.
|
| void | setFrameTextureSlot (uint32_t textureSlot) |
| | Records the texture slot the runtime gave the current frame.
|
| Result< SurfaceStatus > | present (const TextureSyncState &state) |
| | Presents the frame currently held and releases it.
|
|
Status | abandon () |
| | Discards the frame currently held without presenting it, marking the swapchain for the recreation that reclaims it.
|
| void | setQueueSubmissionCallback (std::function< void()> callback) |
| | Has callback called after each queue submission of the swapchain's own that the queue accepted.
|
| void | forceNextAcquireOutOfDateForTest () |
| | Makes the next acquisition report the swapchain as out of date, before it asks for an image.
|
| void | forceMinimumImageCountOnceForTest () |
| | Makes the next swapchain creation ask for the fewest images this surface allows, so that a rebuild may produce a smaller acquisition ring than the one it replaces.
|
| bool | owesAcquireWaitForTest () const |
| | Whether this surface still owes the acquisition wait for the frame it holds.
|
|
size_t | frameRingSlotForTest () const |
| | The acquisition-ring slot the frame currently held was acquired on. Test accessor.
|
|
const std::optional< size_t > & | lastFencedRingSlotForTest () const |
| | The ring slot the most recent frame handover filed its fence under, or nothing when none has. Test accessor: that slot has to be the one whose semaphore the frame used, and the two drifting apart has only a timing-dependent symptom.
|
|
size_t | acquireRingSizeForTest () const |
| | Number of slots in the acquisition ring. Test accessor, for a test that has to land on a particular slot without knowing how many images the driver gave this swapchain.
|
|
const std::optional< SurfaceConfiguration > & | configuration () const |
| | Configuration the swapchain was created with, or nothing before it is configured.
|
|
Extent2d | extent () const |
| | Extent the swapchain was created with. Zero until configure succeeds.
|
One surface and the swapchain it presents through.
Presentation on Vulkan is three things the runtime's surface contract has to keep straight.
The frame is acquired with a semaphore, because the image comes back before the presentation engine has finished with it. Whichever submission first writes the frame waits on that semaphore (takeAcquireWait hands it over); if nothing ever writes the frame, the submission that presents or discards it does the waiting instead, so the semaphore is consumed exactly once either way and never left signalled.
The frame is presented from a layout the presentation engine can read, which nothing else uses, so present records the barrier into it and submits that barrier itself. Because the queue runs its submissions in order, that barrier also carries the dependency on every earlier submission of the frame, which is why any number of submissions may draw into one frame without each having to signal.
A frame that is acquired cannot be handed back: Vulkan has no operation that returns an image to its swapchain other than presenting it. abandon therefore strands the image and marks the swapchain for recreation, and the next acquisition recreates it - which is what actually reclaims the stranded frame.