Skip to content

Commit e5f861b

Browse files
committed
Update to OpenVR 1.0.10
1 parent 2744c18 commit e5f861b

File tree

7 files changed

+403
-211
lines changed

7 files changed

+403
-211
lines changed

OpenVR/headers/openvr.h

Lines changed: 123 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ enum ETrackedDeviceProperty
315315
Prop_DriverDirectModeSendsVsyncEvents_Bool = 2043,
316316
Prop_DisplayDebugMode_Bool = 2044,
317317
Prop_GraphicsAdapterLuid_Uint64 = 2045,
318+
Prop_DriverProvidedChaperonePath_String = 2048,
318319

319320
// Properties that are unique to TrackedDeviceClass_Controller
320321
Prop_AttachedDeviceId_String = 3000,
@@ -392,6 +393,11 @@ struct VRTextureBounds_t
392393
float uMax, vMax;
393394
};
394395

396+
/** Allows specifying pose used to render provided scene texture (if different from value returned by WaitGetPoses). */
397+
struct VRTextureWithPose_t : public Texture_t
398+
{
399+
HmdMatrix34_t mDeviceToAbsoluteTracking; // Actual pose used to render scene textures.
400+
};
395401

396402
/** Allows the application to control how scene textures are used by the compositor when calling Submit. */
397403
enum EVRSubmitFlags
@@ -409,6 +415,9 @@ enum EVRSubmitFlags
409415

410416
// Do not use
411417
Submit_Reserved = 0x04,
418+
419+
// Set to indicate that pTexture is a pointer to a VRTextureWithPose_t.
420+
Submit_TextureWithPose = 0x08,
412421
};
413422

414423
/** Data required for passing Vulkan textures to IVRCompositor::Submit.
@@ -464,6 +473,8 @@ enum EVREventType
464473
VREvent_WatchdogWakeUpRequested = 109,
465474
VREvent_LensDistortionChanged = 110,
466475
VREvent_PropertyChanged = 111,
476+
VREvent_WirelessDisconnect = 112,
477+
VREvent_WirelessReconnect = 113,
467478

468479
VREvent_ButtonPress = 200, // data is controller
469480
VREvent_ButtonUnpress = 201, // data is controller
@@ -583,6 +594,7 @@ enum EVREventType
583594
VREvent_PerformanceTest_FidelityLevel = 1602,
584595

585596
VREvent_MessageOverlay_Closed = 1650,
597+
VREvent_MessageOverlayCloseRequested = 1651,
586598

587599
// Vendors are free to expose private events in this reserved region
588600
VREvent_VendorSpecific_Reserved_Start = 10000,
@@ -1016,65 +1028,69 @@ enum EVRInitError
10161028
VRInitError_None = 0,
10171029
VRInitError_Unknown = 1,
10181030

1019-
VRInitError_Init_InstallationNotFound = 100,
1020-
VRInitError_Init_InstallationCorrupt = 101,
1021-
VRInitError_Init_VRClientDLLNotFound = 102,
1022-
VRInitError_Init_FileNotFound = 103,
1023-
VRInitError_Init_FactoryNotFound = 104,
1024-
VRInitError_Init_InterfaceNotFound = 105,
1025-
VRInitError_Init_InvalidInterface = 106,
1026-
VRInitError_Init_UserConfigDirectoryInvalid = 107,
1027-
VRInitError_Init_HmdNotFound = 108,
1028-
VRInitError_Init_NotInitialized = 109,
1029-
VRInitError_Init_PathRegistryNotFound = 110,
1030-
VRInitError_Init_NoConfigPath = 111,
1031-
VRInitError_Init_NoLogPath = 112,
1032-
VRInitError_Init_PathRegistryNotWritable = 113,
1033-
VRInitError_Init_AppInfoInitFailed = 114,
1034-
VRInitError_Init_Retry = 115, // Used internally to cause retries to vrserver
1035-
VRInitError_Init_InitCanceledByUser = 116, // The calling application should silently exit. The user canceled app startup
1036-
VRInitError_Init_AnotherAppLaunching = 117,
1037-
VRInitError_Init_SettingsInitFailed = 118,
1038-
VRInitError_Init_ShuttingDown = 119,
1039-
VRInitError_Init_TooManyObjects = 120,
1040-
VRInitError_Init_NoServerForBackgroundApp = 121,
1041-
VRInitError_Init_NotSupportedWithCompositor = 122,
1042-
VRInitError_Init_NotAvailableToUtilityApps = 123,
1043-
VRInitError_Init_Internal = 124,
1044-
VRInitError_Init_HmdDriverIdIsNone = 125,
1045-
VRInitError_Init_HmdNotFoundPresenceFailed = 126,
1046-
VRInitError_Init_VRMonitorNotFound = 127,
1047-
VRInitError_Init_VRMonitorStartupFailed = 128,
1048-
VRInitError_Init_LowPowerWatchdogNotSupported = 129,
1049-
VRInitError_Init_InvalidApplicationType = 130,
1050-
VRInitError_Init_NotAvailableToWatchdogApps = 131,
1051-
VRInitError_Init_WatchdogDisabledInSettings = 132,
1052-
VRInitError_Init_VRDashboardNotFound = 133,
1053-
VRInitError_Init_VRDashboardStartupFailed = 134,
1054-
VRInitError_Init_VRHomeNotFound = 135,
1055-
VRInitError_Init_VRHomeStartupFailed = 136,
1056-
1057-
VRInitError_Driver_Failed = 200,
1058-
VRInitError_Driver_Unknown = 201,
1059-
VRInitError_Driver_HmdUnknown = 202,
1060-
VRInitError_Driver_NotLoaded = 203,
1061-
VRInitError_Driver_RuntimeOutOfDate = 204,
1062-
VRInitError_Driver_HmdInUse = 205,
1063-
VRInitError_Driver_NotCalibrated = 206,
1064-
VRInitError_Driver_CalibrationInvalid = 207,
1065-
VRInitError_Driver_HmdDisplayNotFound = 208,
1031+
VRInitError_Init_InstallationNotFound = 100,
1032+
VRInitError_Init_InstallationCorrupt = 101,
1033+
VRInitError_Init_VRClientDLLNotFound = 102,
1034+
VRInitError_Init_FileNotFound = 103,
1035+
VRInitError_Init_FactoryNotFound = 104,
1036+
VRInitError_Init_InterfaceNotFound = 105,
1037+
VRInitError_Init_InvalidInterface = 106,
1038+
VRInitError_Init_UserConfigDirectoryInvalid = 107,
1039+
VRInitError_Init_HmdNotFound = 108,
1040+
VRInitError_Init_NotInitialized = 109,
1041+
VRInitError_Init_PathRegistryNotFound = 110,
1042+
VRInitError_Init_NoConfigPath = 111,
1043+
VRInitError_Init_NoLogPath = 112,
1044+
VRInitError_Init_PathRegistryNotWritable = 113,
1045+
VRInitError_Init_AppInfoInitFailed = 114,
1046+
VRInitError_Init_Retry = 115, // Used internally to cause retries to vrserver
1047+
VRInitError_Init_InitCanceledByUser = 116, // The calling application should silently exit. The user canceled app startup
1048+
VRInitError_Init_AnotherAppLaunching = 117,
1049+
VRInitError_Init_SettingsInitFailed = 118,
1050+
VRInitError_Init_ShuttingDown = 119,
1051+
VRInitError_Init_TooManyObjects = 120,
1052+
VRInitError_Init_NoServerForBackgroundApp = 121,
1053+
VRInitError_Init_NotSupportedWithCompositor = 122,
1054+
VRInitError_Init_NotAvailableToUtilityApps = 123,
1055+
VRInitError_Init_Internal = 124,
1056+
VRInitError_Init_HmdDriverIdIsNone = 125,
1057+
VRInitError_Init_HmdNotFoundPresenceFailed = 126,
1058+
VRInitError_Init_VRMonitorNotFound = 127,
1059+
VRInitError_Init_VRMonitorStartupFailed = 128,
1060+
VRInitError_Init_LowPowerWatchdogNotSupported = 129,
1061+
VRInitError_Init_InvalidApplicationType = 130,
1062+
VRInitError_Init_NotAvailableToWatchdogApps = 131,
1063+
VRInitError_Init_WatchdogDisabledInSettings = 132,
1064+
VRInitError_Init_VRDashboardNotFound = 133,
1065+
VRInitError_Init_VRDashboardStartupFailed = 134,
1066+
VRInitError_Init_VRHomeNotFound = 135,
1067+
VRInitError_Init_VRHomeStartupFailed = 136,
1068+
VRInitError_Init_RebootingBusy = 137,
1069+
VRInitError_Init_FirmwareUpdateBusy = 138,
1070+
VRInitError_Init_FirmwareRecoveryBusy = 139,
1071+
1072+
1073+
VRInitError_Driver_Failed = 200,
1074+
VRInitError_Driver_Unknown = 201,
1075+
VRInitError_Driver_HmdUnknown = 202,
1076+
VRInitError_Driver_NotLoaded = 203,
1077+
VRInitError_Driver_RuntimeOutOfDate = 204,
1078+
VRInitError_Driver_HmdInUse = 205,
1079+
VRInitError_Driver_NotCalibrated = 206,
1080+
VRInitError_Driver_CalibrationInvalid = 207,
1081+
VRInitError_Driver_HmdDisplayNotFound = 208,
10661082
VRInitError_Driver_TrackedDeviceInterfaceUnknown = 209,
1067-
// VRInitError_Driver_HmdDisplayNotFoundAfterFix = 210, // not needed: here for historic reasons
1068-
VRInitError_Driver_HmdDriverIdOutOfBounds = 211,
1069-
VRInitError_Driver_HmdDisplayMirrored = 212,
1070-
1071-
VRInitError_IPC_ServerInitFailed = 300,
1072-
VRInitError_IPC_ConnectFailed = 301,
1073-
VRInitError_IPC_SharedStateInitFailed = 302,
1074-
VRInitError_IPC_CompositorInitFailed = 303,
1075-
VRInitError_IPC_MutexInitFailed = 304,
1076-
VRInitError_IPC_Failed = 305,
1077-
VRInitError_IPC_CompositorConnectFailed = 306,
1083+
// VRInitError_Driver_HmdDisplayNotFoundAfterFix = 210, // not needed: here for historic reasons
1084+
VRInitError_Driver_HmdDriverIdOutOfBounds = 211,
1085+
VRInitError_Driver_HmdDisplayMirrored = 212,
1086+
1087+
VRInitError_IPC_ServerInitFailed = 300,
1088+
VRInitError_IPC_ConnectFailed = 301,
1089+
VRInitError_IPC_SharedStateInitFailed = 302,
1090+
VRInitError_IPC_CompositorInitFailed = 303,
1091+
VRInitError_IPC_MutexInitFailed = 304,
1092+
VRInitError_IPC_Failed = 305,
1093+
VRInitError_IPC_CompositorConnectFailed = 306,
10781094
VRInitError_IPC_CompositorInvalidConnectResponse = 307,
10791095
VRInitError_IPC_ConnectFailedAfterMultipleAttempts = 308,
10801096

@@ -1085,7 +1101,7 @@ enum EVRInitError
10851101
VRInitError_Compositor_ScreenshotsInitFailed = 404,
10861102
VRInitError_Compositor_UnableToCreateDevice = 405,
10871103

1088-
VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000,
1104+
VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000,
10891105

10901106
VRInitError_VendorSpecific_HmdFound_CantOpenDevice = 1101,
10911107
VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102,
@@ -1280,17 +1296,20 @@ class IVRSystem
12801296
* Returns platform- and texture-type specific adapter identification so that applications and the
12811297
* compositor are creating textures and swap chains on the same GPU. If an error occurs the device
12821298
* will be set to 0.
1299+
* pInstance is an optional parameter that is required only when textureType is TextureType_Vulkan.
12831300
* [D3D10/11/12 Only (D3D9 Not Supported)]
12841301
* Returns the adapter LUID that identifies the GPU attached to the HMD. The user should
12851302
* enumerate all adapters using IDXGIFactory::EnumAdapters and IDXGIAdapter::GetDesc to find
12861303
* the adapter with the matching LUID, or use IDXGIFactory4::EnumAdapterByLuid.
12871304
* The discovered IDXGIAdapter should be used to create the device and swap chain.
12881305
* [Vulkan Only]
1289-
* Returns the vk::PhysicalDevice that should be used by the application.
1306+
* Returns the VkPhysicalDevice that should be used by the application.
1307+
* pInstance must be the instance the application will use to query for the VkPhysicalDevice. The application
1308+
* must create the VkInstance with extensions returned by IVRCompositor::GetVulkanInstanceExtensionsRequired enabled.
12901309
* [macOS Only]
12911310
* Returns an id<MTLDevice> that should be used by the application.
12921311
*/
1293-
virtual void GetOutputDevice( uint64_t *pnDevice, ETextureType textureType ) = 0;
1312+
virtual void GetOutputDevice( uint64_t *pnDevice, ETextureType textureType, VkInstance_T *pInstance = nullptr ) = 0;
12941313

12951314
// ------------------------------------
12961315
// Display Mode methods
@@ -1508,7 +1527,7 @@ class IVRSystem
15081527

15091528
};
15101529

1511-
static const char * const IVRSystem_Version = "IVRSystem_016";
1530+
static const char * const IVRSystem_Version = "IVRSystem_017";
15121531

15131532
}
15141533

@@ -1537,6 +1556,7 @@ namespace vr
15371556
VRApplicationError_OldApplicationQuitting = 112,
15381557
VRApplicationError_TransitionAborted = 113,
15391558
VRApplicationError_IsTemplate = 114, // error when you try to call LaunchApplication() on a template type app (use LaunchTemplateApplication)
1559+
VRApplicationError_SteamVRIsExiting = 115,
15401560

15411561
VRApplicationError_BufferTooSmall = 200, // The provided buffer was too small to fit the requested data
15421562
VRApplicationError_PropertyNotSet = 201, // The requested property was not set
@@ -1567,6 +1587,7 @@ namespace vr
15671587
VRApplicationProperty_IsTemplate_Bool = 61,
15681588
VRApplicationProperty_IsInstanced_Bool = 62,
15691589
VRApplicationProperty_IsInternal_Bool = 63,
1590+
VRApplicationProperty_WantsCompositorPauseInStandby_Bool = 64,
15701591

15711592
VRApplicationProperty_LastLaunchTime_Uint64 = 70,
15721593
};
@@ -1813,6 +1834,7 @@ namespace vr
18131834
static const char * const k_pch_SteamVR_RetailDemo_Bool = "retailDemo";
18141835
static const char * const k_pch_SteamVR_IpdOffset_Float = "ipdOffset";
18151836
static const char * const k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering";
1837+
static const char * const k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync";
18161838

18171839
//-----------------------------------------------------------------------------
18181840
// lighthouse keys
@@ -1916,6 +1938,7 @@ namespace vr
19161938
static const char * const k_pch_Power_TurnOffControllersTimeout_Float = "turnOffControllersTimeout";
19171939
static const char * const k_pch_Power_ReturnToWatchdogTimeout_Float = "returnToWatchdogTimeout";
19181940
static const char * const k_pch_Power_AutoLaunchSteamVROnButtonPress = "autoLaunchSteamVROnButtonPress";
1941+
static const char * const k_pch_Power_PauseCompositorOnStandby_Bool = "pauseCompositorOnStandby";
19191942

19201943
//-----------------------------------------------------------------------------
19211944
// dashboard keys
@@ -2363,9 +2386,36 @@ class IVRCompositor
23632386
* null. The string will be a space separated list of required device extensions to enable in VkCreateDevice */
23642387
virtual uint32_t GetVulkanDeviceExtensionsRequired( VkPhysicalDevice_T *pPhysicalDevice, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) = 0;
23652388

2389+
/** [ Vulkan/D3D12 Only ]
2390+
* There are two purposes for SetExplicitTimingMode:
2391+
* 1. To get a more accurate GPU timestamp for when the frame begins in Vulkan/D3D12 applications.
2392+
* 2. (Optional) To avoid having WaitGetPoses access the Vulkan queue so that the queue can be accessed from
2393+
* another thread while WaitGetPoses is executing.
2394+
*
2395+
* More accurate GPU timestamp for the start of the frame is achieved by the application calling
2396+
* SubmitExplicitTimingData immediately before its first submission to the Vulkan/D3D12 queue.
2397+
* This is more accurate because normally this GPU timestamp is recorded during WaitGetPoses. In D3D11,
2398+
* WaitGetPoses queues a GPU timestamp write, but it does not actually get submitted to the GPU until the
2399+
* application flushes. By using SubmitExplicitTimingData, the timestamp is recorded at the same place for
2400+
* Vulkan/D3D12 as it is for D3D11, resulting in a more accurate GPU time measurement for the frame.
2401+
*
2402+
* Avoiding WaitGetPoses accessing the Vulkan queue can be achieved using SetExplicitTimingMode as well. If this is desired,
2403+
* the application *MUST* call PostPresentHandoff itself prior to WaitGetPoses. If SetExplicitTimingMode is true and the
2404+
* application calls PostPresentHandoff, then WaitGetPoses is guaranteed not to access the queue. Note that PostPresentHandoff
2405+
* and SubmitExplicitTimingData will access the queue, so only WaitGetPoses becomes safe for accessing the queue from another
2406+
* thread. */
2407+
virtual void SetExplicitTimingMode( bool bExplicitTimingMode ) = 0;
2408+
2409+
/** [ Vulkan/D3D12 Only ]
2410+
* Submit explicit timing data. When SetExplicitTimingMode is true, this must be called immediately before
2411+
* the application's first vkQueueSubmit (Vulkan) or ID3D12CommandQueue::ExecuteCommandLists (D3D12) of each frame.
2412+
* This function will insert a GPU timestamp write just before the application starts its rendering. This function
2413+
* will perform a vkQueueSubmit on Vulkan so must not be done simultaneously with VkQueue operations on another thread.
2414+
* Returns VRCompositorError_RequestFailed if SetExplicitTimingMode is not enabled. */
2415+
virtual EVRCompositorError SubmitExplicitTimingData() = 0;
23662416
};
23672417

2368-
static const char * const IVRCompositor_Version = "IVRCompositor_020";
2418+
static const char * const IVRCompositor_Version = "IVRCompositor_021";
23692419

23702420
} // namespace vr
23712421

@@ -2950,6 +3000,9 @@ namespace vr
29503000

29513001
/** Show the message overlay. This will block and return you a result. **/
29523002
virtual VRMessageOverlayResponse ShowMessageOverlay( const char* pchText, const char* pchCaption, const char* pchButton0Text, const char* pchButton1Text = nullptr, const char* pchButton2Text = nullptr, const char* pchButton3Text = nullptr ) = 0;
3003+
3004+
/** If the calling process owns the overlay and it's open, this will close it. **/
3005+
virtual void CloseMessageOverlay() = 0;
29533006
};
29543007

29553008
static const char * const IVROverlay_Version = "IVROverlay_016";
@@ -3410,8 +3463,10 @@ namespace vr
34103463
*
34113464
* This path is to the "root" of the VR API install. That's the directory with
34123465
* the "drivers" directory and a platform (i.e. "win32") directory in it, not the directory with the DLL itself.
3466+
*
3467+
* pStartupInfo is reserved for future use.
34133468
*/
3414-
inline IVRSystem *VR_Init( EVRInitError *peError, EVRApplicationType eApplicationType );
3469+
inline IVRSystem *VR_Init( EVRInitError *peError, EVRApplicationType eApplicationType, const char *pStartupInfo = nullptr );
34153470

34163471
/** unloads vrclient.dll. Any interface pointers from the interface are
34173472
* invalid after this point */
@@ -3681,17 +3736,17 @@ namespace vr
36813736
m_pVRScreenshots = nullptr;
36823737
m_pVRDriverManager = nullptr;
36833738
}
3684-
3685-
VR_INTERFACE uint32_t VR_CALLTYPE VR_InitInternal( EVRInitError *peError, EVRApplicationType eApplicationType );
3739+
3740+
VR_INTERFACE uint32_t VR_CALLTYPE VR_InitInternal2( EVRInitError *peError, EVRApplicationType eApplicationType, const char *pStartupInfo );
36863741
VR_INTERFACE void VR_CALLTYPE VR_ShutdownInternal();
36873742

36883743
/** Finds the active installation of vrclient.dll and initializes it */
3689-
inline IVRSystem *VR_Init( EVRInitError *peError, EVRApplicationType eApplicationType )
3744+
inline IVRSystem *VR_Init( EVRInitError *peError, EVRApplicationType eApplicationType, const char *pStartupInfo )
36903745
{
36913746
IVRSystem *pVRSystem = nullptr;
36923747

36933748
EVRInitError eError;
3694-
VRToken() = VR_InitInternal( &eError, eApplicationType );
3749+
VRToken() = VR_InitInternal2( &eError, eApplicationType, pStartupInfo );
36953750
COpenVRContext &ctx = OpenVRInternal_ModuleContext();
36963751
ctx.Clear();
36973752

0 commit comments

Comments
 (0)