Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class KHRVulkanEnable

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*, org.lwjgl.vulkan.*

The XR_KHR_vulkan_enable extension.

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

Modifier and TypeField and Description
public static final String
public static final int
XR_KHR_vulkan_enable_SPEC_VERSION

The extension specification version.

public static final int
XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR

Extends XrStructureType.

public static final int
public static final int
XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR

Extends XrStructureType.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nxrGetVulkanDeviceExtensionsKHR(XrInstance instance, long systemId, int
the capacity of the buffer, or 0 to indicate a request to retrieve the required capacity.
bufferCapacityInput
,
long bufferCountOutput, long buffer)

Unsafe version of: GetVulkanDeviceExtensionsKHR

public static int
nxrGetVulkanGraphicsDeviceKHR(XrInstance instance, long systemId, VkInstance vkInstance, long vkPhysicalDevice)

Unsafe version of: GetVulkanGraphicsDeviceKHR

public static int
nxrGetVulkanGraphicsRequirementsKHR(XrInstance instance, long systemId, long graphicsRequirements)

Unsafe version of: GetVulkanGraphicsRequirementsKHR

public static int
nxrGetVulkanInstanceExtensionsKHR(XrInstance instance, long systemId, int
the capacity of the buffer, or 0 to indicate a request to retrieve the required capacity.
bufferCapacityInput
,
long bufferCountOutput, long buffer)

Unsafe version of: GetVulkanInstanceExtensionsKHR

public static int
xrGetVulkanDeviceExtensionsKHR(XrInstance
an XrInstance handle previously created with CreateInstance.
instance
,
long
an XrSystemId handle for the system which will be used to create a session.
systemId
,
IntBuffer
a pointer to the count of characters written (including terminating \0), or a pointer to the required capacity in the case that bufferCapacityInput is insufficient.
bufferCountOutput
,
ByteBuffer
a pointer to an array of characters, but can be NULL if bufferCapacityInput is 0. The format of the output is a single space (ASCII 0x20) delimited string of extension names.
buffer
)

Get list of required Vulkan device extensions for an OpenXR instance and system.

public static int
xrGetVulkanGraphicsDeviceKHR(XrInstance
an XrInstance handle previously created with CreateInstance.
instance
,
long
an XrSystemId handle for the system which will be used to create a session.
systemId
,
VkInstance
a valid Vulkan VkInstance.
vkInstance
,
PointerBuffer
a pointer to a VkPhysicalDevice value to populate.
vkPhysicalDevice
)

Retrieve the Vulkan physical device associated with an OpenXR instance and system.

public static int
xrGetVulkanGraphicsRequirementsKHR(XrInstance
an XrInstance handle previously created with CreateInstance.
instance
,
long
an XrSystemId handle for the system which will be used to create a session.
systemId
,
XrGraphicsRequirementsVulkanKHR
the XrGraphicsRequirementsVulkanKHR output structure.
graphicsRequirements
)

Retrieve the Vulkan version requirements for an instance and system.

public static int
xrGetVulkanInstanceExtensionsKHR(XrInstance
an XrInstance handle previously created with CreateInstance.
instance
,
long
an XrSystemId handle for the system which will be used to create a session.
systemId
,
IntBuffer
a pointer to the count of characters written (including terminating \0), or a pointer to the required capacity in the case that bufferCapacityInput is insufficient.
bufferCountOutput
,
ByteBuffer
a pointer to an array of characters, but can be NULL if bufferCapacityInput is 0. The format of the output is a single space (ASCII 0x20) delimited string of extension names.
buffer
)

Get list of required Vulkan instance extensions for an OpenXR instance and system.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_KHR_VULKAN_ENABLE_EXTENSION_NAMEback to summary
public static final String XR_KHR_VULKAN_ENABLE_EXTENSION_NAME

The extension name.

XR_KHR_vulkan_enable_SPEC_VERSIONback to summary
public static final int XR_KHR_vulkan_enable_SPEC_VERSION

The extension specification version.

XR_TYPE_GRAPHICS_BINDING_VULKAN_KHRback to summary
public static final int XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR

Extends XrStructureType.

Enum values:
XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHRback to summary
public static final int XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR

Extends XrStructureType.

Enum values:
XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHRback to summary
public static final int XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR

Extends XrStructureType.

Enum values:

Constructor Detail

KHRVulkanEnableback to summary
protected KHRVulkanEnable()

Method Detail

nxrGetVulkanDeviceExtensionsKHRback to summary
public static int nxrGetVulkanDeviceExtensionsKHR(XrInstance instance, long systemId, int bufferCapacityInput, long bufferCountOutput, long buffer)

Unsafe version of: GetVulkanDeviceExtensionsKHR

Parameters
bufferCapacityInput:int

the capacity of the buffer, or 0 to indicate a request to retrieve the required capacity.

nxrGetVulkanGraphicsDeviceKHRback to summary
public static int nxrGetVulkanGraphicsDeviceKHR(XrInstance instance, long systemId, VkInstance vkInstance, long vkPhysicalDevice)

Unsafe version of: GetVulkanGraphicsDeviceKHR

nxrGetVulkanGraphicsRequirementsKHRback to summary
public static int nxrGetVulkanGraphicsRequirementsKHR(XrInstance instance, long systemId, long graphicsRequirements)

Unsafe version of: GetVulkanGraphicsRequirementsKHR

nxrGetVulkanInstanceExtensionsKHRback to summary
public static int nxrGetVulkanInstanceExtensionsKHR(XrInstance instance, long systemId, int bufferCapacityInput, long bufferCountOutput, long buffer)

Unsafe version of: GetVulkanInstanceExtensionsKHR

Parameters
bufferCapacityInput:int

the capacity of the buffer, or 0 to indicate a request to retrieve the required capacity.

xrGetVulkanDeviceExtensionsKHRback to summary
public static int xrGetVulkanDeviceExtensionsKHR(XrInstance instance, long systemId, IntBuffer bufferCountOutput, 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_enable extension must be enabled prior to calling GetVulkanDeviceExtensionsKHR
  • instance must be a valid XrInstance handle
  • bufferCountOutput must be a pointer to a uint32_t value
  • If bufferCapacityInput is not 0, buffer must be a pointer to an array of bufferCapacityInput char values
Return Codes
On success, this command returns
On failure, this command returns
See Also

GetVulkanInstanceExtensionsKHR

Parameters
instance:XrInstance

an XrInstance handle previously created with CreateInstance.

systemId:long

an XrSystemId handle for the system which will be used to create a session.

bufferCountOutput:IntBuffer

a pointer to the count of characters written (including terminating \0), or a pointer to the required capacity in the case that bufferCapacityInput is insufficient.

buffer:ByteBuffer

a pointer to an array of characters, but can be NULL if bufferCapacityInput is 0. The format of the output is a single space (ASCII 0x20) delimited string of extension names.

Annotations
@NativeType:XrResult
xrGetVulkanGraphicsDeviceKHRback to summary
public static int xrGetVulkanGraphicsDeviceKHR(XrInstance instance, long systemId, VkInstance vkInstance, 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

GetVulkanGraphicsDeviceKHR function identifies to the application what graphics device (Vulkan VkPhysicalDevice) needs to be used. GetVulkanGraphicsDeviceKHR must be called prior to calling CreateSession, and the VkPhysicalDevice that GetVulkanGraphicsDeviceKHR returns should be passed to CreateSession in the XrGraphicsBindingVulkanKHR.

Valid Usage (Implicit)
  • The XR_KHR_vulkan_enable extension must be enabled prior to calling GetVulkanGraphicsDeviceKHR
  • instance must be a valid XrInstance handle
  • vkInstance must be a valid VkInstance value
  • vkPhysicalDevice must be a pointer to a VkPhysicalDevice value
Return Codes
On success, this command returns
On failure, this command returns
Parameters
instance:XrInstance

an XrInstance handle previously created with CreateInstance.

systemId:long

an XrSystemId handle for the system which will be used to create a session.

vkInstance:VkInstance

a valid Vulkan VkInstance.

vkPhysicalDevice:PointerBuffer

a pointer to a VkPhysicalDevice value to populate.

Annotations
@NativeType:XrResult
xrGetVulkanGraphicsRequirementsKHRback to summary
public static int xrGetVulkanGraphicsRequirementsKHR(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 GetVulkanGraphicsRequirementsKHR function identifies to the application the minimum Vulkan version requirement and the highest known tested Vulkan version. The runtime must return ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING (ERROR_VALIDATION_FAILURE may be returned due to legacy behavior) on calls to CreateSession if GetVulkanGraphicsRequirementsKHR has not been called for the same instance and systemId.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrGraphicsRequirementsVulkanKHR

Parameters
instance:XrInstance

an XrInstance handle previously created with CreateInstance.

systemId:long

an XrSystemId handle for the system which will be used to create a session.

graphicsRequirements:XrGraphicsRequirementsVulkanKHR

the XrGraphicsRequirementsVulkanKHR output structure.

Annotations
@NativeType:XrResult
xrGetVulkanInstanceExtensionsKHRback to summary
public static int xrGetVulkanInstanceExtensionsKHR(XrInstance instance, long systemId, IntBuffer bufferCountOutput, 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_enable extension must be enabled prior to calling GetVulkanInstanceExtensionsKHR
  • instance must be a valid XrInstance handle
  • bufferCountOutput must be a pointer to a uint32_t value
  • If bufferCapacityInput is not 0, buffer must be a pointer to an array of bufferCapacityInput char values
Return Codes
On success, this command returns
On failure, this command returns
See Also

GetVulkanDeviceExtensionsKHR

Parameters
instance:XrInstance

an XrInstance handle previously created with CreateInstance.

systemId:long

an XrSystemId handle for the system which will be used to create a session.

bufferCountOutput:IntBuffer

a pointer to the count of characters written (including terminating \0), or a pointer to the required capacity in the case that bufferCapacityInput is insufficient.

buffer:ByteBuffer

a pointer to an array of characters, but can be NULL if bufferCapacityInput is 0. The format of the output is a single space (ASCII 0x20) delimited string of extension names.

Annotations
@NativeType:XrResult