Class KHRVulkanEnable
This extension enables the use of the Vulkan graphics API in an OpenXR runtime. Without this extension, the OpenXR runtime may not be able to use any Vulkan swapchain images.
This extension provides the mechanisms necessary for an application to generate a valid XrGraphicsBindingVulkanKHR structure in order to create a Vulkan-based XrSession. Note that during this process the application is responsible for creating all the required Vulkan objects.
This extension also provides mechanisms for the application to interact with images acquired by calling EnumerateSwapchainImages.
In order to expose the structures, types, and functions of this extension, you must define USE_GRAPHICS_API_VULKAN before including the OpenXR platform header openxr_platform.h, in all portions of your library or application that include it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrGetVulkanDeviceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetVulkanDeviceExtensionsKHRstatic intnxrGetVulkanGraphicsDeviceKHR(org.lwjgl.openxr.XrInstance instance, long systemId, org.lwjgl.vulkan.VkInstance vkInstance, long vkPhysicalDevice) Unsafe version of:GetVulkanGraphicsDeviceKHRstatic intnxrGetVulkanGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, long graphicsRequirements) Unsafe version of:GetVulkanGraphicsRequirementsKHRstatic intnxrGetVulkanInstanceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetVulkanInstanceExtensionsKHRstatic intxrGetVulkanDeviceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get list of required Vulkan device extensions for an OpenXR instance and system.static intxrGetVulkanGraphicsDeviceKHR(org.lwjgl.openxr.XrInstance instance, long systemId, org.lwjgl.vulkan.VkInstance vkInstance, org.lwjgl.PointerBuffer vkPhysicalDevice) Retrieve the Vulkan physical device associated with an OpenXR instance and system.static intxrGetVulkanGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, XrGraphicsRequirementsVulkanKHR graphicsRequirements) Retrieve the Vulkan version requirements for an instance and system.static intxrGetVulkanInstanceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get list of required Vulkan instance extensions for an OpenXR instance and system.
-
Field Details
-
XR_KHR_vulkan_enable_SPEC_VERSION
public static final int XR_KHR_vulkan_enable_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_KHR_VULKAN_ENABLE_EXTENSION_NAME
The extension name.- See Also:
-
XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR
public static final int XR_TYPE_GRAPHICS_BINDING_VULKAN_KHRExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR
public static final int XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHRExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR
public static final int XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHRExtendsXrStructureType.Enum values:
- See Also:
-
-
Method Details
-
nxrGetVulkanInstanceExtensionsKHR
public static int nxrGetVulkanInstanceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetVulkanInstanceExtensionsKHR- Parameters:
bufferCapacityInput- the capacity of thebuffer, or 0 to indicate a request to retrieve the required capacity.
-
xrGetVulkanInstanceExtensionsKHR
public static int xrGetVulkanInstanceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get list of required Vulkan instance extensions for an OpenXR instance and system.C Specification
XrResult xrGetVulkanInstanceExtensionsKHR( XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer);Valid Usage (Implicit)
- The
XR_KHR_vulkan_enableextension must be enabled prior to callingGetVulkanInstanceExtensionsKHR instancemust be a validXrInstancehandlebufferCountOutputmust be a pointer to auint32_tvalue- If
bufferCapacityInputis not 0,buffermust be a pointer to an array ofbufferCapacityInputchar values
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
instance- anXrInstancehandle previously created withCreateInstance.systemId- anXrSystemIdhandle for the system which will be used to create a session.bufferCountOutput- a pointer to the count of characters written (including terminating\0), or a pointer to the required capacity in the case thatbufferCapacityInputis insufficient.buffer- a pointer to an array of characters, but can beNULLifbufferCapacityInputis 0. The format of the output is a single space (ASCII0x20) delimited string of extension names.
- The
-
nxrGetVulkanDeviceExtensionsKHR
public static int nxrGetVulkanDeviceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetVulkanDeviceExtensionsKHR- Parameters:
bufferCapacityInput- the capacity of thebuffer, or 0 to indicate a request to retrieve the required capacity.
-
xrGetVulkanDeviceExtensionsKHR
public static int xrGetVulkanDeviceExtensionsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get list of required Vulkan device extensions for an OpenXR instance and system.C Specification
XrResult xrGetVulkanDeviceExtensionsKHR( XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer);Valid Usage (Implicit)
- The
XR_KHR_vulkan_enableextension must be enabled prior to callingGetVulkanDeviceExtensionsKHR instancemust be a validXrInstancehandlebufferCountOutputmust be a pointer to auint32_tvalue- If
bufferCapacityInputis not 0,buffermust be a pointer to an array ofbufferCapacityInputchar values
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
instance- anXrInstancehandle previously created withCreateInstance.systemId- anXrSystemIdhandle for the system which will be used to create a session.bufferCountOutput- a pointer to the count of characters written (including terminating\0), or a pointer to the required capacity in the case thatbufferCapacityInputis insufficient.buffer- a pointer to an array of characters, but can beNULLifbufferCapacityInputis 0. The format of the output is a single space (ASCII0x20) delimited string of extension names.
- The
-
nxrGetVulkanGraphicsDeviceKHR
public static int nxrGetVulkanGraphicsDeviceKHR(org.lwjgl.openxr.XrInstance instance, long systemId, org.lwjgl.vulkan.VkInstance vkInstance, long vkPhysicalDevice) Unsafe version of:GetVulkanGraphicsDeviceKHR -
xrGetVulkanGraphicsDeviceKHR
public static int xrGetVulkanGraphicsDeviceKHR(org.lwjgl.openxr.XrInstance instance, long systemId, org.lwjgl.vulkan.VkInstance vkInstance, org.lwjgl.PointerBuffer vkPhysicalDevice) Retrieve the Vulkan physical device associated with an OpenXR instance and system.C Specification
To identify what graphics device needs to be used for an instance and system, call:
XrResult xrGetVulkanGraphicsDeviceKHR( XrInstance instance, XrSystemId systemId, VkInstance vkInstance, VkPhysicalDevice* vkPhysicalDevice);Description
GetVulkanGraphicsDeviceKHRfunction identifies to the application what graphics device (VulkanVkPhysicalDevice) needs to be used.GetVulkanGraphicsDeviceKHRmust be called prior to callingCreateSession, and theVkPhysicalDevicethatGetVulkanGraphicsDeviceKHRreturns should be passed toCreateSessionin theXrGraphicsBindingVulkanKHR.Valid Usage (Implicit)
- The
XR_KHR_vulkan_enableextension must be enabled prior to callingGetVulkanGraphicsDeviceKHR instancemust be a validXrInstancehandlevkInstancemust be a validVkInstancevaluevkPhysicalDevicemust be a pointer to aVkPhysicalDevicevalue
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
instance- anXrInstancehandle previously created withCreateInstance.systemId- anXrSystemIdhandle for the system which will be used to create a session.vkInstance- a valid VulkanVkInstance.vkPhysicalDevice- a pointer to aVkPhysicalDevicevalue to populate.
- The
-
nxrGetVulkanGraphicsRequirementsKHR
public static int nxrGetVulkanGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, long graphicsRequirements) Unsafe version of:GetVulkanGraphicsRequirementsKHR -
xrGetVulkanGraphicsRequirementsKHR
public static int xrGetVulkanGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, XrGraphicsRequirementsVulkanKHR graphicsRequirements) Retrieve the Vulkan version requirements for an instance and system.C Specification
To query Vulkan API version requirements, call:
XrResult xrGetVulkanGraphicsRequirementsKHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements);Description
The
GetVulkanGraphicsRequirementsKHRfunction identifies to the application the minimum Vulkan version requirement and the highest known tested Vulkan version. The runtime must returnERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING(ERROR_VALIDATION_FAILUREmay be returned due to legacy behavior) on calls toCreateSessionifGetVulkanGraphicsRequirementsKHRhas not been called for the sameinstanceandsystemId.Valid Usage (Implicit)
- The
XR_KHR_vulkan_enableextension must be enabled prior to callingGetVulkanGraphicsRequirementsKHR instancemust be a validXrInstancehandlegraphicsRequirementsmust be a pointer to anXrGraphicsRequirementsVulkanKHRstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
instance- anXrInstancehandle previously created withCreateInstance.systemId- anXrSystemIdhandle for the system which will be used to create a session.graphicsRequirements- theXrGraphicsRequirementsVulkanKHRoutput structure.
- The
-