|
Monado OpenXR Runtime
|
Independent swapchain implementation. More...
#include "xrt/xrt_compiler.h"#include "xrt/xrt_handles.h"#include "xrt/xrt_config_os.h"#include "xrt/xrt_results.h"#include "util/u_misc.h"#include "util/u_handles.h"#include "util/u_trace_marker.h"#include "util/u_limited_unique_id.h"#include "vk/vk_helpers.h"#include "vk/vk_cmd_pool.h"#include "vk/vk_mini_helpers.h"#include "util/comp_swapchain.h"#include <stdio.h>#include <stdlib.h>#include <errno.h>
Functions | |
| static void | swapchain_destroy (struct xrt_swapchain *xsc) |
| static xrt_result_t | swapchain_acquire_image (struct xrt_swapchain *xsc, uint32_t *out_index) |
| static xrt_result_t | swapchain_inc_image_use (struct xrt_swapchain *xsc, uint32_t index) |
| static xrt_result_t | swapchain_dec_image_use (struct xrt_swapchain *xsc, uint32_t index) |
| static xrt_result_t | swapchain_wait_image (struct xrt_swapchain *xsc, int64_t timeout_ns, uint32_t index) |
| static xrt_result_t | swapchain_release_image (struct xrt_swapchain *xsc, uint32_t index) |
| static struct comp_swapchain * | set_common_fields (struct comp_swapchain *sc, comp_swapchain_destroy_func_t destroy_func, struct vk_bundle *vk, struct comp_swapchain_shared *cscs, uint32_t image_count) |
| static void | image_view_array_cleanup (struct vk_bundle *vk, size_t array_size, VkImageView **views_ptr) |
| static void | image_cleanup (struct vk_bundle *vk, struct comp_swapchain_image *image) |
| Free and destroy any initialized fields on the given image, safe to pass in images that has one or all fields set to NULL. | |
| static void | cleanup_post_create_vulkan_setup (struct vk_bundle *vk, struct comp_swapchain *sc) |
| static XRT_CHECK_RESULT xrt_result_t | do_post_create_vulkan_setup (struct vk_bundle *vk, const struct xrt_swapchain_create_info *info, struct comp_swapchain *sc) |
| static void | really_destroy (struct comp_swapchain *sc) |
| Swapchain destruct is delayed until it is safe to destroy them, this function does the actual destruction and is called from comp_swapchain_shared_garbage_collect. | |
| xrt_result_t | comp_swapchain_create_init (struct comp_swapchain *sc, comp_swapchain_destroy_func_t destroy_func, struct vk_bundle *vk, struct comp_swapchain_shared *cscs, const struct xrt_swapchain_create_info *info, const struct xrt_swapchain_create_properties *xsccp) |
| Helper to init a comp_swachain struct as if it was a create operation, useful for wrapping comp_swapchain within another struct. | |
| xrt_result_t | comp_swapchain_import_init (struct comp_swapchain *sc, comp_swapchain_destroy_func_t destroy_func, struct vk_bundle *vk, struct comp_swapchain_shared *cscs, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t native_image_count) |
| Helper to init a comp_swachain struct as if it was a import operation, useful for wrapping comp_swapchain within another struct. | |
| void | comp_swapchain_teardown (struct comp_swapchain *sc) |
| De-inits a comp_swapchain, usable for classes sub-classing comp_swapchain. | |
| XRT_CHECK_RESULT xrt_result_t | comp_swapchain_shared_init (struct comp_swapchain_shared *cscs, struct vk_bundle *vk) |
| Create the shared struct. | |
| void | comp_swapchain_shared_destroy (struct comp_swapchain_shared *cscs, struct vk_bundle *vk) |
| Destroy the shared struct. | |
| void | comp_swapchain_shared_garbage_collect (struct comp_swapchain_shared *cscs) |
| Do garbage collection, destroying any resources that has been scheduled for destruction from other threads. | |
| xrt_result_t | comp_swapchain_get_create_properties (const struct xrt_swapchain_create_info *info, struct xrt_swapchain_create_properties *xsccp) |
| A compositor function that is implemented in the swapchain code. | |
| xrt_result_t | comp_swapchain_create (struct vk_bundle *vk, struct comp_swapchain_shared *cscs, const struct xrt_swapchain_create_info *info, const struct xrt_swapchain_create_properties *xsccp, struct xrt_swapchain **out_xsc) |
| A compositor function that is implemented in the swapchain code. | |
| xrt_result_t | comp_swapchain_import (struct vk_bundle *vk, struct comp_swapchain_shared *cscs, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t native_image_count, struct xrt_swapchain **out_xsc) |
| A compositor function that is implemented in the swapchain code. | |
Independent swapchain implementation.
|
static |
References comp_swapchain_image::array_size, comp_swapchain::fifo, xrt_swapchain::image_count, vk_image_collection::images, U_TYPED_ARRAY_CALLOC, comp_swapchain_image::use_cond, comp_swapchain_image::use_count, comp_swapchain_image::use_mutex, comp_swapchain_image::views, VK_CHK_WITH_GOTO, vk_cmd_image_barrier_gpu_locked(), vk_cmd_pool::vk_cmd_pool_create_and_begin_cmd_buffer_locked(), vk_cmd_pool::vk_cmd_pool_end_submit_wait_and_free_cmd_buffer_locked(), vk_cmd_pool::vk_cmd_pool_lock(), vk_cmd_pool::vk_cmd_pool_unlock(), vk_csci_get_barrier_aspect_mask(), vk_csci_get_image_view_aspect(), XRT_ERROR_THREADING_INIT_FAILURE, XRT_ERROR_VULKAN, and XRT_SUCCESS.
Referenced by comp_swapchain_create_init(), and comp_swapchain_import_init().
|
static |
Free and destroy any initialized fields on the given image, safe to pass in images that has one or all fields set to NULL.
References comp_swapchain_image::array_size, vk_bundle::main_queue, and comp_swapchain_image::views.
Referenced by comp_swapchain_teardown().