Monado OpenXR Runtime
Loading...
Searching...
No Matches
vk_image_readback_to_xf_pool.h
Go to the documentation of this file.
1// Copyright 2022, Collabora, Ltd.
2// Copyright 2025-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Pool to read back VkImages from the gpu
7 *
8 * @author Moshi Turner <moshiturner@protonmail.com>
9 * @author Jakob Bornecrantz <jakob@collabora.com>
10 * @ingroup aux_vk
11 */
12
13#pragma once
14
15#include "os/os_threading.h"
16
17#include "xrt/xrt_frame.h"
18#include "xrt/xrt_handles.h"
19#include "xrt/xrt_compositor.h"
21
22#include "util/u_logging.h"
24
25#include "vk/vk_helpers.h"
26
27
28#define READBACK_POOL_NUM_FRAMES 16
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34
35// Opaque handle
37
39{
40 struct xrt_frame base_frame;
41
43
44 VkImageLayout layout;
45
46 VkExtent2D image_extent;
47 VkImage image;
48 VkDeviceMemory memory;
49
50 bool in_use;
51 bool created;
52};
53
54
55bool
56vk_image_readback_to_xf_pool_get_unused_frame(struct vk_bundle *vk,
58 struct vk_image_readback_to_xf **out);
59
60void
61vk_image_readback_to_xf_pool_create(struct vk_bundle *vk,
62 VkExtent2D extent,
63 struct vk_image_readback_to_xf_pool **out_pool,
65 VkFormat vk_format);
66
67void
68vk_image_readback_to_xf_pool_destroy(struct vk_bundle *vk, struct vk_image_readback_to_xf_pool **pool_ptr);
69
70#ifdef __cplusplus
71}
72#endif
Wrapper around OS threading native functions.
Definition u_worker.c:50
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code.
Definition vk_helpers.h:75
Definition vk_image_readback_to_xf_pool.c:18
Definition vk_image_readback_to_xf_pool.h:39
Basic frame data structure - holds a pointer to buffer.
Definition xrt_frame.h:25
A collection of strings, like a list of extensions to enable.
Basic logging functionality.
Common Vulkan code header.
Header declaring XRT graphics interfaces.
xrt_format
Common formats, use u_format_* functions to reason about them.
Definition xrt_defines.h:193
Data frame header.
Native handle types.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.