Monado OpenXR Runtime
Loading...
Searching...
No Matches
vk_image_collection.c File Reference

Vulkan image collection implementing xrt_allocation_collection. More...

#include "xrt/xrt_config_vulkan.h"
#include "xrt/xrt_compositor.h"
#include "util/u_misc.h"
#include "util/u_logging.h"
#include "util/u_allocation_collection.h"
#include "vk/vk_helpers.h"
#include "vk/vk_image_allocator.h"
#include "vk/vk_image_collection.h"
#include <assert.h>
Include dependency graph for vk_image_collection.c:

Data Structures

struct  vk_xrt_image_collection
 Implementation of xrt_allocation_collection that wraps a vk_image_collection. More...
 

Functions

static struct vk_xrt_image_collection * vk_xrt_image_collection (struct xrt_allocation_collection *xac)
 
static xrt_result_t move_native_images (struct vk_xrt_image_collection *vxic, struct xrt_image_native *out_native_images)
 Export new native handles for all images and move them to the caller, see XRT_ALLOCATION_TYPE_NATIVE_IMAGE for ownership.
 
static xrt_result_t vk_xic_get_property (struct xrt_allocation_collection *xac, enum xrt_allocation_property prop, void *ptr)
 
static xrt_result_t vk_xic_get_all (struct xrt_allocation_collection *xac, enum xrt_allocation_type type, void *ptr)
 
static void vk_xic_destroy (struct xrt_allocation_collection *xac)
 
static void init_base (struct vk_xrt_image_collection *vxic, struct vk_bundle *vk, const struct xrt_swapchain_create_info *xscci, uint32_t image_count, bool supports_native_images)
 
xrt_result_t vk_xac_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 xrt_allocation_collection backed by Vulkan images.
 
xrt_result_t vk_xac_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)
 Creates a new xrt_allocation_collection by importing native image handles.
 
xrt_result_t vk_xac_create (struct vk_bundle *vk, struct vk_image_collection *vkic, struct xrt_allocation_collection **out_xac)
 Creates a new xrt_allocation_collection that wraps a vk_image_collection.
 

Detailed Description

Vulkan image collection implementing xrt_allocation_collection.

Author
Jakob Bornecrantz tborn.nosp@m.ecra.nosp@m.ntz@n.nosp@m.vidi.nosp@m.a.com

Function Documentation

◆ move_native_images()

static xrt_result_t move_native_images ( struct vk_xrt_image_collection *  vxic,
struct xrt_image_native *  out_native_images 
)
static

Export new native handles for all images and move them to the caller, see XRT_ALLOCATION_TYPE_NATIVE_IMAGE for ownership.

The handles are not cached in the collection, we don't want handles hanging around as there is a limit on how many handles can be open at the same time.

References vk_xrt_image_collection::base, xrt_image_native::handle, xrt_allocation_collection::image_count, vk_image_collection::images, xrt_image_native::size, vk_xrt_image_collection::supports_native_images, U_LOG_E, U_ZERO, xrt_image_native::use_dedicated_allocation, vk_xrt_image_collection::vk, vk_ic_get_handles(), vk_xrt_image_collection::vkic, XRT_ERROR_VULKAN, XRT_MAX_SWAPCHAIN_IMAGES, and XRT_SUCCESS.