1 | // Copyright (c) 2017-2023, The Khronos Group Inc. |
2 | // Copyright (c) 2017-2019 Valve Corporation |
3 | // Copyright (c) 2017-2019 LunarG, Inc. |
4 | // SPDX-License-Identifier: Apache-2.0 OR MIT |
5 | // *********** THIS FILE IS GENERATED - DO NOT EDIT *********** |
6 | // See loader_source_generator.py for modifications |
7 | // ************************************************************ |
8 | |
9 | // Copyright (c) 2017-2023, The Khronos Group Inc. |
10 | // Copyright (c) 2017-2019 Valve Corporation |
11 | // Copyright (c) 2017-2019 LunarG, Inc. |
12 | // |
13 | // SPDX-License-Identifier: Apache-2.0 |
14 | // |
15 | // Licensed under the Apache License, Version 2.0 (the "License"); |
16 | // you may not use this file except in compliance with the License. |
17 | // You may obtain a copy of the License at |
18 | // |
19 | // http://www.apache.org/licenses/LICENSE-2.0 |
20 | // |
21 | // Unless required by applicable law or agreed to in writing, software |
22 | // distributed under the License is distributed on an "AS IS" BASIS, |
23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
24 | // See the License for the specific language governing permissions and |
25 | // limitations under the License. |
26 | // |
27 | // Author: Mark Young <marky@lunarg.com> |
28 | // |
29 | |
30 | #include "xr_generated_loader.hpp" |
31 | |
32 | #include "api_layer_interface.hpp" |
33 | #include "exception_handling.hpp" |
34 | #include "hex_and_handles.h" |
35 | #include "loader_instance.hpp" |
36 | #include "loader_logger.hpp" |
37 | #include "loader_platform.hpp" |
38 | #include "runtime_interface.hpp" |
39 | #include "xr_generated_dispatch_table.h" |
40 | |
41 | #include "xr_dependencies.h" |
42 | #include <openxr/openxr.h> |
43 | #include <openxr/openxr_platform.h> |
44 | |
45 | #include <cstring> |
46 | #include <memory> |
47 | #include <new> |
48 | #include <string> |
49 | #include <unordered_map> |
50 | |
51 | |
52 | // Automatically generated instance trampolines and terminators |
53 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetInstanceProperties( |
54 | XrInstance instance, |
55 | XrInstanceProperties* instanceProperties) XRLOADER_ABI_TRY { |
56 | LoaderInstance* loader_instance; |
57 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetInstanceProperties" ); |
58 | if (XR_SUCCEEDED(result)) { |
59 | result = loader_instance->DispatchTable()->GetInstanceProperties(instance, instanceProperties); |
60 | } |
61 | return result; |
62 | } |
63 | XRLOADER_ABI_CATCH_FALLBACK |
64 | |
65 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrPollEvent( |
66 | XrInstance instance, |
67 | XrEventDataBuffer* eventData) XRLOADER_ABI_TRY { |
68 | LoaderInstance* loader_instance; |
69 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrPollEvent" ); |
70 | if (XR_SUCCEEDED(result)) { |
71 | result = loader_instance->DispatchTable()->PollEvent(instance, eventData); |
72 | } |
73 | return result; |
74 | } |
75 | XRLOADER_ABI_CATCH_FALLBACK |
76 | |
77 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrResultToString( |
78 | XrInstance instance, |
79 | XrResult value, |
80 | char buffer[XR_MAX_RESULT_STRING_SIZE]) XRLOADER_ABI_TRY { |
81 | LoaderInstance* loader_instance; |
82 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrResultToString" ); |
83 | if (XR_SUCCEEDED(result)) { |
84 | result = loader_instance->DispatchTable()->ResultToString(instance, value, buffer); |
85 | } |
86 | return result; |
87 | } |
88 | XRLOADER_ABI_CATCH_FALLBACK |
89 | |
90 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrStructureTypeToString( |
91 | XrInstance instance, |
92 | XrStructureType value, |
93 | char buffer[XR_MAX_STRUCTURE_NAME_SIZE]) XRLOADER_ABI_TRY { |
94 | LoaderInstance* loader_instance; |
95 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrStructureTypeToString" ); |
96 | if (XR_SUCCEEDED(result)) { |
97 | result = loader_instance->DispatchTable()->StructureTypeToString(instance, value, buffer); |
98 | } |
99 | return result; |
100 | } |
101 | XRLOADER_ABI_CATCH_FALLBACK |
102 | |
103 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetSystem( |
104 | XrInstance instance, |
105 | const XrSystemGetInfo* getInfo, |
106 | XrSystemId* systemId) XRLOADER_ABI_TRY { |
107 | LoaderInstance* loader_instance; |
108 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetSystem" ); |
109 | if (XR_SUCCEEDED(result)) { |
110 | result = loader_instance->DispatchTable()->GetSystem(instance, getInfo, systemId); |
111 | } |
112 | return result; |
113 | } |
114 | XRLOADER_ABI_CATCH_FALLBACK |
115 | |
116 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetSystemProperties( |
117 | XrInstance instance, |
118 | XrSystemId systemId, |
119 | XrSystemProperties* properties) XRLOADER_ABI_TRY { |
120 | LoaderInstance* loader_instance; |
121 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetSystemProperties" ); |
122 | if (XR_SUCCEEDED(result)) { |
123 | result = loader_instance->DispatchTable()->GetSystemProperties(instance, systemId, properties); |
124 | } |
125 | return result; |
126 | } |
127 | XRLOADER_ABI_CATCH_FALLBACK |
128 | |
129 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateEnvironmentBlendModes( |
130 | XrInstance instance, |
131 | XrSystemId systemId, |
132 | XrViewConfigurationType viewConfigurationType, |
133 | uint32_t environmentBlendModeCapacityInput, |
134 | uint32_t* environmentBlendModeCountOutput, |
135 | XrEnvironmentBlendMode* environmentBlendModes) XRLOADER_ABI_TRY { |
136 | LoaderInstance* loader_instance; |
137 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEnumerateEnvironmentBlendModes" ); |
138 | if (XR_SUCCEEDED(result)) { |
139 | result = loader_instance->DispatchTable()->EnumerateEnvironmentBlendModes(instance, systemId, viewConfigurationType, environmentBlendModeCapacityInput, environmentBlendModeCountOutput, environmentBlendModes); |
140 | } |
141 | return result; |
142 | } |
143 | XRLOADER_ABI_CATCH_FALLBACK |
144 | |
145 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrCreateSession( |
146 | XrInstance instance, |
147 | const XrSessionCreateInfo* createInfo, |
148 | XrSession* session) XRLOADER_ABI_TRY { |
149 | LoaderInstance* loader_instance; |
150 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrCreateSession" ); |
151 | if (XR_SUCCEEDED(result)) { |
152 | result = loader_instance->DispatchTable()->CreateSession(instance, createInfo, session); |
153 | } |
154 | return result; |
155 | } |
156 | XRLOADER_ABI_CATCH_FALLBACK |
157 | |
158 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrDestroySession( |
159 | XrSession session) XRLOADER_ABI_TRY { |
160 | LoaderInstance* loader_instance; |
161 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrDestroySession" ); |
162 | if (XR_SUCCEEDED(result)) { |
163 | result = loader_instance->DispatchTable()->DestroySession(session); |
164 | } |
165 | return result; |
166 | } |
167 | XRLOADER_ABI_CATCH_FALLBACK |
168 | |
169 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateReferenceSpaces( |
170 | XrSession session, |
171 | uint32_t spaceCapacityInput, |
172 | uint32_t* spaceCountOutput, |
173 | XrReferenceSpaceType* spaces) XRLOADER_ABI_TRY { |
174 | LoaderInstance* loader_instance; |
175 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEnumerateReferenceSpaces" ); |
176 | if (XR_SUCCEEDED(result)) { |
177 | result = loader_instance->DispatchTable()->EnumerateReferenceSpaces(session, spaceCapacityInput, spaceCountOutput, spaces); |
178 | } |
179 | return result; |
180 | } |
181 | XRLOADER_ABI_CATCH_FALLBACK |
182 | |
183 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrCreateReferenceSpace( |
184 | XrSession session, |
185 | const XrReferenceSpaceCreateInfo* createInfo, |
186 | XrSpace* space) XRLOADER_ABI_TRY { |
187 | LoaderInstance* loader_instance; |
188 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrCreateReferenceSpace" ); |
189 | if (XR_SUCCEEDED(result)) { |
190 | result = loader_instance->DispatchTable()->CreateReferenceSpace(session, createInfo, space); |
191 | } |
192 | return result; |
193 | } |
194 | XRLOADER_ABI_CATCH_FALLBACK |
195 | |
196 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetReferenceSpaceBoundsRect( |
197 | XrSession session, |
198 | XrReferenceSpaceType referenceSpaceType, |
199 | XrExtent2Df* bounds) XRLOADER_ABI_TRY { |
200 | LoaderInstance* loader_instance; |
201 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetReferenceSpaceBoundsRect" ); |
202 | if (XR_SUCCEEDED(result)) { |
203 | result = loader_instance->DispatchTable()->GetReferenceSpaceBoundsRect(session, referenceSpaceType, bounds); |
204 | } |
205 | return result; |
206 | } |
207 | XRLOADER_ABI_CATCH_FALLBACK |
208 | |
209 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrCreateActionSpace( |
210 | XrSession session, |
211 | const XrActionSpaceCreateInfo* createInfo, |
212 | XrSpace* space) XRLOADER_ABI_TRY { |
213 | LoaderInstance* loader_instance; |
214 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrCreateActionSpace" ); |
215 | if (XR_SUCCEEDED(result)) { |
216 | result = loader_instance->DispatchTable()->CreateActionSpace(session, createInfo, space); |
217 | } |
218 | return result; |
219 | } |
220 | XRLOADER_ABI_CATCH_FALLBACK |
221 | |
222 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrLocateSpace( |
223 | XrSpace space, |
224 | XrSpace baseSpace, |
225 | XrTime time, |
226 | XrSpaceLocation* location) XRLOADER_ABI_TRY { |
227 | LoaderInstance* loader_instance; |
228 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrLocateSpace" ); |
229 | if (XR_SUCCEEDED(result)) { |
230 | result = loader_instance->DispatchTable()->LocateSpace(space, baseSpace, time, location); |
231 | } |
232 | return result; |
233 | } |
234 | XRLOADER_ABI_CATCH_FALLBACK |
235 | |
236 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpace( |
237 | XrSpace space) XRLOADER_ABI_TRY { |
238 | LoaderInstance* loader_instance; |
239 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrDestroySpace" ); |
240 | if (XR_SUCCEEDED(result)) { |
241 | result = loader_instance->DispatchTable()->DestroySpace(space); |
242 | } |
243 | return result; |
244 | } |
245 | XRLOADER_ABI_CATCH_FALLBACK |
246 | |
247 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateViewConfigurations( |
248 | XrInstance instance, |
249 | XrSystemId systemId, |
250 | uint32_t viewConfigurationTypeCapacityInput, |
251 | uint32_t* viewConfigurationTypeCountOutput, |
252 | XrViewConfigurationType* viewConfigurationTypes) XRLOADER_ABI_TRY { |
253 | LoaderInstance* loader_instance; |
254 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEnumerateViewConfigurations" ); |
255 | if (XR_SUCCEEDED(result)) { |
256 | result = loader_instance->DispatchTable()->EnumerateViewConfigurations(instance, systemId, viewConfigurationTypeCapacityInput, viewConfigurationTypeCountOutput, viewConfigurationTypes); |
257 | } |
258 | return result; |
259 | } |
260 | XRLOADER_ABI_CATCH_FALLBACK |
261 | |
262 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetViewConfigurationProperties( |
263 | XrInstance instance, |
264 | XrSystemId systemId, |
265 | XrViewConfigurationType viewConfigurationType, |
266 | XrViewConfigurationProperties* configurationProperties) XRLOADER_ABI_TRY { |
267 | LoaderInstance* loader_instance; |
268 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetViewConfigurationProperties" ); |
269 | if (XR_SUCCEEDED(result)) { |
270 | result = loader_instance->DispatchTable()->GetViewConfigurationProperties(instance, systemId, viewConfigurationType, configurationProperties); |
271 | } |
272 | return result; |
273 | } |
274 | XRLOADER_ABI_CATCH_FALLBACK |
275 | |
276 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateViewConfigurationViews( |
277 | XrInstance instance, |
278 | XrSystemId systemId, |
279 | XrViewConfigurationType viewConfigurationType, |
280 | uint32_t viewCapacityInput, |
281 | uint32_t* viewCountOutput, |
282 | XrViewConfigurationView* views) XRLOADER_ABI_TRY { |
283 | LoaderInstance* loader_instance; |
284 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEnumerateViewConfigurationViews" ); |
285 | if (XR_SUCCEEDED(result)) { |
286 | result = loader_instance->DispatchTable()->EnumerateViewConfigurationViews(instance, systemId, viewConfigurationType, viewCapacityInput, viewCountOutput, views); |
287 | } |
288 | return result; |
289 | } |
290 | XRLOADER_ABI_CATCH_FALLBACK |
291 | |
292 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSwapchainFormats( |
293 | XrSession session, |
294 | uint32_t formatCapacityInput, |
295 | uint32_t* formatCountOutput, |
296 | int64_t* formats) XRLOADER_ABI_TRY { |
297 | LoaderInstance* loader_instance; |
298 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEnumerateSwapchainFormats" ); |
299 | if (XR_SUCCEEDED(result)) { |
300 | result = loader_instance->DispatchTable()->EnumerateSwapchainFormats(session, formatCapacityInput, formatCountOutput, formats); |
301 | } |
302 | return result; |
303 | } |
304 | XRLOADER_ABI_CATCH_FALLBACK |
305 | |
306 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchain( |
307 | XrSession session, |
308 | const XrSwapchainCreateInfo* createInfo, |
309 | XrSwapchain* swapchain) XRLOADER_ABI_TRY { |
310 | LoaderInstance* loader_instance; |
311 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrCreateSwapchain" ); |
312 | if (XR_SUCCEEDED(result)) { |
313 | result = loader_instance->DispatchTable()->CreateSwapchain(session, createInfo, swapchain); |
314 | } |
315 | return result; |
316 | } |
317 | XRLOADER_ABI_CATCH_FALLBACK |
318 | |
319 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrDestroySwapchain( |
320 | XrSwapchain swapchain) XRLOADER_ABI_TRY { |
321 | LoaderInstance* loader_instance; |
322 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrDestroySwapchain" ); |
323 | if (XR_SUCCEEDED(result)) { |
324 | result = loader_instance->DispatchTable()->DestroySwapchain(swapchain); |
325 | } |
326 | return result; |
327 | } |
328 | XRLOADER_ABI_CATCH_FALLBACK |
329 | |
330 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSwapchainImages( |
331 | XrSwapchain swapchain, |
332 | uint32_t imageCapacityInput, |
333 | uint32_t* imageCountOutput, |
334 | XrSwapchainImageBaseHeader* images) XRLOADER_ABI_TRY { |
335 | LoaderInstance* loader_instance; |
336 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEnumerateSwapchainImages" ); |
337 | if (XR_SUCCEEDED(result)) { |
338 | result = loader_instance->DispatchTable()->EnumerateSwapchainImages(swapchain, imageCapacityInput, imageCountOutput, images); |
339 | } |
340 | return result; |
341 | } |
342 | XRLOADER_ABI_CATCH_FALLBACK |
343 | |
344 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrAcquireSwapchainImage( |
345 | XrSwapchain swapchain, |
346 | const XrSwapchainImageAcquireInfo* acquireInfo, |
347 | uint32_t* index) XRLOADER_ABI_TRY { |
348 | LoaderInstance* loader_instance; |
349 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrAcquireSwapchainImage" ); |
350 | if (XR_SUCCEEDED(result)) { |
351 | result = loader_instance->DispatchTable()->AcquireSwapchainImage(swapchain, acquireInfo, index); |
352 | } |
353 | return result; |
354 | } |
355 | XRLOADER_ABI_CATCH_FALLBACK |
356 | |
357 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrWaitSwapchainImage( |
358 | XrSwapchain swapchain, |
359 | const XrSwapchainImageWaitInfo* waitInfo) XRLOADER_ABI_TRY { |
360 | LoaderInstance* loader_instance; |
361 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrWaitSwapchainImage" ); |
362 | if (XR_SUCCEEDED(result)) { |
363 | result = loader_instance->DispatchTable()->WaitSwapchainImage(swapchain, waitInfo); |
364 | } |
365 | return result; |
366 | } |
367 | XRLOADER_ABI_CATCH_FALLBACK |
368 | |
369 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrReleaseSwapchainImage( |
370 | XrSwapchain swapchain, |
371 | const XrSwapchainImageReleaseInfo* releaseInfo) XRLOADER_ABI_TRY { |
372 | LoaderInstance* loader_instance; |
373 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrReleaseSwapchainImage" ); |
374 | if (XR_SUCCEEDED(result)) { |
375 | result = loader_instance->DispatchTable()->ReleaseSwapchainImage(swapchain, releaseInfo); |
376 | } |
377 | return result; |
378 | } |
379 | XRLOADER_ABI_CATCH_FALLBACK |
380 | |
381 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrBeginSession( |
382 | XrSession session, |
383 | const XrSessionBeginInfo* beginInfo) XRLOADER_ABI_TRY { |
384 | LoaderInstance* loader_instance; |
385 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrBeginSession" ); |
386 | if (XR_SUCCEEDED(result)) { |
387 | result = loader_instance->DispatchTable()->BeginSession(session, beginInfo); |
388 | } |
389 | return result; |
390 | } |
391 | XRLOADER_ABI_CATCH_FALLBACK |
392 | |
393 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEndSession( |
394 | XrSession session) XRLOADER_ABI_TRY { |
395 | LoaderInstance* loader_instance; |
396 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEndSession" ); |
397 | if (XR_SUCCEEDED(result)) { |
398 | result = loader_instance->DispatchTable()->EndSession(session); |
399 | } |
400 | return result; |
401 | } |
402 | XRLOADER_ABI_CATCH_FALLBACK |
403 | |
404 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrRequestExitSession( |
405 | XrSession session) XRLOADER_ABI_TRY { |
406 | LoaderInstance* loader_instance; |
407 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrRequestExitSession" ); |
408 | if (XR_SUCCEEDED(result)) { |
409 | result = loader_instance->DispatchTable()->RequestExitSession(session); |
410 | } |
411 | return result; |
412 | } |
413 | XRLOADER_ABI_CATCH_FALLBACK |
414 | |
415 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrWaitFrame( |
416 | XrSession session, |
417 | const XrFrameWaitInfo* frameWaitInfo, |
418 | XrFrameState* frameState) XRLOADER_ABI_TRY { |
419 | LoaderInstance* loader_instance; |
420 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrWaitFrame" ); |
421 | if (XR_SUCCEEDED(result)) { |
422 | result = loader_instance->DispatchTable()->WaitFrame(session, frameWaitInfo, frameState); |
423 | } |
424 | return result; |
425 | } |
426 | XRLOADER_ABI_CATCH_FALLBACK |
427 | |
428 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrBeginFrame( |
429 | XrSession session, |
430 | const XrFrameBeginInfo* frameBeginInfo) XRLOADER_ABI_TRY { |
431 | LoaderInstance* loader_instance; |
432 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrBeginFrame" ); |
433 | if (XR_SUCCEEDED(result)) { |
434 | result = loader_instance->DispatchTable()->BeginFrame(session, frameBeginInfo); |
435 | } |
436 | return result; |
437 | } |
438 | XRLOADER_ABI_CATCH_FALLBACK |
439 | |
440 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEndFrame( |
441 | XrSession session, |
442 | const XrFrameEndInfo* frameEndInfo) XRLOADER_ABI_TRY { |
443 | LoaderInstance* loader_instance; |
444 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEndFrame" ); |
445 | if (XR_SUCCEEDED(result)) { |
446 | result = loader_instance->DispatchTable()->EndFrame(session, frameEndInfo); |
447 | } |
448 | return result; |
449 | } |
450 | XRLOADER_ABI_CATCH_FALLBACK |
451 | |
452 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrLocateViews( |
453 | XrSession session, |
454 | const XrViewLocateInfo* viewLocateInfo, |
455 | XrViewState* viewState, |
456 | uint32_t viewCapacityInput, |
457 | uint32_t* viewCountOutput, |
458 | XrView* views) XRLOADER_ABI_TRY { |
459 | LoaderInstance* loader_instance; |
460 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrLocateViews" ); |
461 | if (XR_SUCCEEDED(result)) { |
462 | result = loader_instance->DispatchTable()->LocateViews(session, viewLocateInfo, viewState, viewCapacityInput, viewCountOutput, views); |
463 | } |
464 | return result; |
465 | } |
466 | XRLOADER_ABI_CATCH_FALLBACK |
467 | |
468 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrStringToPath( |
469 | XrInstance instance, |
470 | const char* pathString, |
471 | XrPath* path) XRLOADER_ABI_TRY { |
472 | LoaderInstance* loader_instance; |
473 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrStringToPath" ); |
474 | if (XR_SUCCEEDED(result)) { |
475 | result = loader_instance->DispatchTable()->StringToPath(instance, pathString, path); |
476 | } |
477 | return result; |
478 | } |
479 | XRLOADER_ABI_CATCH_FALLBACK |
480 | |
481 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrPathToString( |
482 | XrInstance instance, |
483 | XrPath path, |
484 | uint32_t bufferCapacityInput, |
485 | uint32_t* bufferCountOutput, |
486 | char* buffer) XRLOADER_ABI_TRY { |
487 | LoaderInstance* loader_instance; |
488 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrPathToString" ); |
489 | if (XR_SUCCEEDED(result)) { |
490 | result = loader_instance->DispatchTable()->PathToString(instance, path, bufferCapacityInput, bufferCountOutput, buffer); |
491 | } |
492 | return result; |
493 | } |
494 | XRLOADER_ABI_CATCH_FALLBACK |
495 | |
496 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrCreateActionSet( |
497 | XrInstance instance, |
498 | const XrActionSetCreateInfo* createInfo, |
499 | XrActionSet* actionSet) XRLOADER_ABI_TRY { |
500 | LoaderInstance* loader_instance; |
501 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrCreateActionSet" ); |
502 | if (XR_SUCCEEDED(result)) { |
503 | result = loader_instance->DispatchTable()->CreateActionSet(instance, createInfo, actionSet); |
504 | } |
505 | return result; |
506 | } |
507 | XRLOADER_ABI_CATCH_FALLBACK |
508 | |
509 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrDestroyActionSet( |
510 | XrActionSet actionSet) XRLOADER_ABI_TRY { |
511 | LoaderInstance* loader_instance; |
512 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrDestroyActionSet" ); |
513 | if (XR_SUCCEEDED(result)) { |
514 | result = loader_instance->DispatchTable()->DestroyActionSet(actionSet); |
515 | } |
516 | return result; |
517 | } |
518 | XRLOADER_ABI_CATCH_FALLBACK |
519 | |
520 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrCreateAction( |
521 | XrActionSet actionSet, |
522 | const XrActionCreateInfo* createInfo, |
523 | XrAction* action) XRLOADER_ABI_TRY { |
524 | LoaderInstance* loader_instance; |
525 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrCreateAction" ); |
526 | if (XR_SUCCEEDED(result)) { |
527 | result = loader_instance->DispatchTable()->CreateAction(actionSet, createInfo, action); |
528 | } |
529 | return result; |
530 | } |
531 | XRLOADER_ABI_CATCH_FALLBACK |
532 | |
533 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrDestroyAction( |
534 | XrAction action) XRLOADER_ABI_TRY { |
535 | LoaderInstance* loader_instance; |
536 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrDestroyAction" ); |
537 | if (XR_SUCCEEDED(result)) { |
538 | result = loader_instance->DispatchTable()->DestroyAction(action); |
539 | } |
540 | return result; |
541 | } |
542 | XRLOADER_ABI_CATCH_FALLBACK |
543 | |
544 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrSuggestInteractionProfileBindings( |
545 | XrInstance instance, |
546 | const XrInteractionProfileSuggestedBinding* suggestedBindings) XRLOADER_ABI_TRY { |
547 | LoaderInstance* loader_instance; |
548 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrSuggestInteractionProfileBindings" ); |
549 | if (XR_SUCCEEDED(result)) { |
550 | result = loader_instance->DispatchTable()->SuggestInteractionProfileBindings(instance, suggestedBindings); |
551 | } |
552 | return result; |
553 | } |
554 | XRLOADER_ABI_CATCH_FALLBACK |
555 | |
556 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrAttachSessionActionSets( |
557 | XrSession session, |
558 | const XrSessionActionSetsAttachInfo* attachInfo) XRLOADER_ABI_TRY { |
559 | LoaderInstance* loader_instance; |
560 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrAttachSessionActionSets" ); |
561 | if (XR_SUCCEEDED(result)) { |
562 | result = loader_instance->DispatchTable()->AttachSessionActionSets(session, attachInfo); |
563 | } |
564 | return result; |
565 | } |
566 | XRLOADER_ABI_CATCH_FALLBACK |
567 | |
568 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetCurrentInteractionProfile( |
569 | XrSession session, |
570 | XrPath topLevelUserPath, |
571 | XrInteractionProfileState* interactionProfile) XRLOADER_ABI_TRY { |
572 | LoaderInstance* loader_instance; |
573 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetCurrentInteractionProfile" ); |
574 | if (XR_SUCCEEDED(result)) { |
575 | result = loader_instance->DispatchTable()->GetCurrentInteractionProfile(session, topLevelUserPath, interactionProfile); |
576 | } |
577 | return result; |
578 | } |
579 | XRLOADER_ABI_CATCH_FALLBACK |
580 | |
581 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStateBoolean( |
582 | XrSession session, |
583 | const XrActionStateGetInfo* getInfo, |
584 | XrActionStateBoolean* state) XRLOADER_ABI_TRY { |
585 | LoaderInstance* loader_instance; |
586 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetActionStateBoolean" ); |
587 | if (XR_SUCCEEDED(result)) { |
588 | result = loader_instance->DispatchTable()->GetActionStateBoolean(session, getInfo, state); |
589 | } |
590 | return result; |
591 | } |
592 | XRLOADER_ABI_CATCH_FALLBACK |
593 | |
594 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStateFloat( |
595 | XrSession session, |
596 | const XrActionStateGetInfo* getInfo, |
597 | XrActionStateFloat* state) XRLOADER_ABI_TRY { |
598 | LoaderInstance* loader_instance; |
599 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetActionStateFloat" ); |
600 | if (XR_SUCCEEDED(result)) { |
601 | result = loader_instance->DispatchTable()->GetActionStateFloat(session, getInfo, state); |
602 | } |
603 | return result; |
604 | } |
605 | XRLOADER_ABI_CATCH_FALLBACK |
606 | |
607 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStateVector2f( |
608 | XrSession session, |
609 | const XrActionStateGetInfo* getInfo, |
610 | XrActionStateVector2f* state) XRLOADER_ABI_TRY { |
611 | LoaderInstance* loader_instance; |
612 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetActionStateVector2f" ); |
613 | if (XR_SUCCEEDED(result)) { |
614 | result = loader_instance->DispatchTable()->GetActionStateVector2f(session, getInfo, state); |
615 | } |
616 | return result; |
617 | } |
618 | XRLOADER_ABI_CATCH_FALLBACK |
619 | |
620 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStatePose( |
621 | XrSession session, |
622 | const XrActionStateGetInfo* getInfo, |
623 | XrActionStatePose* state) XRLOADER_ABI_TRY { |
624 | LoaderInstance* loader_instance; |
625 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetActionStatePose" ); |
626 | if (XR_SUCCEEDED(result)) { |
627 | result = loader_instance->DispatchTable()->GetActionStatePose(session, getInfo, state); |
628 | } |
629 | return result; |
630 | } |
631 | XRLOADER_ABI_CATCH_FALLBACK |
632 | |
633 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrSyncActions( |
634 | XrSession session, |
635 | const XrActionsSyncInfo* syncInfo) XRLOADER_ABI_TRY { |
636 | LoaderInstance* loader_instance; |
637 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrSyncActions" ); |
638 | if (XR_SUCCEEDED(result)) { |
639 | result = loader_instance->DispatchTable()->SyncActions(session, syncInfo); |
640 | } |
641 | return result; |
642 | } |
643 | XRLOADER_ABI_CATCH_FALLBACK |
644 | |
645 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateBoundSourcesForAction( |
646 | XrSession session, |
647 | const XrBoundSourcesForActionEnumerateInfo* enumerateInfo, |
648 | uint32_t sourceCapacityInput, |
649 | uint32_t* sourceCountOutput, |
650 | XrPath* sources) XRLOADER_ABI_TRY { |
651 | LoaderInstance* loader_instance; |
652 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrEnumerateBoundSourcesForAction" ); |
653 | if (XR_SUCCEEDED(result)) { |
654 | result = loader_instance->DispatchTable()->EnumerateBoundSourcesForAction(session, enumerateInfo, sourceCapacityInput, sourceCountOutput, sources); |
655 | } |
656 | return result; |
657 | } |
658 | XRLOADER_ABI_CATCH_FALLBACK |
659 | |
660 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrGetInputSourceLocalizedName( |
661 | XrSession session, |
662 | const XrInputSourceLocalizedNameGetInfo* getInfo, |
663 | uint32_t bufferCapacityInput, |
664 | uint32_t* bufferCountOutput, |
665 | char* buffer) XRLOADER_ABI_TRY { |
666 | LoaderInstance* loader_instance; |
667 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrGetInputSourceLocalizedName" ); |
668 | if (XR_SUCCEEDED(result)) { |
669 | result = loader_instance->DispatchTable()->GetInputSourceLocalizedName(session, getInfo, bufferCapacityInput, bufferCountOutput, buffer); |
670 | } |
671 | return result; |
672 | } |
673 | XRLOADER_ABI_CATCH_FALLBACK |
674 | |
675 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrApplyHapticFeedback( |
676 | XrSession session, |
677 | const XrHapticActionInfo* hapticActionInfo, |
678 | const XrHapticBaseHeader* hapticFeedback) XRLOADER_ABI_TRY { |
679 | LoaderInstance* loader_instance; |
680 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrApplyHapticFeedback" ); |
681 | if (XR_SUCCEEDED(result)) { |
682 | result = loader_instance->DispatchTable()->ApplyHapticFeedback(session, hapticActionInfo, hapticFeedback); |
683 | } |
684 | return result; |
685 | } |
686 | XRLOADER_ABI_CATCH_FALLBACK |
687 | |
688 | extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrStopHapticFeedback( |
689 | XrSession session, |
690 | const XrHapticActionInfo* hapticActionInfo) XRLOADER_ABI_TRY { |
691 | LoaderInstance* loader_instance; |
692 | XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrStopHapticFeedback" ); |
693 | if (XR_SUCCEEDED(result)) { |
694 | result = loader_instance->DispatchTable()->StopHapticFeedback(session, hapticActionInfo); |
695 | } |
696 | return result; |
697 | } |
698 | XRLOADER_ABI_CATCH_FALLBACK |
699 | |
700 | |
701 | |