tp::Application class

Represents the application using this library, storing all per-application state.

It can be used to gather information about instance-level capabilities and all available physical devices, out of which Device objects can be created.

Base classes

class Ownable
A customizable base class that is used for objects returned by the API in an OwningPtr.

Public static functions

static auto createApplication(const ApplicationSetup& appSetup) -> OwningPtr<Application>
Creates a tp::Application object according to the given setup structure.
static auto createApplication(VkInstanceHandle vkInstanceHandle, DebugReportHandler* debugReportHandler) -> OwningPtr<Application>
Creates a tp::Application object out of an existing Vulkan handle.
static auto getApiVersion() -> Version
Returns the API version of the Vulkan runtime library (loader).
static auto isExtensionAvailable(const char* extension, const char* sourceLayer = nullptr) -> bool
Returns true when the provided tp::ApplicationExtension or Vulkan instance extension is available.
static auto isLayerAvailable(const char* layer) -> bool
Returns true when the provided Vulkan instance layer is available.

Public functions

auto createDevice(const DeviceSetup& deviceSetup, const char* debugName = nullptr) -> OwningPtr<Device>
Creates a tp::Device object according to the given setup structure.
auto getPhysicalDevices() const -> ArrayView<const PhysicalDevice>
Returns the list of available physical devices on this platform.
auto vkGetInstanceHandle() const -> VkInstanceHandle
Returns the Vulkan VkInstance handle.
auto vkLoadInstanceProcedure(const char* procedureName) const -> PFN_vkVoidFunction
Loads a Vulkan instance procedure with the given name and returns a pointer to it, or nullptr if not successful.

Function documentation

static OwningPtr<Application> tp::Application::createApplication(const ApplicationSetup& appSetup)

Creates a tp::Application object according to the given setup structure.

Parameters
appSetup The setup structure describing the object.

static OwningPtr<Application> tp::Application::createApplication(VkInstanceHandle vkInstanceHandle, DebugReportHandler* debugReportHandler)

Creates a tp::Application object out of an existing Vulkan handle.

Parameters
vkInstanceHandle The Vulkan VkInstance handle.
debugReportHandler If not nullptr, points to the object responsible for reporting debug and validation information.

static bool tp::Application::isExtensionAvailable(const char* extension, const char* sourceLayer = nullptr)

Returns true when the provided tp::ApplicationExtension or Vulkan instance extension is available.

Parameters
extension The name of the extension, see tp::ApplicationExtension or list of Vulkan instance extensions
sourceLayer If nullptr, checks if the extension is provided by the base Vulkan implementation or any implicitly enabled layers. Otherwise, checks if the extensions is provided by the specified layer.

OwningPtr<Device> tp::Application::createDevice(const DeviceSetup& deviceSetup, const char* debugName = nullptr)

Creates a tp::Device object according to the given setup structure.

Parameters
deviceSetup The setup structure describing the object.
debugName The debug name identifier for the object.