|
Monado OpenXR Runtime
|

Files | |
| file | a_allocator.c |
| Auxiliary allocation collection helpers. | |
Functions | |
| xrt_result_t | a_allocator_allocate (struct vk_bundle *vk, const struct xrt_swapchain_create_info *xscci, uint32_t image_count, struct xrt_allocation_collection **out_xac) |
| Allocates a new allocation collection for the given swapchain create info. | |
| xrt_result_t | a_allocator_import_from_native_images (struct vk_bundle *vk, const struct xrt_swapchain_create_info *xscci, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_allocation_collection **out_xac) |
| Imports native images into a new allocation collection. | |
| xrt_result_t | a_allocator_ensure_vk_images (struct vk_bundle *vk, struct xrt_allocation_collection *xac, struct xrt_allocation_collection **out_xac) |
| Ensures the allocation collection supports retrieving VkImages. | |
| xrt_result_t a_allocator_allocate | ( | struct vk_bundle * | vk, |
| const struct xrt_swapchain_create_info * | xscci, | ||
| uint32_t | image_count, | ||
| struct xrt_allocation_collection ** | out_xac | ||
| ) |
#include <auxiliary/allocation/a_allocator.h>
Allocates a new allocation collection for the given swapchain create info.
Abstracts platform-specific differences (e.g., Metal on macOS, Vulkan elsewhere).
| vk | Vulkan bundle. |
| xscci | Swapchain creation info describing the images. |
| image_count | Number of images to allocate. |
| out_xac | Pointer to receive the new allocation collection. |
References vk_xac_allocate(), XRT_ERROR_ALLOCATION, and XVK_CHK_ALWAYS_RET.
Referenced by comp_swapchain_create_init().
| xrt_result_t a_allocator_ensure_vk_images | ( | struct vk_bundle * | vk, |
| struct xrt_allocation_collection * | xac, | ||
| struct xrt_allocation_collection ** | out_xac | ||
| ) |
#include <auxiliary/allocation/a_allocator.h>
Ensures the allocation collection supports retrieving VkImages.
Takes an existing allocation collection and returns one that supports getting VkImages. The conversion logic is as follows:
| vk | Vulkan bundle. |
| xac | Existing allocation collection to convert. |
| out_xac | Pointer to receive the allocation collection with VkImage support. |
References a_allocator_import_from_native_images(), xrt_image_native::handle, xrt_allocation_collection::image_count, xrt_allocation_collection::supported_properties, xrt_allocation_collection::supported_properties_count, xrt_allocation_collection::supported_types, xrt_allocation_collection::supported_types_count, U_LOG_E, U_TYPED_ARRAY_CALLOC, XRT_ALLOCATION_PROPERTY_METAL_DEVICE, XRT_ALLOCATION_PROPERTY_SWAPCHAIN_INFO, XRT_ALLOCATION_PROPERTY_VK_DEVICE, XRT_ALLOCATION_TYPE_IOSURFACE, XRT_ALLOCATION_TYPE_METAL_TEXTURE, XRT_ALLOCATION_TYPE_NATIVE_IMAGE, XRT_ALLOCATION_TYPE_VULKAN_IMAGE, XRT_ERROR_ALLOCATION, XRT_SUCCESS, XVK_CHK_AND_RET, and XVK_CHK_ONLY_PRINT.
Referenced by client_vk_swapchain_create().
| xrt_result_t a_allocator_import_from_native_images | ( | struct vk_bundle * | vk, |
| const struct xrt_swapchain_create_info * | xscci, | ||
| struct xrt_image_native * | native_images, | ||
| uint32_t | image_count, | ||
| struct xrt_allocation_collection ** | out_xac | ||
| ) |
#include <auxiliary/allocation/a_allocator.h>
Imports native images into a new allocation collection.
Takes ownership of the native handles in the native_images array. On success, the handles are consumed and should not be used by the caller. On failure, the handles remain valid and owned by the caller. This is an all-or-nothing operation.
| vk | Vulkan bundle. |
| xscci | Swapchain creation info describing the images. |
| native_images | Array of native image handles to import (ownership transferred on success). |
| image_count | Number of images to import. |
| out_xac | Pointer to receive the new allocation collection. |
References vk_xac_from_native_images(), and XRT_ERROR_ALLOCATION.
Referenced by a_allocator_ensure_vk_images(), and comp_swapchain_import_init().