Skip to content

Commit 80f2e46

Browse files
author
Jeep Barnett
committed
OpenVR SDK Update 0.9.14:
* IVRSystem * Added PerformanceTestEnableCapture(bool) for performance testing tools to toggle when frame timing data should be recorded. * Added PerformanceTestReportFidelityLevelChange(int) for performance testing tools to report when they've changed fidelity settings. * General * Added present count field to Compositor_FrameTiming. [git-p4: depot-paths = "//vr/steamvr/sdk_release/": change = 3205113]
1 parent 5b1187b commit 80f2e46

21 files changed

+171
-68
lines changed

bin/linux32/libopenvr_api.so

-999 Bytes
Binary file not shown.

bin/linux32/libopenvr_api.so.dbg

-4.47 KB
Binary file not shown.

bin/linux64/libopenvr_api.so

-4.56 KB
Binary file not shown.

bin/linux64/libopenvr_api.so.dbg

-12 KB
Binary file not shown.

bin/osx32/libopenvr_api.dylib

-7.34 KB
Binary file not shown.
Binary file not shown.

bin/win32/openvr_api.dll

-1.5 KB
Binary file not shown.

bin/win32/openvr_api.pdb

-128 KB
Binary file not shown.

bin/win64/openvr_api.dll

-512 Bytes
Binary file not shown.

bin/win64/openvr_api.pdb

-112 KB
Binary file not shown.

headers/openvr.h

+38-6
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ enum EVREventType
415415
VREvent_TrackedCamera_StopVideoStream = 1501,
416416
VREvent_TrackedCamera_PauseVideoStream = 1502,
417417
VREvent_TrackedCamera_ResumeVideoStream = 1503,
418+
419+
VREvent_PerformanceTest_EnableCapture = 1600,
420+
VREvent_PerformanceTest_DisableCapture = 1601,
421+
VREvent_PerformanceTest_FidelityLevel = 1602,
418422

419423
// Vendors are free to expose private events in this reserved region
420424
VREvent_VendorSpecific_Reserved_Start = 10000,
@@ -541,6 +545,11 @@ struct VREvent_Reserved_t
541545
uint64_t reserved1;
542546
};
543547

548+
struct VREvent_PerformanceTest_t
549+
{
550+
uint32_t m_nFidelityLevel;
551+
};
552+
544553
/** If you change this you must manually update openvr_interop.cs.py */
545554
typedef union
546555
{
@@ -554,6 +563,7 @@ typedef union
554563
VREvent_Keyboard_t keyboard;
555564
VREvent_Ipd_t ipd;
556565
VREvent_Chaperone_t chaperone;
566+
VREvent_PerformanceTest_t performanceTest;
557567
} VREvent_Data_t;
558568

559569
/** An event posted by the server to all running applications */
@@ -882,16 +892,23 @@ VR_CAMERA_DECL_ALIGN( 8 ) struct CameraVideoStreamFrame_t
882892
uint32_t m_nWidth;
883893
uint32_t m_nHeight;
884894

895+
uint32_t m_nImageDataSize; // Based on stream format, width, height
896+
885897
uint32_t m_nFrameSequence; // Starts from 0 when stream starts.
886-
uint32_t m_nTimeStamp; // Driver provided time stamp per driver centric time base
898+
899+
uint32_t m_nISPFrameTimeStamp; // Driver provided time stamp per driver centric time base
900+
uint32_t m_nISPReferenceTimeStamp;
901+
uint32_t m_nSyncCounter;
902+
903+
uint32_t m_nExposureTime;
887904

888905
uint32_t m_nBufferIndex; // Identifies which buffer the image data is hosted
889906
uint32_t m_nBufferCount; // Total number of configured buffers
890907

891-
uint32_t m_nImageDataSize; // Based on stream format, width, height
892-
893908
double m_flFrameElapsedTime; // Starts from 0 when stream starts. In seconds.
909+
894910
double m_flFrameCaptureTime; // Relative to when the frame was exposed/captured.
911+
uint64_t m_nFrameCaptureTicks;
895912

896913
bool m_bPoseIsValid; // Supplied by HMD layer when used as a tracked camera
897914
vr::HmdMatrix34_t m_matDeviceToAbsoluteTracking;
@@ -1170,6 +1187,18 @@ class IVRSystem
11701187
* halts the timeout and dismisses the dashboard (if it was up). Applications should be sure to actually
11711188
* prompt the user to save and then exit afterward, otherwise the user will be left in a confusing state. */
11721189
virtual void AcknowledgeQuit_UserPrompt() = 0;
1190+
1191+
// ------------------------------------
1192+
// Performance Test methods
1193+
// ------------------------------------
1194+
1195+
/** Performance Testing applications can call this to enable/disable when frame timing data should be
1196+
* captured for the Perf Test Report. */
1197+
virtual void PerformanceTestEnableCapture( bool bEnable ) = 0;
1198+
1199+
/** Performance Testing applications can call this to note on the Perf Test Report when they've shifted
1200+
* their fidelity to a new mode. */
1201+
virtual void PerformanceTestReportFidelityLevelChange( int nFidelityLevel ) = 0;
11731202
};
11741203

11751204
static const char * const IVRSystem_Version = "IVRSystem_010";
@@ -1597,6 +1626,9 @@ class IVRChaperoneSetup
15971626

15981627
/** Returns the preferred seated position. */
15991628
virtual bool GetLiveSeatedZeroPoseToRawTrackingPose( HmdMatrix34_t *pmatSeatedZeroPoseToRawTrackingPose ) = 0;
1629+
1630+
virtual void SetWorkingWallTagInfo( VR_ARRAY_COUNT(unTagCount) uint8_t *pTagsBuffer, uint32_t unTagCount ) = 0;
1631+
virtual bool GetLiveWallTagInfo( VR_OUT_ARRAY_COUNT(punTagCount) uint8_t *pTagsBuffer, uint32_t *punTagCount ) = 0;
16001632
};
16011633

16021634
static const char * const IVRChaperoneSetup_Version = "IVRChaperoneSetup_004";
@@ -1655,6 +1687,8 @@ struct Compositor_FrameTiming
16551687
float m_flHandoffStartMs;
16561688
float m_flHandoffEndMs;
16571689
float m_flCompositorUpdateCpuMs;
1690+
1691+
uint32_t m_nPresents; // number of times this frame was presented
16581692
};
16591693

16601694

@@ -1759,7 +1793,7 @@ class IVRCompositor
17591793
virtual void CompositorDumpImages() = 0;
17601794
};
17611795

1762-
static const char * const IVRCompositor_Version = "IVRCompositor_009";
1796+
static const char * const IVRCompositor_Version = "IVRCompositor_010";
17631797

17641798
} // namespace vr
17651799

@@ -2391,8 +2425,6 @@ class IVRTrackedCamera
23912425
virtual bool SetAutoExposure( vr::TrackedDeviceIndex_t nDeviceIndex, bool bEnable ) = 0;
23922426

23932427
// A stream can only be paused after it is started. The pause state is cleared after stopping.
2394-
// The camera may not support pause/resume semantics due to HW limitations.
2395-
virtual bool SupportsPauseResume( vr::TrackedDeviceIndex_t nDeviceIndex ) = 0;
23962428
virtual bool PauseVideoStream( vr::TrackedDeviceIndex_t nDeviceIndex ) = 0;
23972429
virtual bool ResumeVideoStream( vr::TrackedDeviceIndex_t nDeviceIndex ) = 0;
23982430
virtual bool IsVideoStreamPaused( vr::TrackedDeviceIndex_t nDeviceIndex ) = 0;

headers/openvr_api.cs

+50-15
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ class VRNativeEntrypoints
105105
internal static extern void VR_IVRSystem_AcknowledgeQuit_Exiting(IntPtr instancePtr);
106106
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRSystem_AcknowledgeQuit_UserPrompt")]
107107
internal static extern void VR_IVRSystem_AcknowledgeQuit_UserPrompt(IntPtr instancePtr);
108+
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRSystem_PerformanceTestEnableCapture")]
109+
internal static extern void VR_IVRSystem_PerformanceTestEnableCapture(IntPtr instancePtr, bool bEnable);
110+
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRSystem_PerformanceTestReportFidelityLevelChange")]
111+
internal static extern void VR_IVRSystem_PerformanceTestReportFidelityLevelChange(IntPtr instancePtr, int nFidelityLevel);
108112
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRExtendedDisplay_GetWindowBounds")]
109113
internal static extern void VR_IVRExtendedDisplay_GetWindowBounds(IntPtr instancePtr, ref int pnX, ref int pnY, ref uint pnWidth, ref uint pnHeight);
110114
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRExtendedDisplay_GetEyeOutputViewport")]
@@ -195,6 +199,10 @@ class VRNativeEntrypoints
195199
internal static extern void VR_IVRChaperoneSetup_ReloadFromDisk(IntPtr instancePtr, EChaperoneConfigFile configFile);
196200
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRChaperoneSetup_GetLiveSeatedZeroPoseToRawTrackingPose")]
197201
internal static extern bool VR_IVRChaperoneSetup_GetLiveSeatedZeroPoseToRawTrackingPose(IntPtr instancePtr, ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
202+
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRChaperoneSetup_SetWorkingWallTagInfo")]
203+
internal static extern void VR_IVRChaperoneSetup_SetWorkingWallTagInfo(IntPtr instancePtr, [In, Out] byte[] pTagsBuffer, uint unTagCount);
204+
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRChaperoneSetup_GetLiveWallTagInfo")]
205+
internal static extern bool VR_IVRChaperoneSetup_GetLiveWallTagInfo(IntPtr instancePtr, [In, Out] byte[] pTagsBuffer, ref uint punTagCount);
198206
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRCompositor_SetTrackingSpace")]
199207
internal static extern void VR_IVRCompositor_SetTrackingSpace(IntPtr instancePtr, ETrackingUniverseOrigin eOrigin);
200208
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRCompositor_GetTrackingSpace")]
@@ -435,8 +443,6 @@ class VRNativeEntrypoints
435443
internal static extern bool VR_IVRTrackedCamera_ReleaseVideoStreamFrame(IntPtr instancePtr, uint nDeviceIndex, ref CameraVideoStreamFrame_t pFrameImage);
436444
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRTrackedCamera_SetAutoExposure")]
437445
internal static extern bool VR_IVRTrackedCamera_SetAutoExposure(IntPtr instancePtr, uint nDeviceIndex, bool bEnable);
438-
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRTrackedCamera_SupportsPauseResume")]
439-
internal static extern bool VR_IVRTrackedCamera_SupportsPauseResume(IntPtr instancePtr, uint nDeviceIndex);
440446
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRTrackedCamera_PauseVideoStream")]
441447
internal static extern bool VR_IVRTrackedCamera_PauseVideoStream(IntPtr instancePtr, uint nDeviceIndex);
442448
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRTrackedCamera_ResumeVideoStream")]
@@ -502,6 +508,8 @@ public abstract class IVRSystem
502508
public abstract EVRFirmwareError PerformFirmwareUpdate(uint unDeviceIndex);
503509
public abstract void AcknowledgeQuit_Exiting();
504510
public abstract void AcknowledgeQuit_UserPrompt();
511+
public abstract void PerformanceTestEnableCapture(bool bEnable);
512+
public abstract void PerformanceTestReportFidelityLevelChange(int nFidelityLevel);
505513
}
506514

507515

@@ -571,6 +579,8 @@ public abstract class IVRChaperoneSetup
571579
public abstract void SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose);
572580
public abstract void ReloadFromDisk(EChaperoneConfigFile configFile);
573581
public abstract bool GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
582+
public abstract void SetWorkingWallTagInfo(byte [] pTagsBuffer);
583+
public abstract bool GetLiveWallTagInfo(out byte [] pTagsBuffer);
574584
}
575585

576586

@@ -727,7 +737,6 @@ public abstract class IVRTrackedCamera
727737
public abstract CameraVideoStreamFrame_t GetVideoStreamFrame(uint nDeviceIndex);
728738
public abstract bool ReleaseVideoStreamFrame(uint nDeviceIndex,ref CameraVideoStreamFrame_t pFrameImage);
729739
public abstract bool SetAutoExposure(uint nDeviceIndex,bool bEnable);
730-
public abstract bool SupportsPauseResume(uint nDeviceIndex);
731740
public abstract bool PauseVideoStream(uint nDeviceIndex);
732741
public abstract bool ResumeVideoStream(uint nDeviceIndex);
733742
public abstract bool IsVideoStreamPaused(uint nDeviceIndex);
@@ -1016,6 +1025,16 @@ public override void AcknowledgeQuit_UserPrompt()
10161025
CheckIfUsable();
10171026
VRNativeEntrypoints.VR_IVRSystem_AcknowledgeQuit_UserPrompt(m_pVRSystem);
10181027
}
1028+
public override void PerformanceTestEnableCapture(bool bEnable)
1029+
{
1030+
CheckIfUsable();
1031+
VRNativeEntrypoints.VR_IVRSystem_PerformanceTestEnableCapture(m_pVRSystem,bEnable);
1032+
}
1033+
public override void PerformanceTestReportFidelityLevelChange(int nFidelityLevel)
1034+
{
1035+
CheckIfUsable();
1036+
VRNativeEntrypoints.VR_IVRSystem_PerformanceTestReportFidelityLevelChange(m_pVRSystem,nFidelityLevel);
1037+
}
10191038
}
10201039

10211040

@@ -1373,6 +1392,20 @@ public override bool GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pm
13731392
bool result = VRNativeEntrypoints.VR_IVRChaperoneSetup_GetLiveSeatedZeroPoseToRawTrackingPose(m_pVRChaperoneSetup,ref pmatSeatedZeroPoseToRawTrackingPose);
13741393
return result;
13751394
}
1395+
public override void SetWorkingWallTagInfo(byte [] pTagsBuffer)
1396+
{
1397+
CheckIfUsable();
1398+
VRNativeEntrypoints.VR_IVRChaperoneSetup_SetWorkingWallTagInfo(m_pVRChaperoneSetup,pTagsBuffer,(uint) pTagsBuffer.Length);
1399+
}
1400+
public override bool GetLiveWallTagInfo(out byte [] pTagsBuffer)
1401+
{
1402+
CheckIfUsable();
1403+
uint punTagCount = 0;
1404+
bool result = VRNativeEntrypoints.VR_IVRChaperoneSetup_GetLiveWallTagInfo(m_pVRChaperoneSetup,null,ref punTagCount);
1405+
pTagsBuffer= new byte[punTagCount];
1406+
result = VRNativeEntrypoints.VR_IVRChaperoneSetup_GetLiveWallTagInfo(m_pVRChaperoneSetup,pTagsBuffer,ref punTagCount);
1407+
return result;
1408+
}
13761409
}
13771410

13781411

@@ -2004,8 +2037,6 @@ public override bool GetComponentState(string pchRenderModelName,string pchCompo
20042037
}
20052038

20062039

2007-
2008-
20092040
public class CVRNotifications : IVRNotifications
20102041
{
20112042
public CVRNotifications(IntPtr VRNotifications)
@@ -2210,12 +2241,6 @@ public override bool SetAutoExposure(uint nDeviceIndex,bool bEnable)
22102241
bool result = VRNativeEntrypoints.VR_IVRTrackedCamera_SetAutoExposure(m_pVRTrackedCamera,nDeviceIndex,bEnable);
22112242
return result;
22122243
}
2213-
public override bool SupportsPauseResume(uint nDeviceIndex)
2214-
{
2215-
CheckIfUsable();
2216-
bool result = VRNativeEntrypoints.VR_IVRTrackedCamera_SupportsPauseResume(m_pVRTrackedCamera,nDeviceIndex);
2217-
return result;
2218-
}
22192244
public override bool PauseVideoStream(uint nDeviceIndex)
22202245
{
22212246
CheckIfUsable();
@@ -2482,6 +2507,9 @@ public enum EVREventType
24822507
VREvent_TrackedCamera_StopVideoStream = 1501,
24832508
VREvent_TrackedCamera_PauseVideoStream = 1502,
24842509
VREvent_TrackedCamera_ResumeVideoStream = 1503,
2510+
VREvent_PerformanceTest_EnableCapture = 1600,
2511+
VREvent_PerformanceTest_DisableCapture = 1601,
2512+
VREvent_PerformanceTest_FidelityLevel = 1602,
24852513
VREvent_VendorSpecific_Reserved_Start = 10000,
24862514
VREvent_VendorSpecific_Reserved_End = 19999,
24872515
}
@@ -2937,6 +2965,10 @@ public enum ECameraVideoStreamFormat
29372965
public ulong reserved0;
29382966
public ulong reserved1;
29392967
}
2968+
[StructLayout(LayoutKind.Sequential)] public struct VREvent_PerformanceTest_t
2969+
{
2970+
public uint m_nFidelityLevel;
2971+
}
29402972
[StructLayout(LayoutKind.Sequential)] public struct VREvent_t
29412973
{
29422974
public EVREventType eventType;
@@ -3000,6 +3032,7 @@ public enum ECameraVideoStreamFormat
30003032
public float m_flHandoffStartMs;
30013033
public float m_flHandoffEndMs;
30023034
public float m_flCompositorUpdateCpuMs;
3035+
public uint m_nPresents;
30033036
}
30043037
[StructLayout(LayoutKind.Sequential)] public struct VROverlayIntersectionParams_t
30053038
{
@@ -3053,15 +3086,17 @@ public enum ECameraVideoStreamFormat
30533086
public ECameraVideoStreamFormat m_nStreamFormat;
30543087
public uint m_nWidth;
30553088
public uint m_nHeight;
3089+
public uint m_nImageDataSize;
30563090
public uint m_nFrameSequence;
3057-
public uint m_nTimeStamp;
3058-
public uint m_nISPTimeStamp;
3091+
public uint m_nISPFrameTimeStamp;
3092+
public uint m_nISPReferenceTimeStamp;
3093+
public uint m_nSyncCounter;
30593094
public uint m_nExposureTime;
30603095
public uint m_nBufferIndex;
30613096
public uint m_nBufferCount;
3062-
public uint m_nImageDataSize;
30633097
public double m_flFrameElapsedTime;
30643098
public double m_flFrameCaptureTime;
3099+
public ulong m_nFrameCaptureTicks;
30653100
[MarshalAs(UnmanagedType.I1)]
30663101
public bool m_bPoseIsValid;
30673102
public HmdMatrix34_t m_matDeviceToAbsoluteTracking;
@@ -3111,7 +3146,7 @@ public static string GetStringForHmdError(EVRInitError error)
31113146
public const string IVRApplications_Version = "IVRApplications_002";
31123147
public const string IVRChaperone_Version = "IVRChaperone_003";
31133148
public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_004";
3114-
public const string IVRCompositor_Version = "IVRCompositor_009";
3149+
public const string IVRCompositor_Version = "IVRCompositor_010";
31153150
public const uint k_unVROverlayMaxKeyLength = 128;
31163151
public const uint k_unVROverlayMaxNameLength = 128;
31173152
public const uint k_unMaxOverlayCount = 32;

0 commit comments

Comments
 (0)