Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::vulkan::VulkanLoader Class Reference

Owns the dynamically opened Vulkan loader library and the VulkanApi resolved from it. More...

#include "donner/gpu/vulkan/VulkanLoader.h"

Public Member Functions

 ~VulkanLoader ()
 Closes the loader library.
 VulkanLoader (const VulkanLoader &)=delete
VulkanLoader & operator= (const VulkanLoader &)=delete
 VulkanLoader (VulkanLoader &&)=delete
VulkanLoader & operator= (VulkanLoader &&)=delete
const VulkanApiapi () const
 The resolved entry points. Members become non-null as each tier is loaded.
Status loadInstance (VkInstance instance, bool debugUtilsEnabled)
 Resolves the instance-level entry points against instance.
Status loadDevice (VkDevice device)
 Resolves the device-level entry points against device, bypassing the loader's instance-level dispatch for everything recorded per draw.

Static Public Member Functions

static Result< std::shared_ptr< VulkanLoader > > Open ()
 Opens the platform's Vulkan loader and resolves the global entry points.

Detailed Description

Owns the dynamically opened Vulkan loader library and the VulkanApi resolved from it.

The library stays open for as long as this object lives, which must outlive every Vulkan object created through it: closing the loader invalidates the code behind every resolved entry point. Devices therefore hold this by shared pointer.

All three loading steps fail closed with a GpuError naming exactly what was missing, so an embedder on a machine with no Vulkan installed gets a clean unsupported result rather than a crash.

Member Function Documentation

◆ loadDevice()

Status donner::gpu::vulkan::VulkanLoader::loadDevice ( VkDevice device)

Resolves the device-level entry points against device, bypassing the loader's instance-level dispatch for everything recorded per draw.

Parameters
deviceDevice the entry points are resolved for.

◆ loadInstance()

Status donner::gpu::vulkan::VulkanLoader::loadInstance ( VkInstance instance,
bool debugUtilsEnabled )

Resolves the instance-level entry points against instance.

Parameters
instanceInstance the entry points are resolved for.
debugUtilsEnabledTrue when the debug-utils extension was enabled on instance, in which case its two entry points are resolved as well; they stay null otherwise.

◆ Open()

Result< std::shared_ptr< VulkanLoader > > donner::gpu::vulkan::VulkanLoader::Open ( )
static

Opens the platform's Vulkan loader and resolves the global entry points.

The loader is opened by its stable versioned name first, since that is the name a deployed runtime is guaranteed to provide; the unversioned development symlink is a fallback for environments that ship only it.


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