You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 before CreateDeviceAndContextsXx to initialize the OpenXR instance and return the interface. IOpenXRContext will 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, GetCurrentBackBufferRTV etc. will return parameters for the selected view). Returns the previously current view.
WaitFrame(FrameInfo* frame) maps to xrWaitFrame, ignored by non-XR apps.
BeginFrame(FrameInfo* frame) maps to xrBeginFrame, ignored by non-XR apps.
EndFrame(FrameInfo* frame) maps to xrEndFrame, 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.
The text was updated successfully, but these errors were encountered:
Hi!
Thanks for looking into this.
I am not very familiar with OpenXR, so please correct me where I am wrong.
From my understanding, from the graphics point of view the only thing that connects XR application to rendering code is the swap chain. Core module only implements rendering functionality, it does not handle application-level tasks such input, app main loop, etc. So it seems that for the core module, what needs to be added is a new IEngineFactory method CreateXRSwapChain that will take the XR session and other required parameters.
Other application-specific logic does not belong to Core module. Instead, I think it should be added to tools module. There is a NativeAppBase, so probably there should be XRApp that will implement all logic like WaitFrame, BeginFrame, etc. What do you think?
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 beforeCreateDeviceAndContextsXx
to initialize the OpenXR instance and return the interface.IOpenXRContext
will 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
,GetCurrentBackBufferRTV
etc. 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
.The text was updated successfully, but these errors were encountered: