+25
-3
src/xrt/state_trackers/oxr/oxr_api_swapchain.c
+25
-3
src/xrt/state_trackers/oxr/oxr_api_swapchain.c
···
1
1
// Copyright 2019-2020, Collabora, Ltd.
2
+
// Copyright 2024-2025, NVIDIA CORPORATION.
2
3
// SPDX-License-Identifier: BSL-1.0
3
4
/*!
4
5
* @file
···
82
83
83
84
// Short hand.
84
85
struct oxr_instance *inst = sess->sys->inst;
86
+
struct xrt_compositor_info *xc_info = &sess->compositor->info;
87
+
88
+
89
+
/*
90
+
* Usage flags.
91
+
*/
85
92
86
93
XrSwapchainUsageFlags flags = 0;
87
94
flags |= XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT;
···
102
109
"(createInfo->usageFlags == 0x%04" PRIx64 ") contains invalid flags",
103
110
createInfo->usageFlags);
104
111
}
112
+
113
+
114
+
/*
115
+
* Format.
116
+
*/
117
+
105
118
bool format_supported = false;
106
-
struct xrt_compositor *c = sess->compositor;
107
-
for (uint32_t i = 0; i < c->info.format_count; i++) {
108
-
if (c->info.formats[i] == createInfo->format) {
119
+
for (uint32_t i = 0; i < xc_info->format_count; i++) {
120
+
if (xc_info->formats[i] == createInfo->format) {
109
121
format_supported = true;
110
122
break;
111
123
}
···
115
127
return oxr_error(&log, XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED,
116
128
"(createInfo->format == 0x%04" PRIx64 ") is not supported", createInfo->format);
117
129
}
130
+
131
+
132
+
/*
133
+
* Format list.
134
+
*/
118
135
119
136
#ifdef OXR_HAVE_KHR_vulkan_swapchain_format_list
120
137
const XrVulkanSwapchainFormatListCreateInfoKHR *format_list = NULL;
···
136
153
}
137
154
}
138
155
#endif
156
+
157
+
158
+
/*
159
+
* Validation done.
160
+
*/
139
161
140
162
ret = sess->create_swapchain(&log, sess, createInfo, &sc);
141
163
if (ret != XR_SUCCESS) {