|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Data Structures | |
| struct | mln_vulkan_device_options |
| struct | mln_vulkan_device_context_result |
Typedefs | |
| typedef enum mln_vulkan_device_option_field | mln_vulkan_device_option_field |
| typedef uint32_t | mln_vulkan_device_option_fields |
| typedef struct mln_vulkan_device_options | mln_vulkan_device_options |
| typedef struct mln_vulkan_device_context_result | mln_vulkan_device_context_result |
Enumerations | |
| enum | mln_vulkan_device_option_field : uint32_t { MLN_VULKAN_DEVICE_OPTION_PRESENTATION = 1U << 0U , MLN_VULKAN_DEVICE_OPTION_DEVICE_UUID = 1U << 1U , MLN_VULKAN_DEVICE_OPTION_DEVICE_LUID = 1U << 2U } |
Functions | |
| mln_status | mln_vulkan_device_create (const mln_vulkan_device_options *options, mln_vulkan_device *out_device, mln_diagnostic *out_diagnostic) |
| mln_status | mln_vulkan_device_get_context (mln_vulkan_device device, mln_vulkan_device_context_result *out_result, mln_diagnostic *out_diagnostic) |
| void | mln_vulkan_device_release (mln_vulkan_device device) |
Render with a Vulkan device that the library creates and owns.
| typedef struct mln_vulkan_device_context_result mln_vulkan_device_context_result |
A Vulkan device's context, as mln_vulkan_device_get_context() reports it.
The fields that mln_vulkan_device_options sets.
| typedef uint32_t mln_vulkan_device_option_fields |
A set of mln_vulkan_device_option_field bits.
| typedef struct mln_vulkan_device_options mln_vulkan_device_options |
Options for mln_vulkan_device_create().
| enum mln_vulkan_device_option_field : uint32_t |
The fields that mln_vulkan_device_options sets.
| Enumerator | |
|---|---|
| MLN_VULKAN_DEVICE_OPTION_PRESENTATION | |
| MLN_VULKAN_DEVICE_OPTION_DEVICE_UUID | |
| MLN_VULKAN_DEVICE_OPTION_DEVICE_LUID | |
| mln_status mln_vulkan_device_create | ( | const mln_vulkan_device_options * | options, |
| mln_vulkan_device * | out_device, | ||
| mln_diagnostic * | out_diagnostic ) |
Creates a Vulkan instance, device, and graphics queue for render sessions.
Attach sessions with the context from mln_vulkan_device_get_context(), in place of a device of your own. Without device_uuid or device_luid, it prefers a discrete GPU. The device enables the external memory and semaphore extensions that the GPU offers.
Returns:
| mln_status mln_vulkan_device_get_context | ( | mln_vulkan_device | device, |
| mln_vulkan_device_context_result * | out_result, | ||
| mln_diagnostic * | out_diagnostic ) |
Gets the context to attach render sessions to the device with.
Pass it as the context of mln_map_attach_vulkan_surface() or mln_map_attach_vulkan_borrowed_texture(). The sessions on the device share its graphics queue. To submit to the queue yourself, set mln_render_session_attach_options.queue_lock on each session.
Lifetimes: The objects that out_result names stay valid until you release the device.
| void mln_vulkan_device_release | ( | mln_vulkan_device | device | ) |
Releases a Vulkan device.
Render sessions that attached with the device's context keep using it until they detach or their release finishes.
Lifetimes: The library destroys the device once you release it and no session uses it. Destroy the Vulkan objects that you created with its context, such as images and surfaces, before then.