Monado OpenXR Runtime
Loading...
Searching...
No Matches
u_allocation_collection.h
Go to the documentation of this file.
1// Copyright 2026, NVIDIA CORPORATION.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Helpers for @ref xrt_allocation_collection.
6 * @author Jakob Bornecrantz <tbornecrantz@nvidia.com>
7 * @ingroup aux_util
8 */
9
10#pragma once
11
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/*!
19 * Is @p prop in the supported properties of @p xac.
20 *
21 * @ingroup aux_util
22 */
23static inline bool
26{
27 for (uint32_t i = 0; i < xac->supported_properties_count; i++) {
28 if (xac->supported_properties[i].property == prop) {
29 return true;
30 }
31 }
32 return false;
33}
34
35/*!
36 * Is @p type in the supported allocation types of @p xac.
37 *
38 * @ingroup aux_util
39 */
40static inline bool
42{
43 for (uint32_t i = 0; i < xac->supported_types_count; i++) {
44 if (xac->supported_types[i].type == type) {
45 return true;
46 }
47 }
48 return false;
49}
50
51#ifdef __cplusplus
52}
53#endif
static bool u_allocation_collection_supports_property(const struct xrt_allocation_collection *xac, enum xrt_allocation_property prop)
Is prop in the supported properties of xac.
Definition u_allocation_collection.h:24
static bool u_allocation_collection_supports_type(const struct xrt_allocation_collection *xac, enum xrt_allocation_type type)
Is type in the supported allocation types of xac.
Definition u_allocation_collection.h:41
xrt_allocation_property
Allocation collection property, the properties that can be queried with the xrt_allocation_collection...
Definition xrt_allocation_collection.h:40
xrt_allocation_type
Allocation type, the types that the allocation collection can return from the xrt_allocation_collecti...
Definition xrt_allocation_collection.h:121
A collection of allocations, these can be images, buffers or general memory.
Definition xrt_allocation_collection.h:224
uint32_t supported_types_count
Number of supported allocation types.
Definition xrt_allocation_collection.h:267
struct xrt_allocation_collection::@241 supported_types[XRT_MAX_ALLOCATION_TYPE_COUNT]
Supported allocation types that can be queried from the get_all function.
uint32_t supported_properties_count
Number of supported properties.
Definition xrt_allocation_collection.h:251
struct xrt_allocation_collection::@240 supported_properties[XRT_MAX_ALLOCATION_PROPERTY_COUNT]
Supported properties that can be queried from the get_property function.
Allocation collection.