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