Closed rasmusgo closed 1 year ago
How do you feel about just enabling the extension regardless? Doesn't seem like there'd be much of an issue doing that?
How do you feel about just enabling the extension regardless? Doesn't seem like there'd be much of an issue doing that?
Sounds good to me! I'll try to find a good place to put it.
Enabling it automatically breaks the compatibility with the hotham simulator:
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : LoaderInstance::CreateInstance, no support found for requested extension: XR_KHR_win32_convert_performance_counter_time
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : xrCreateInstance failed
thread 'main' panicked at '!!FATAL ERROR - Unable to initialize OpenXR!!: a requested extension is not supported', hotham\src\engine.rs:106:14
This PR adds a method that retrieves the current time as a
openxr::Time
that can be passed to openxr instead of predicted display time to get more accurate poses with the trade-off that they will be old when the frame is done rendering and displayed to the user.This function relies on the appropriate time conversion extension being enabled. It can be enabled when creating the engine like this:
(I couldn't get it prettier because of moving mut and temporary variables being dropped. The builder pattern could probably be made to work better.)