Vulkan renderer systems

This section documents the renderer systems found in Vulkan renderer objects, and their associated functions.


Types

Objects

typedef struct TLVK_RendererSystem_t TLVK_RendererSystem_t

A renderer system to hold Vulkan-specific rendering data.

This structure holds per-renderer data for rendering with Vulkan.

Note that this data does not include a VkInstance, as the instance is stored per-context rather than per-renderer. All Vulkan render sytems in an application refer to the same instance, which is created when allocating and populating the context data.

Descriptors

struct TLVK_RendererSystemDescriptor_t

Descriptor struct to configure the creation of a Thallium renderer system for Vulkan.

This descriptor structure provides options for the creation of Thallium renderer systems.

Public Members

TLVK_PhysicalDeviceSelectionMode_t physical_device_mode

A TLVK_PhysicalDeviceSelectionMode_t enum indicating the mode of selection for the Vulkan physical device used by the renderer system.


Functions

TLVK_RendererSystem_t *TLVK_RendererSystemCreate(TL_Renderer_t *const renderer, const TLVK_RendererSystemDescriptor_t descriptor)

Create and return a heap-allocated Vulkan renderer system.

This function creates a new Vulkan renderer system and returns it. If there were any errors in creation, NULL will be returned instead.

See also

TLVK_RendererSystem_t

Parameters:
  • renderer – pointer to the parent renderer object

  • descriptor – Thallium Vulkan renderer system descriptor

Returns:

The new renderer system

void TLVK_RendererSystemDestroy(TLVK_RendererSystem_t *const renderer_system)

Free the given Thallium Vulkan renderer system object.

This function frees the specified renderer system object.

See also

TLVK_RendererSystem_t

Parameters:
  • renderer_system – Pointer to the Thallium Vulkan renderer system to free.


Physical device selection

enum TLVK_PhysicalDeviceSelectionMode_t

Enumeration containing modes of physical device selection in a Vulkan renderer system.

This enumeration contains modes of physical device selection available to be used when creating a Vulkan renderer system.

Values:

enumerator TLVK_PHYSICAL_DEVICE_SELECTION_MODE_OPTIMAL

Use the most optimal physical device for the renderer system, based on queue families, and available extensions, device features, memory size, device type, etc. This mode may result in more processing but will usually result in the best GPU being used. This is the default behaviour.

enumerator TLVK_PHYSICAL_DEVICE_SELECTION_MODE_FIRST

Use the first possible physical device for the renderer system. This could result in a device that does not support the required Vulkan extensions or features being used, leading to some missing features. Queue families will still be validated.