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

donner::gpu::vulkan::VulkanDevice - the Vulkan backend for the Donner GPU runtime. More...

#include <atomic>
#include <cstdint>
#include <functional>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <vector>
#include "donner/gpu/Device.h"
Include dependency graph for VulkanDevice.h:
This graph shows which files directly or indirectly include this file:

Classes

class  donner::gpu::vulkan::VulkanSurfaceRetirement
 Shared, atomically readable retirement disposition for an external Vulkan surface. More...
class  donner::gpu::vulkan::VulkanSharedRoot
 One native Vulkan instance, device and graphics queue shared by runtime devices. More...
class  donner::gpu::vulkan::VulkanPresentationProbe
 Presentation instance held while an embedder creates its platform surface. More...
class  donner::gpu::vulkan::VulkanDevice
 Vulkan backend of the Donner GPU runtime. More...
struct  donner::gpu::vulkan::VulkanDevice::SystemCapabilities
 What the physical device Create selects supports, which every device it opens shares. More...
struct  donner::gpu::vulkan::VulkanDevice::RecordedImageBarrierForTest
 One image barrier the backend recorded, reported as plain numbers so this header stays free of Vulkan types. Test accessor: which barriers are emitted is the whole contract of the resource-state model, and it is not observable in the pixels a test reads back. More...
struct  donner::gpu::vulkan::VulkanDevice::NativeContextForTest
 Borrowed native objects for tests that submit their own synchronization gate. Valid only until this device is destroyed; callers must use the owning thread, release every gate, and finish their native work before destroying any of these objects or the device. More...
struct  donner::gpu::vulkan::VulkanDevice::BufferWriteStats
 Snapshot of queued buffer-write ownership, without polling the queue. More...
struct  donner::gpu::vulkan::VulkanDevice::SurfaceAcquisitionForTest
 What a surface's acquisition bookkeeping looks like from outside, for the contracts whose only other symptom is timing dependent. More...

Namespaces

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

Enumerations

enum class  donner::gpu::vulkan::VulkanSurfaceRetirementState {
  Unattached ,
  Live ,
  Retired ,
  Unproven ,
  Released
}
 One external surface's irreversible backend retirement disposition.

Functions

std::vector< const char * > donner::gpu::vulkan::SelectPresentationExtensionsForTest (std::span< const char *const > offeredExtensions, std::span< const char *const > requiredExtensions)
 Selects presentation instance extensions from the names a loader offers. Exposed for deterministic platform-companion extension tests.

Detailed Description

donner::gpu::vulkan::VulkanDevice - the Vulkan backend for the Donner GPU runtime.


Class Documentation

◆ donner::gpu::vulkan::VulkanDevice::SystemCapabilities

struct donner::gpu::vulkan::VulkanDevice::SystemCapabilities

What the physical device Create selects supports, which every device it opens shares.

Class Members
uint32_t maxTextureDimension2D = 0 Largest width or height of a 2D texture the physical device allocates, from its maxImageDimension2D limit and capped at kMaxTextureDimension, the largest extent the runtime accepts.

◆ donner::gpu::vulkan::VulkanDevice::RecordedImageBarrierForTest

struct donner::gpu::vulkan::VulkanDevice::RecordedImageBarrierForTest

One image barrier the backend recorded, reported as plain numbers so this header stays free of Vulkan types. Test accessor: which barriers are emitted is the whole contract of the resource-state model, and it is not observable in the pixels a test reads back.

Class Members
uint32_t dstAccess = 0 Access made visible.
uint32_t dstStage = 0 Destination pipeline stage mask.
int32_t newLayout = 0 Layout the image moved to.
int32_t oldLayout = 0 Layout the image was in.
uint32_t srcAccess = 0 Access made available.
uint32_t srcStage = 0 Source pipeline stage mask.
uint32_t textureSlot = 0 Slot of the texture the barrier applies to.

◆ donner::gpu::vulkan::VulkanDevice::NativeContextForTest

struct donner::gpu::vulkan::VulkanDevice::NativeContextForTest

Borrowed native objects for tests that submit their own synchronization gate. Valid only until this device is destroyed; callers must use the owning thread, release every gate, and finish their native work before destroying any of these objects or the device.

Class Members
const VulkanApi * api Device entry points, owned by this device.
void * device Borrowed VkDevice.
void * instance Borrowed VkInstance, for a test that stands in for an embedder.
void * queue Borrowed VkQueue.
uint32_t queueFamilyIndex Family of the borrowed queue.

◆ donner::gpu::vulkan::VulkanDevice::BufferWriteStats

struct donner::gpu::vulkan::VulkanDevice::BufferWriteStats

Snapshot of queued buffer-write ownership, without polling the queue.

Class Members
uint64_t inFlightBytes = 0 Packed staging bytes retained until fence completion.
uint64_t lostDeviceDrains = 0 Lost-device submission drains completed before cleanup.
uint64_t pendingBytes = 0 Owned payload bytes awaiting submission.
size_t pendingWrites = 0 Coalesced writes awaiting an ordinary submission.
size_t retainedDestinations = 0 Retired destinations retained by outstanding uploads.
uint64_t stagingAllocations = 0 Successful staging allocations, including failed submits.
uint64_t submittedBatches = 0 Accepted submissions containing queued writes.

◆ donner::gpu::vulkan::VulkanDevice::SurfaceAcquisitionForTest

struct donner::gpu::vulkan::VulkanDevice::SurfaceAcquisitionForTest

What a surface's acquisition bookkeeping looks like from outside, for the contracts whose only other symptom is timing dependent.

Class Members
size_t frameRingSlot = 0 Ring slot the frame it holds was acquired on.
optional< size_t > lastFencedRingSlot Ring slot its last handover fenced.
bool live = false Whether that slot holds a surface at all.
bool owesAcquireWait = false Whether it still owes its frame's acquisition wait.
size_t ringSize = 0 Slots in its acquisition ring.

Function Documentation

◆ SelectPresentationExtensionsForTest()

std::vector< const char * > donner::gpu::vulkan::SelectPresentationExtensionsForTest ( std::span< const char *const > offeredExtensions,
std::span< const char *const > requiredExtensions )

Selects presentation instance extensions from the names a loader offers. Exposed for deterministic platform-companion extension tests.

Parameters
offeredExtensionsNUL-terminated names offered by the loader.
requiredExtensionsNUL-terminated embedder-required names.