Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
VulkanSwapchain.h File Reference

donner::gpu::vulkan::VulkanSwapchain - a Vulkan surface, its swapchain, and the synchronization one frame of presentation needs. More...

#include <vulkan/vulkan.h>
#include <atomic>
#include <cstdint>
#include <functional>
#include <memory>
#include <mutex>
#include <optional>
#include <utility>
#include <vector>
#include "donner/gpu/Descriptors.h"
#include "donner/gpu/DeviceLost.h"
#include "donner/gpu/GpuResult.h"
#include "donner/gpu/vulkan/VulkanLoader.h"
#include "donner/gpu/vulkan/VulkanQueueProgress.h"
#include "donner/gpu/vulkan/VulkanResourceState.h"
Include dependency graph for VulkanSwapchain.h:

Classes

struct  donner::gpu::vulkan::VulkanSurfaceLifetime
 Preallocated owner/child teardown state shared by every surface of one device. More...
struct  donner::gpu::vulkan::VulkanSurfaceContext
 What a swapchain borrows from the device that owns it. None of these are owned here, and all of them outlive the swapchain. More...
struct  donner::gpu::vulkan::SurfaceWaitSync
 Semaphores a submission must wait on, with the stages that wait applies to. More...
class  donner::gpu::vulkan::VulkanSwapchain
 One surface and the swapchain it presents through. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

std::vector< TextureFormat > donner::gpu::vulkan::RuntimeSurfaceFormatsForTest (const std::vector< VkSurfaceFormatKHR > &nativeFormats)
 Converts native surface formats into the formats the runtime can present. Exposed for deterministic capability tests whose driver cannot advertise the wildcard.
TextureSyncState donner::gpu::vulkan::AcquiredFrameSyncState ()
 The synchronization state a frame is in the moment it is acquired.

Variables

constexpr VkPipelineStageFlags donner::gpu::vulkan::kAcquireWaitStage
 The stage an acquisition wait applies to, and therefore the earliest stage at which a frame may be written.

Detailed Description

donner::gpu::vulkan::VulkanSwapchain - a Vulkan surface, its swapchain, and the synchronization one frame of presentation needs.

Function Documentation

◆ AcquiredFrameSyncState()

TextureSyncState donner::gpu::vulkan::AcquiredFrameSyncState ( )
inline

The synchronization state a frame is in the moment it is acquired.

Its contents are undefined, and the last thing to have touched it is the presentation engine's read, which the acquisition semaphore orders against kAcquireWaitStage. Recording that stage rather than the top of the pipe is what places the frame's first layout transition after the wait; a transition from the top of the pipe is a write the wait does not cover, which synchronization validation reports as a write-after-read hazard against the presentation engine.

◆ RuntimeSurfaceFormatsForTest()

std::vector< TextureFormat > donner::gpu::vulkan::RuntimeSurfaceFormatsForTest ( const std::vector< VkSurfaceFormatKHR > & nativeFormats)

Converts native surface formats into the formats the runtime can present. Exposed for deterministic capability tests whose driver cannot advertise the wildcard.

Parameters
nativeFormatsFormats reported by the presentation engine.

Variable Documentation

◆ kAcquireWaitStage

VkPipelineStageFlags donner::gpu::vulkan::kAcquireWaitStage
inlineconstexpr
Initial value:
=
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT

The stage an acquisition wait applies to, and therefore the earliest stage at which a frame may be written.

Shared by the wait itself and by the synchronization state a freshly acquired frame starts in, so the two cannot drift: a frame whose first barrier claimed an earlier source stage would be writing the image outside what the wait covers.