1#ifndef OPENXR_PLATFORM_H_
2#define OPENXR_PLATFORM_H_ 1
3
4/*
5** Copyright 2017-2023 The Khronos Group Inc.
6**
7** SPDX-License-Identifier: Apache-2.0 OR MIT
8*/
9
10/*
11** This header is generated from the Khronos OpenXR XML API Registry.
12**
13*/
14
15#include "openxr.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21
22#ifdef XR_USE_PLATFORM_ANDROID
23
24#define XR_KHR_android_thread_settings 1
25#define XR_KHR_android_thread_settings_SPEC_VERSION 5
26#define XR_KHR_ANDROID_THREAD_SETTINGS_EXTENSION_NAME "XR_KHR_android_thread_settings"
27
28typedef enum XrAndroidThreadTypeKHR {
29 XR_ANDROID_THREAD_TYPE_APPLICATION_MAIN_KHR = 1,
30 XR_ANDROID_THREAD_TYPE_APPLICATION_WORKER_KHR = 2,
31 XR_ANDROID_THREAD_TYPE_RENDERER_MAIN_KHR = 3,
32 XR_ANDROID_THREAD_TYPE_RENDERER_WORKER_KHR = 4,
33 XR_ANDROID_THREAD_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF
34} XrAndroidThreadTypeKHR;
35typedef XrResult (XRAPI_PTR *PFN_xrSetAndroidApplicationThreadKHR)(XrSession session, XrAndroidThreadTypeKHR threadType, uint32_t threadId);
36
37#ifndef XR_NO_PROTOTYPES
38#ifdef XR_EXTENSION_PROTOTYPES
39XRAPI_ATTR XrResult XRAPI_CALL xrSetAndroidApplicationThreadKHR(
40 XrSession session,
41 XrAndroidThreadTypeKHR threadType,
42 uint32_t threadId);
43#endif /* XR_EXTENSION_PROTOTYPES */
44#endif /* !XR_NO_PROTOTYPES */
45#endif /* XR_USE_PLATFORM_ANDROID */
46
47#ifdef XR_USE_PLATFORM_ANDROID
48
49#define XR_KHR_android_surface_swapchain 1
50#define XR_KHR_android_surface_swapchain_SPEC_VERSION 4
51#define XR_KHR_ANDROID_SURFACE_SWAPCHAIN_EXTENSION_NAME "XR_KHR_android_surface_swapchain"
52typedef XrResult (XRAPI_PTR *PFN_xrCreateSwapchainAndroidSurfaceKHR)(XrSession session, const XrSwapchainCreateInfo* info, XrSwapchain* swapchain, jobject* surface);
53
54#ifndef XR_NO_PROTOTYPES
55#ifdef XR_EXTENSION_PROTOTYPES
56XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchainAndroidSurfaceKHR(
57 XrSession session,
58 const XrSwapchainCreateInfo* info,
59 XrSwapchain* swapchain,
60 jobject* surface);
61#endif /* XR_EXTENSION_PROTOTYPES */
62#endif /* !XR_NO_PROTOTYPES */
63#endif /* XR_USE_PLATFORM_ANDROID */
64
65#ifdef XR_USE_PLATFORM_ANDROID
66
67#define XR_KHR_android_create_instance 1
68#define XR_KHR_android_create_instance_SPEC_VERSION 3
69#define XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME "XR_KHR_android_create_instance"
70// XrInstanceCreateInfoAndroidKHR extends XrInstanceCreateInfo
71typedef struct XrInstanceCreateInfoAndroidKHR {
72 XrStructureType type;
73 const void* XR_MAY_ALIAS next;
74 void* XR_MAY_ALIAS applicationVM;
75 void* XR_MAY_ALIAS applicationActivity;
76} XrInstanceCreateInfoAndroidKHR;
77
78#endif /* XR_USE_PLATFORM_ANDROID */
79
80#ifdef XR_USE_GRAPHICS_API_VULKAN
81
82#define XR_KHR_vulkan_swapchain_format_list 1
83#define XR_KHR_vulkan_swapchain_format_list_SPEC_VERSION 4
84#define XR_KHR_VULKAN_SWAPCHAIN_FORMAT_LIST_EXTENSION_NAME "XR_KHR_vulkan_swapchain_format_list"
85typedef struct XrVulkanSwapchainFormatListCreateInfoKHR {
86 XrStructureType type;
87 const void* XR_MAY_ALIAS next;
88 uint32_t viewFormatCount;
89 const VkFormat* viewFormats;
90} XrVulkanSwapchainFormatListCreateInfoKHR;
91
92#endif /* XR_USE_GRAPHICS_API_VULKAN */
93
94#ifdef XR_USE_GRAPHICS_API_OPENGL
95
96#define XR_KHR_opengl_enable 1
97#define XR_KHR_opengl_enable_SPEC_VERSION 10
98#define XR_KHR_OPENGL_ENABLE_EXTENSION_NAME "XR_KHR_opengl_enable"
99#ifdef XR_USE_PLATFORM_WIN32
100// XrGraphicsBindingOpenGLWin32KHR extends XrSessionCreateInfo
101typedef struct XrGraphicsBindingOpenGLWin32KHR {
102 XrStructureType type;
103 const void* XR_MAY_ALIAS next;
104 HDC hDC;
105 HGLRC hGLRC;
106} XrGraphicsBindingOpenGLWin32KHR;
107#endif // XR_USE_PLATFORM_WIN32
108
109#ifdef XR_USE_PLATFORM_XLIB
110// XrGraphicsBindingOpenGLXlibKHR extends XrSessionCreateInfo
111typedef struct XrGraphicsBindingOpenGLXlibKHR {
112 XrStructureType type;
113 const void* XR_MAY_ALIAS next;
114 Display* xDisplay;
115 uint32_t visualid;
116 GLXFBConfig glxFBConfig;
117 GLXDrawable glxDrawable;
118 GLXContext glxContext;
119} XrGraphicsBindingOpenGLXlibKHR;
120#endif // XR_USE_PLATFORM_XLIB
121
122#ifdef XR_USE_PLATFORM_XCB
123// XrGraphicsBindingOpenGLXcbKHR extends XrSessionCreateInfo
124typedef struct XrGraphicsBindingOpenGLXcbKHR {
125 XrStructureType type;
126 const void* XR_MAY_ALIAS next;
127 xcb_connection_t* connection;
128 uint32_t screenNumber;
129 xcb_glx_fbconfig_t fbconfigid;
130 xcb_visualid_t visualid;
131 xcb_glx_drawable_t glxDrawable;
132 xcb_glx_context_t glxContext;
133} XrGraphicsBindingOpenGLXcbKHR;
134#endif // XR_USE_PLATFORM_XCB
135
136#ifdef XR_USE_PLATFORM_WAYLAND
137// XrGraphicsBindingOpenGLWaylandKHR extends XrSessionCreateInfo
138typedef struct XrGraphicsBindingOpenGLWaylandKHR {
139 XrStructureType type;
140 const void* XR_MAY_ALIAS next;
141 struct wl_display* display;
142} XrGraphicsBindingOpenGLWaylandKHR;
143#endif // XR_USE_PLATFORM_WAYLAND
144
145typedef struct XrSwapchainImageOpenGLKHR {
146 XrStructureType type;
147 void* XR_MAY_ALIAS next;
148 uint32_t image;
149} XrSwapchainImageOpenGLKHR;
150
151typedef struct XrGraphicsRequirementsOpenGLKHR {
152 XrStructureType type;
153 void* XR_MAY_ALIAS next;
154 XrVersion minApiVersionSupported;
155 XrVersion maxApiVersionSupported;
156} XrGraphicsRequirementsOpenGLKHR;
157
158typedef XrResult (XRAPI_PTR *PFN_xrGetOpenGLGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLKHR* graphicsRequirements);
159
160#ifndef XR_NO_PROTOTYPES
161#ifdef XR_EXTENSION_PROTOTYPES
162XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLGraphicsRequirementsKHR(
163 XrInstance instance,
164 XrSystemId systemId,
165 XrGraphicsRequirementsOpenGLKHR* graphicsRequirements);
166#endif /* XR_EXTENSION_PROTOTYPES */
167#endif /* !XR_NO_PROTOTYPES */
168#endif /* XR_USE_GRAPHICS_API_OPENGL */
169
170#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
171
172#define XR_KHR_opengl_es_enable 1
173#define XR_KHR_opengl_es_enable_SPEC_VERSION 8
174#define XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME "XR_KHR_opengl_es_enable"
175#ifdef XR_USE_PLATFORM_ANDROID
176// XrGraphicsBindingOpenGLESAndroidKHR extends XrSessionCreateInfo
177typedef struct XrGraphicsBindingOpenGLESAndroidKHR {
178 XrStructureType type;
179 const void* XR_MAY_ALIAS next;
180 EGLDisplay display;
181 EGLConfig config;
182 EGLContext context;
183} XrGraphicsBindingOpenGLESAndroidKHR;
184#endif // XR_USE_PLATFORM_ANDROID
185
186typedef struct XrSwapchainImageOpenGLESKHR {
187 XrStructureType type;
188 void* XR_MAY_ALIAS next;
189 uint32_t image;
190} XrSwapchainImageOpenGLESKHR;
191
192typedef struct XrGraphicsRequirementsOpenGLESKHR {
193 XrStructureType type;
194 void* XR_MAY_ALIAS next;
195 XrVersion minApiVersionSupported;
196 XrVersion maxApiVersionSupported;
197} XrGraphicsRequirementsOpenGLESKHR;
198
199typedef XrResult (XRAPI_PTR *PFN_xrGetOpenGLESGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLESKHR* graphicsRequirements);
200
201#ifndef XR_NO_PROTOTYPES
202#ifdef XR_EXTENSION_PROTOTYPES
203XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLESGraphicsRequirementsKHR(
204 XrInstance instance,
205 XrSystemId systemId,
206 XrGraphicsRequirementsOpenGLESKHR* graphicsRequirements);
207#endif /* XR_EXTENSION_PROTOTYPES */
208#endif /* !XR_NO_PROTOTYPES */
209#endif /* XR_USE_GRAPHICS_API_OPENGL_ES */
210
211#ifdef XR_USE_GRAPHICS_API_VULKAN
212
213#define XR_KHR_vulkan_enable 1
214#define XR_KHR_vulkan_enable_SPEC_VERSION 8
215#define XR_KHR_VULKAN_ENABLE_EXTENSION_NAME "XR_KHR_vulkan_enable"
216// XrGraphicsBindingVulkanKHR extends XrSessionCreateInfo
217typedef struct XrGraphicsBindingVulkanKHR {
218 XrStructureType type;
219 const void* XR_MAY_ALIAS next;
220 VkInstance instance;
221 VkPhysicalDevice physicalDevice;
222 VkDevice device;
223 uint32_t queueFamilyIndex;
224 uint32_t queueIndex;
225} XrGraphicsBindingVulkanKHR;
226
227typedef struct XrSwapchainImageVulkanKHR {
228 XrStructureType type;
229 void* XR_MAY_ALIAS next;
230 VkImage image;
231} XrSwapchainImageVulkanKHR;
232
233typedef struct XrGraphicsRequirementsVulkanKHR {
234 XrStructureType type;
235 void* XR_MAY_ALIAS next;
236 XrVersion minApiVersionSupported;
237 XrVersion maxApiVersionSupported;
238} XrGraphicsRequirementsVulkanKHR;
239
240typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanInstanceExtensionsKHR)(XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer);
241typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanDeviceExtensionsKHR)(XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer);
242typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDeviceKHR)(XrInstance instance, XrSystemId systemId, VkInstance vkInstance, VkPhysicalDevice* vkPhysicalDevice);
243typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
244
245#ifndef XR_NO_PROTOTYPES
246#ifdef XR_EXTENSION_PROTOTYPES
247XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanInstanceExtensionsKHR(
248 XrInstance instance,
249 XrSystemId systemId,
250 uint32_t bufferCapacityInput,
251 uint32_t* bufferCountOutput,
252 char* buffer);
253
254XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanDeviceExtensionsKHR(
255 XrInstance instance,
256 XrSystemId systemId,
257 uint32_t bufferCapacityInput,
258 uint32_t* bufferCountOutput,
259 char* buffer);
260
261XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsDeviceKHR(
262 XrInstance instance,
263 XrSystemId systemId,
264 VkInstance vkInstance,
265 VkPhysicalDevice* vkPhysicalDevice);
266
267XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirementsKHR(
268 XrInstance instance,
269 XrSystemId systemId,
270 XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
271#endif /* XR_EXTENSION_PROTOTYPES */
272#endif /* !XR_NO_PROTOTYPES */
273#endif /* XR_USE_GRAPHICS_API_VULKAN */
274
275#ifdef XR_USE_GRAPHICS_API_D3D11
276
277#define XR_KHR_D3D11_enable 1
278#define XR_KHR_D3D11_enable_SPEC_VERSION 9
279#define XR_KHR_D3D11_ENABLE_EXTENSION_NAME "XR_KHR_D3D11_enable"
280// XrGraphicsBindingD3D11KHR extends XrSessionCreateInfo
281typedef struct XrGraphicsBindingD3D11KHR {
282 XrStructureType type;
283 const void* XR_MAY_ALIAS next;
284 ID3D11Device* device;
285} XrGraphicsBindingD3D11KHR;
286
287typedef struct XrSwapchainImageD3D11KHR {
288 XrStructureType type;
289 void* XR_MAY_ALIAS next;
290 ID3D11Texture2D* texture;
291} XrSwapchainImageD3D11KHR;
292
293typedef struct XrGraphicsRequirementsD3D11KHR {
294 XrStructureType type;
295 void* XR_MAY_ALIAS next;
296 LUID adapterLuid;
297 D3D_FEATURE_LEVEL minFeatureLevel;
298} XrGraphicsRequirementsD3D11KHR;
299
300typedef XrResult (XRAPI_PTR *PFN_xrGetD3D11GraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D11KHR* graphicsRequirements);
301
302#ifndef XR_NO_PROTOTYPES
303#ifdef XR_EXTENSION_PROTOTYPES
304XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D11GraphicsRequirementsKHR(
305 XrInstance instance,
306 XrSystemId systemId,
307 XrGraphicsRequirementsD3D11KHR* graphicsRequirements);
308#endif /* XR_EXTENSION_PROTOTYPES */
309#endif /* !XR_NO_PROTOTYPES */
310#endif /* XR_USE_GRAPHICS_API_D3D11 */
311
312#ifdef XR_USE_GRAPHICS_API_D3D12
313
314#define XR_KHR_D3D12_enable 1
315#define XR_KHR_D3D12_enable_SPEC_VERSION 9
316#define XR_KHR_D3D12_ENABLE_EXTENSION_NAME "XR_KHR_D3D12_enable"
317// XrGraphicsBindingD3D12KHR extends XrSessionCreateInfo
318typedef struct XrGraphicsBindingD3D12KHR {
319 XrStructureType type;
320 const void* XR_MAY_ALIAS next;
321 ID3D12Device* device;
322 ID3D12CommandQueue* queue;
323} XrGraphicsBindingD3D12KHR;
324
325typedef struct XrSwapchainImageD3D12KHR {
326 XrStructureType type;
327 void* XR_MAY_ALIAS next;
328 ID3D12Resource* texture;
329} XrSwapchainImageD3D12KHR;
330
331typedef struct XrGraphicsRequirementsD3D12KHR {
332 XrStructureType type;
333 void* XR_MAY_ALIAS next;
334 LUID adapterLuid;
335 D3D_FEATURE_LEVEL minFeatureLevel;
336} XrGraphicsRequirementsD3D12KHR;
337
338typedef XrResult (XRAPI_PTR *PFN_xrGetD3D12GraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D12KHR* graphicsRequirements);
339
340#ifndef XR_NO_PROTOTYPES
341#ifdef XR_EXTENSION_PROTOTYPES
342XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D12GraphicsRequirementsKHR(
343 XrInstance instance,
344 XrSystemId systemId,
345 XrGraphicsRequirementsD3D12KHR* graphicsRequirements);
346#endif /* XR_EXTENSION_PROTOTYPES */
347#endif /* !XR_NO_PROTOTYPES */
348#endif /* XR_USE_GRAPHICS_API_D3D12 */
349
350#ifdef XR_USE_PLATFORM_WIN32
351
352#define XR_KHR_win32_convert_performance_counter_time 1
353#define XR_KHR_win32_convert_performance_counter_time_SPEC_VERSION 1
354#define XR_KHR_WIN32_CONVERT_PERFORMANCE_COUNTER_TIME_EXTENSION_NAME "XR_KHR_win32_convert_performance_counter_time"
355typedef XrResult (XRAPI_PTR *PFN_xrConvertWin32PerformanceCounterToTimeKHR)(XrInstance instance, const LARGE_INTEGER* performanceCounter, XrTime* time);
356typedef XrResult (XRAPI_PTR *PFN_xrConvertTimeToWin32PerformanceCounterKHR)(XrInstance instance, XrTime time, LARGE_INTEGER* performanceCounter);
357
358#ifndef XR_NO_PROTOTYPES
359#ifdef XR_EXTENSION_PROTOTYPES
360XRAPI_ATTR XrResult XRAPI_CALL xrConvertWin32PerformanceCounterToTimeKHR(
361 XrInstance instance,
362 const LARGE_INTEGER* performanceCounter,
363 XrTime* time);
364
365XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToWin32PerformanceCounterKHR(
366 XrInstance instance,
367 XrTime time,
368 LARGE_INTEGER* performanceCounter);
369#endif /* XR_EXTENSION_PROTOTYPES */
370#endif /* !XR_NO_PROTOTYPES */
371#endif /* XR_USE_PLATFORM_WIN32 */
372
373#ifdef XR_USE_TIMESPEC
374
375#define XR_KHR_convert_timespec_time 1
376#define XR_KHR_convert_timespec_time_SPEC_VERSION 1
377#define XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME "XR_KHR_convert_timespec_time"
378typedef XrResult (XRAPI_PTR *PFN_xrConvertTimespecTimeToTimeKHR)(XrInstance instance, const struct timespec* timespecTime, XrTime* time);
379typedef XrResult (XRAPI_PTR *PFN_xrConvertTimeToTimespecTimeKHR)(XrInstance instance, XrTime time, struct timespec* timespecTime);
380
381#ifndef XR_NO_PROTOTYPES
382#ifdef XR_EXTENSION_PROTOTYPES
383XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimespecTimeToTimeKHR(
384 XrInstance instance,
385 const struct timespec* timespecTime,
386 XrTime* time);
387
388XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToTimespecTimeKHR(
389 XrInstance instance,
390 XrTime time,
391 struct timespec* timespecTime);
392#endif /* XR_EXTENSION_PROTOTYPES */
393#endif /* !XR_NO_PROTOTYPES */
394#endif /* XR_USE_TIMESPEC */
395
396#ifdef XR_USE_PLATFORM_ANDROID
397
398#define XR_KHR_loader_init_android 1
399#define XR_KHR_loader_init_android_SPEC_VERSION 1
400#define XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME "XR_KHR_loader_init_android"
401typedef struct XrLoaderInitInfoAndroidKHR {
402 XrStructureType type;
403 const void* XR_MAY_ALIAS next;
404 void* XR_MAY_ALIAS applicationVM;
405 void* XR_MAY_ALIAS applicationContext;
406} XrLoaderInitInfoAndroidKHR;
407
408#endif /* XR_USE_PLATFORM_ANDROID */
409
410#ifdef XR_USE_GRAPHICS_API_VULKAN
411
412#define XR_KHR_vulkan_enable2 1
413#define XR_KHR_vulkan_enable2_SPEC_VERSION 2
414#define XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME "XR_KHR_vulkan_enable2"
415typedef XrFlags64 XrVulkanInstanceCreateFlagsKHR;
416
417// Flag bits for XrVulkanInstanceCreateFlagsKHR
418
419typedef XrFlags64 XrVulkanDeviceCreateFlagsKHR;
420
421// Flag bits for XrVulkanDeviceCreateFlagsKHR
422
423typedef struct XrVulkanInstanceCreateInfoKHR {
424 XrStructureType type;
425 const void* XR_MAY_ALIAS next;
426 XrSystemId systemId;
427 XrVulkanInstanceCreateFlagsKHR createFlags;
428 PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr;
429 const VkInstanceCreateInfo* vulkanCreateInfo;
430 const VkAllocationCallbacks* vulkanAllocator;
431} XrVulkanInstanceCreateInfoKHR;
432
433typedef struct XrVulkanDeviceCreateInfoKHR {
434 XrStructureType type;
435 const void* XR_MAY_ALIAS next;
436 XrSystemId systemId;
437 XrVulkanDeviceCreateFlagsKHR createFlags;
438 PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr;
439 VkPhysicalDevice vulkanPhysicalDevice;
440 const VkDeviceCreateInfo* vulkanCreateInfo;
441 const VkAllocationCallbacks* vulkanAllocator;
442} XrVulkanDeviceCreateInfoKHR;
443
444typedef XrGraphicsBindingVulkanKHR XrGraphicsBindingVulkan2KHR;
445
446typedef struct XrVulkanGraphicsDeviceGetInfoKHR {
447 XrStructureType type;
448 const void* XR_MAY_ALIAS next;
449 XrSystemId systemId;
450 VkInstance vulkanInstance;
451} XrVulkanGraphicsDeviceGetInfoKHR;
452
453typedef XrSwapchainImageVulkanKHR XrSwapchainImageVulkan2KHR;
454
455typedef XrGraphicsRequirementsVulkanKHR XrGraphicsRequirementsVulkan2KHR;
456
457typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanInstanceKHR)(XrInstance instance, const XrVulkanInstanceCreateInfoKHR* createInfo, VkInstance* vulkanInstance, VkResult* vulkanResult);
458typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanDeviceKHR)(XrInstance instance, const XrVulkanDeviceCreateInfoKHR* createInfo, VkDevice* vulkanDevice, VkResult* vulkanResult);
459typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDevice2KHR)(XrInstance instance, const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, VkPhysicalDevice* vulkanPhysicalDevice);
460typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirements2KHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
461
462#ifndef XR_NO_PROTOTYPES
463#ifdef XR_EXTENSION_PROTOTYPES
464XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanInstanceKHR(
465 XrInstance instance,
466 const XrVulkanInstanceCreateInfoKHR* createInfo,
467 VkInstance* vulkanInstance,
468 VkResult* vulkanResult);
469
470XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanDeviceKHR(
471 XrInstance instance,
472 const XrVulkanDeviceCreateInfoKHR* createInfo,
473 VkDevice* vulkanDevice,
474 VkResult* vulkanResult);
475
476XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsDevice2KHR(
477 XrInstance instance,
478 const XrVulkanGraphicsDeviceGetInfoKHR* getInfo,
479 VkPhysicalDevice* vulkanPhysicalDevice);
480
481XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirements2KHR(
482 XrInstance instance,
483 XrSystemId systemId,
484 XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
485#endif /* XR_EXTENSION_PROTOTYPES */
486#endif /* !XR_NO_PROTOTYPES */
487#endif /* XR_USE_GRAPHICS_API_VULKAN */
488
489#ifdef XR_USE_PLATFORM_EGL
490
491#define XR_MNDX_egl_enable 1
492#define XR_MNDX_egl_enable_SPEC_VERSION 1
493#define XR_MNDX_EGL_ENABLE_EXTENSION_NAME "XR_MNDX_egl_enable"
494// XrGraphicsBindingEGLMNDX extends XrSessionCreateInfo
495typedef struct XrGraphicsBindingEGLMNDX {
496 XrStructureType type;
497 const void* XR_MAY_ALIAS next;
498 PFNEGLGETPROCADDRESSPROC getProcAddress;
499 EGLDisplay display;
500 EGLConfig config;
501 EGLContext context;
502} XrGraphicsBindingEGLMNDX;
503
504#endif /* XR_USE_PLATFORM_EGL */
505
506#ifdef XR_USE_PLATFORM_WIN32
507
508#define XR_MSFT_perception_anchor_interop 1
509#define XR_MSFT_perception_anchor_interop_SPEC_VERSION 1
510#define XR_MSFT_PERCEPTION_ANCHOR_INTEROP_EXTENSION_NAME "XR_MSFT_perception_anchor_interop"
511typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorFromPerceptionAnchorMSFT)(XrSession session, IUnknown* perceptionAnchor, XrSpatialAnchorMSFT* anchor);
512typedef XrResult (XRAPI_PTR *PFN_xrTryGetPerceptionAnchorFromSpatialAnchorMSFT)(XrSession session, XrSpatialAnchorMSFT anchor, IUnknown** perceptionAnchor);
513
514#ifndef XR_NO_PROTOTYPES
515#ifdef XR_EXTENSION_PROTOTYPES
516XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorFromPerceptionAnchorMSFT(
517 XrSession session,
518 IUnknown* perceptionAnchor,
519 XrSpatialAnchorMSFT* anchor);
520
521XRAPI_ATTR XrResult XRAPI_CALL xrTryGetPerceptionAnchorFromSpatialAnchorMSFT(
522 XrSession session,
523 XrSpatialAnchorMSFT anchor,
524 IUnknown** perceptionAnchor);
525#endif /* XR_EXTENSION_PROTOTYPES */
526#endif /* !XR_NO_PROTOTYPES */
527#endif /* XR_USE_PLATFORM_WIN32 */
528
529#ifdef XR_USE_PLATFORM_WIN32
530
531#define XR_MSFT_holographic_window_attachment 1
532#define XR_MSFT_holographic_window_attachment_SPEC_VERSION 1
533#define XR_MSFT_HOLOGRAPHIC_WINDOW_ATTACHMENT_EXTENSION_NAME "XR_MSFT_holographic_window_attachment"
534#ifdef XR_USE_PLATFORM_WIN32
535// XrHolographicWindowAttachmentMSFT extends XrSessionCreateInfo
536typedef struct XrHolographicWindowAttachmentMSFT {
537 XrStructureType type;
538 const void* XR_MAY_ALIAS next;
539 IUnknown* holographicSpace;
540 IUnknown* coreWindow;
541} XrHolographicWindowAttachmentMSFT;
542#endif // XR_USE_PLATFORM_WIN32
543
544#endif /* XR_USE_PLATFORM_WIN32 */
545
546#ifdef XR_USE_PLATFORM_ANDROID
547
548#define XR_FB_android_surface_swapchain_create 1
549#define XR_FB_android_surface_swapchain_create_SPEC_VERSION 1
550#define XR_FB_ANDROID_SURFACE_SWAPCHAIN_CREATE_EXTENSION_NAME "XR_FB_android_surface_swapchain_create"
551typedef XrFlags64 XrAndroidSurfaceSwapchainFlagsFB;
552
553// Flag bits for XrAndroidSurfaceSwapchainFlagsFB
554static const XrAndroidSurfaceSwapchainFlagsFB XR_ANDROID_SURFACE_SWAPCHAIN_SYNCHRONOUS_BIT_FB = 0x00000001;
555static const XrAndroidSurfaceSwapchainFlagsFB XR_ANDROID_SURFACE_SWAPCHAIN_USE_TIMESTAMPS_BIT_FB = 0x00000002;
556
557#ifdef XR_USE_PLATFORM_ANDROID
558// XrAndroidSurfaceSwapchainCreateInfoFB extends XrSwapchainCreateInfo
559typedef struct XrAndroidSurfaceSwapchainCreateInfoFB {
560 XrStructureType type;
561 const void* XR_MAY_ALIAS next;
562 XrAndroidSurfaceSwapchainFlagsFB createFlags;
563} XrAndroidSurfaceSwapchainCreateInfoFB;
564#endif // XR_USE_PLATFORM_ANDROID
565
566#endif /* XR_USE_PLATFORM_ANDROID */
567
568#ifdef XR_USE_PLATFORM_ML
569
570#define XR_ML_compat 1
571#define XR_ML_compat_SPEC_VERSION 1
572#define XR_ML_COMPAT_EXTENSION_NAME "XR_ML_compat"
573typedef struct XrCoordinateSpaceCreateInfoML {
574 XrStructureType type;
575 const void* XR_MAY_ALIAS next;
576 MLCoordinateFrameUID cfuid;
577 XrPosef poseInCoordinateSpace;
578} XrCoordinateSpaceCreateInfoML;
579
580typedef XrResult (XRAPI_PTR *PFN_xrCreateSpaceFromCoordinateFrameUIDML)(XrSession session, const XrCoordinateSpaceCreateInfoML *createInfo, XrSpace* space);
581
582#ifndef XR_NO_PROTOTYPES
583#ifdef XR_EXTENSION_PROTOTYPES
584XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpaceFromCoordinateFrameUIDML(
585 XrSession session,
586 const XrCoordinateSpaceCreateInfoML * createInfo,
587 XrSpace* space);
588#endif /* XR_EXTENSION_PROTOTYPES */
589#endif /* !XR_NO_PROTOTYPES */
590#endif /* XR_USE_PLATFORM_ML */
591
592#ifdef XR_USE_PLATFORM_WIN32
593
594#define XR_OCULUS_audio_device_guid 1
595#define XR_OCULUS_audio_device_guid_SPEC_VERSION 1
596#define XR_OCULUS_AUDIO_DEVICE_GUID_EXTENSION_NAME "XR_OCULUS_audio_device_guid"
597#define XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS 128
598typedef XrResult (XRAPI_PTR *PFN_xrGetAudioOutputDeviceGuidOculus)(XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
599typedef XrResult (XRAPI_PTR *PFN_xrGetAudioInputDeviceGuidOculus)(XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
600
601#ifndef XR_NO_PROTOTYPES
602#ifdef XR_EXTENSION_PROTOTYPES
603XRAPI_ATTR XrResult XRAPI_CALL xrGetAudioOutputDeviceGuidOculus(
604 XrInstance instance,
605 wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
606
607XRAPI_ATTR XrResult XRAPI_CALL xrGetAudioInputDeviceGuidOculus(
608 XrInstance instance,
609 wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
610#endif /* XR_EXTENSION_PROTOTYPES */
611#endif /* !XR_NO_PROTOTYPES */
612#endif /* XR_USE_PLATFORM_WIN32 */
613
614#ifdef XR_USE_GRAPHICS_API_VULKAN
615
616#define XR_FB_foveation_vulkan 1
617#define XR_FB_foveation_vulkan_SPEC_VERSION 1
618#define XR_FB_FOVEATION_VULKAN_EXTENSION_NAME "XR_FB_foveation_vulkan"
619// XrSwapchainImageFoveationVulkanFB extends XrSwapchainImageVulkanKHR
620typedef struct XrSwapchainImageFoveationVulkanFB {
621 XrStructureType type;
622 void* XR_MAY_ALIAS next;
623 VkImage image;
624 uint32_t width;
625 uint32_t height;
626} XrSwapchainImageFoveationVulkanFB;
627
628#endif /* XR_USE_GRAPHICS_API_VULKAN */
629
630#ifdef XR_USE_PLATFORM_ANDROID
631
632#define XR_FB_swapchain_update_state_android_surface 1
633#define XR_FB_swapchain_update_state_android_surface_SPEC_VERSION 1
634#define XR_FB_SWAPCHAIN_UPDATE_STATE_ANDROID_SURFACE_EXTENSION_NAME "XR_FB_swapchain_update_state_android_surface"
635#ifdef XR_USE_PLATFORM_ANDROID
636typedef struct XrSwapchainStateAndroidSurfaceDimensionsFB {
637 XrStructureType type;
638 void* XR_MAY_ALIAS next;
639 uint32_t width;
640 uint32_t height;
641} XrSwapchainStateAndroidSurfaceDimensionsFB;
642#endif // XR_USE_PLATFORM_ANDROID
643
644#endif /* XR_USE_PLATFORM_ANDROID */
645
646#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
647
648#define XR_FB_swapchain_update_state_opengl_es 1
649#define XR_FB_swapchain_update_state_opengl_es_SPEC_VERSION 1
650#define XR_FB_SWAPCHAIN_UPDATE_STATE_OPENGL_ES_EXTENSION_NAME "XR_FB_swapchain_update_state_opengl_es"
651#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
652typedef struct XrSwapchainStateSamplerOpenGLESFB {
653 XrStructureType type;
654 void* XR_MAY_ALIAS next;
655 EGLenum minFilter;
656 EGLenum magFilter;
657 EGLenum wrapModeS;
658 EGLenum wrapModeT;
659 EGLenum swizzleRed;
660 EGLenum swizzleGreen;
661 EGLenum swizzleBlue;
662 EGLenum swizzleAlpha;
663 float maxAnisotropy;
664 XrColor4f borderColor;
665} XrSwapchainStateSamplerOpenGLESFB;
666#endif // XR_USE_GRAPHICS_API_OPENGL_ES
667
668#endif /* XR_USE_GRAPHICS_API_OPENGL_ES */
669
670#ifdef XR_USE_GRAPHICS_API_VULKAN
671
672#define XR_FB_swapchain_update_state_vulkan 1
673#define XR_FB_swapchain_update_state_vulkan_SPEC_VERSION 1
674#define XR_FB_SWAPCHAIN_UPDATE_STATE_VULKAN_EXTENSION_NAME "XR_FB_swapchain_update_state_vulkan"
675#ifdef XR_USE_GRAPHICS_API_VULKAN
676typedef struct XrSwapchainStateSamplerVulkanFB {
677 XrStructureType type;
678 void* XR_MAY_ALIAS next;
679 VkFilter minFilter;
680 VkFilter magFilter;
681 VkSamplerMipmapMode mipmapMode;
682 VkSamplerAddressMode wrapModeS;
683 VkSamplerAddressMode wrapModeT;
684 VkComponentSwizzle swizzleRed;
685 VkComponentSwizzle swizzleGreen;
686 VkComponentSwizzle swizzleBlue;
687 VkComponentSwizzle swizzleAlpha;
688 float maxAnisotropy;
689 XrColor4f borderColor;
690} XrSwapchainStateSamplerVulkanFB;
691#endif // XR_USE_GRAPHICS_API_VULKAN
692
693#endif /* XR_USE_GRAPHICS_API_VULKAN */
694
695#ifdef XR_USE_GRAPHICS_API_VULKAN
696
697#define XR_META_vulkan_swapchain_create_info 1
698#define XR_META_vulkan_swapchain_create_info_SPEC_VERSION 1
699#define XR_META_VULKAN_SWAPCHAIN_CREATE_INFO_EXTENSION_NAME "XR_META_vulkan_swapchain_create_info"
700// XrVulkanSwapchainCreateInfoMETA extends XrSwapchainCreateInfo
701typedef struct XrVulkanSwapchainCreateInfoMETA {
702 XrStructureType type;
703 const void* XR_MAY_ALIAS next;
704 VkImageCreateFlags additionalCreateFlags;
705 VkImageUsageFlags additionalUsageFlags;
706} XrVulkanSwapchainCreateInfoMETA;
707
708#endif /* XR_USE_GRAPHICS_API_VULKAN */
709
710#ifdef __cplusplus
711}
712#endif
713
714#endif
715