-
Notifications
You must be signed in to change notification settings - Fork 371
Closed
Description
I'd like to add OpenXR support, opening this issue to discuss the right way to do that.
My first pass at the needed API changes for minimalist XR support:
IEngineFactory:
CreateOpenXRFactory(OpenXRCreateInfo* info, IOpenXRContext** ctx), called beforeCreateDeviceAndContextsXxto initialize the OpenXR instance and return the interface.IOpenXRContextwill provide interfaces to the session lifecycle stuff, input bindings, layers, spaces etc.
ISwapChain:
Uint32 GetViewCount()to turn the number of views for the device (typically 2 for right, left eyes). Non-OpenXR apps will return 1.OpenXRViewDesc GetOpenOpenXRViewDesc(Uint32 ViewIndex)to return the view descriptor for a given view.Uint32 SelectOpenXRView(Uint32 ViewIndex)to make one of the views "current", the rest of the swapchain functions will reference the resources for that view (e,g,GetDesc,GetCurrentBackBufferRTVetc. will return parameters for the selected view). Returns the previously current view.WaitFrame(FrameInfo* frame)maps toxrWaitFrame, ignored by non-XR apps.BeginFrame(FrameInfo* frame)maps toxrBeginFrame, ignored by non-XR apps.EndFrame(FrameInfo* frame)maps toxrEndFrame, ignored by non-XR apps.Present()will be ignored by XR apps.
The intent is to allow the same code to work in both XR and 2D mode by simply choosing to call or not call CreateOpenXRFactory.
madwax and smohanttyFdrph
Metadata
Metadata
Assignees
Labels
No labels