diff --git a/src/openvr/__init__.py b/src/openvr/__init__.py index 240b83f..106990c 100644 --- a/src/openvr/__init__.py +++ b/src/openvr/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python -# Unofficial python bindings for OpenVR API version 1.23.7 +# Unofficial python bindings for OpenVR API version 1.26.7 # from https://github.com/cmbruns/pyopenvr # based on OpenVR C++ API at https://github.com/ValveSoftware/openvr @@ -98,7 +98,7 @@ class ID3D12CommandQueue(Structure): #################### k_nSteamVRVersionMajor = 1 -k_nSteamVRVersionMinor = 23 +k_nSteamVRVersionMinor = 26 k_nSteamVRVersionBuild = 7 k_nDriverNone = 0xFFFFFFFF k_unMaxDriverDebugResponseSize = 32768 @@ -219,7 +219,6 @@ class ID3D12CommandQueue(Structure): k_pch_SteamVR_ForceWindows32bitVRMonitor = 'forceWindows32BitVRMonitor' k_pch_SteamVR_DebugInputBinding = 'debugInputBinding' k_pch_SteamVR_DoNotFadeToGrid = 'doNotFadeToGrid' -k_pch_SteamVR_RenderCameraMode = 'renderCameraMode' k_pch_SteamVR_EnableSharedResourceJournaling = 'enableSharedResourceJournaling' k_pch_SteamVR_EnableSafeMode = 'enableSafeMode' k_pch_SteamVR_PreferredRefreshRate = 'preferredRefreshRate' @@ -289,6 +288,7 @@ class ID3D12CommandQueue(Structure): k_pch_Perf_SaveTimingsOnExit_Bool = 'saveTimingsOnExit' k_pch_Perf_TestData_Float = 'perfTestData' k_pch_Perf_GPUProfiling_Bool = 'GPUProfiling' +k_pch_Perf_GpuBusMonitoring_Bool = 'gpuBusMonitoring' k_pch_CollisionBounds_Section = 'collisionBounds' k_pch_CollisionBounds_Style_Int32 = 'CollisionBoundsStyle' k_pch_CollisionBounds_GroundPerimeterOn_Bool = 'CollisionBoundsGroundPerimeterOn' @@ -346,6 +346,7 @@ class ID3D12CommandQueue(Structure): k_pch_Dashboard_DashboardScale = 'dashboardScale' k_pch_Dashboard_UseStandaloneSystemLayer = 'standaloneSystemLayer' k_pch_Dashboard_StickyDashboard = 'stickyDashboard' +k_pch_Dashboard_AllowSteamOverlays_Bool = 'allowSteamOverlays' k_pch_modelskin_Section = 'modelskins' k_pch_Driver_Enable_Bool = 'enable' k_pch_Driver_BlockedBySafemode_Bool = 'blocked_by_safe_mode' @@ -358,6 +359,7 @@ class ID3D12CommandQueue(Structure): k_pch_App_BindingAutosaveURLSuffix_String = 'AutosaveURL' k_pch_App_BindingLegacyAPISuffix_String = '_legacy' k_pch_App_BindingSteamVRInputAPISuffix_String = '_steamvrinput' +k_pch_App_BindingOpenXRAPISuffix_String = '_openxr' k_pch_App_BindingCurrentURLSuffix_String = 'CurrentURL' k_pch_App_BindingPreviousURLSuffix_String = 'PreviousURL' k_pch_App_NeedToUpdateAutosaveSuffix_Bool = 'NeedToUpdateAutosave' @@ -387,7 +389,7 @@ class ID3D12CommandQueue(Structure): k_unVROverlayMaxNameLength = 128 # The maximum length of an overlay name in bytes, counting the terminating null character. k_unMaxOverlayCount = 128 # The maximum number of overlays that can exist in the system at one time. k_unMaxOverlayIntersectionMaskPrimitivesCount = 32 # The maximum number of overlay intersection mask primitives per overlay -IVROverlay_Version = 'IVROverlay_026' +IVROverlay_Version = 'IVROverlay_027' IVROverlayView_Version = 'IVROverlayView_003' k_pch_Controller_Component_GDC2015 = 'gdc2015' # Canonical coordinate system of the gdc 2015 wired controller, provided for backwards compatibility k_pch_Controller_Component_Base = 'base' # For controllers with an unambiguous 'base'. @@ -623,13 +625,20 @@ class ID3D12CommandQueue(Structure): Prop_CameraGlobalGain_Float = ENUM_VALUE_TYPE(2089) Prop_DashboardScale_Float = ENUM_VALUE_TYPE(2091) Prop_PeerButtonInfo_String = ENUM_VALUE_TYPE(2092) +Prop_Hmd_SupportsHDR10_Bool = ENUM_VALUE_TYPE(2093) +Prop_Hmd_EnableParallelRenderCameras_Bool = ENUM_VALUE_TYPE(2094) +Prop_DriverProvidedChaperoneJson_String = ENUM_VALUE_TYPE(2095) Prop_IpdUIRangeMinMeters_Float = ENUM_VALUE_TYPE(2100) Prop_IpdUIRangeMaxMeters_Float = ENUM_VALUE_TYPE(2101) Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = ENUM_VALUE_TYPE(2102) Prop_Hmd_SupportsMicMonitoring_Bool = ENUM_VALUE_TYPE(2103) Prop_Hmd_SupportsDisplayPortTrainingMode_Bool = ENUM_VALUE_TYPE(2104) -Prop_SupportsRoomViewDirect_Bool = ENUM_VALUE_TYPE(2105) -Prop_SupportsAppThrottling_Bool = ENUM_VALUE_TYPE(2106) +Prop_Hmd_SupportsRoomViewDirect_Bool = ENUM_VALUE_TYPE(2105) +Prop_Hmd_SupportsAppThrottling_Bool = ENUM_VALUE_TYPE(2106) +Prop_Hmd_SupportsGpuBusMonitoring_Bool = ENUM_VALUE_TYPE(2107) +Prop_DSCVersion_Int32 = ENUM_VALUE_TYPE(2110) +Prop_DSCSliceCount_Int32 = ENUM_VALUE_TYPE(2111) +Prop_DSCBPPx16_Int32 = ENUM_VALUE_TYPE(2112) Prop_DriverRequestedMuraCorrectionMode_Int32 = ENUM_VALUE_TYPE(2200) Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = ENUM_VALUE_TYPE(2201) Prop_DriverRequestedMuraFeather_InnerRight_Int32 = ENUM_VALUE_TYPE(2202) @@ -772,13 +781,13 @@ class ID3D12CommandQueue(Structure): VREvent_InputFocusCaptured = ENUM_VALUE_TYPE(400) VREvent_InputFocusReleased = ENUM_VALUE_TYPE(401) VREvent_SceneApplicationChanged = ENUM_VALUE_TYPE(404) -VREvent_SceneFocusChanged = ENUM_VALUE_TYPE(405) VREvent_InputFocusChanged = ENUM_VALUE_TYPE(406) VREvent_SceneApplicationUsingWrongGraphicsAdapter = ENUM_VALUE_TYPE(408) VREvent_ActionBindingReloaded = ENUM_VALUE_TYPE(409) VREvent_HideRenderModels = ENUM_VALUE_TYPE(410) VREvent_ShowRenderModels = ENUM_VALUE_TYPE(411) VREvent_SceneApplicationStateChanged = ENUM_VALUE_TYPE(412) +VREvent_SceneAppPipeDisconnected = ENUM_VALUE_TYPE(413) VREvent_ConsoleOpened = ENUM_VALUE_TYPE(420) VREvent_ConsoleClosed = ENUM_VALUE_TYPE(421) VREvent_OverlayShown = ENUM_VALUE_TYPE(500) @@ -935,6 +944,8 @@ class ID3D12CommandQueue(Structure): k_EButton_IndexController_A = ENUM_VALUE_TYPE(2) k_EButton_IndexController_B = ENUM_VALUE_TYPE(1) k_EButton_IndexController_JoyStick = ENUM_VALUE_TYPE(35) +k_EButton_Reserved0 = ENUM_VALUE_TYPE(50) +k_EButton_Reserved1 = ENUM_VALUE_TYPE(51) k_EButton_Max = ENUM_VALUE_TYPE(64) EVRMouseButton = ENUM_TYPE @@ -1499,13 +1510,13 @@ class ID3D12CommandQueue(Structure): VROverlayTransform_Invalid = ENUM_VALUE_TYPE(-1) VROverlayTransform_Absolute = ENUM_VALUE_TYPE(0) VROverlayTransform_TrackedDeviceRelative = ENUM_VALUE_TYPE(1) -VROverlayTransform_SystemOverlay = ENUM_VALUE_TYPE(2) VROverlayTransform_TrackedComponent = ENUM_VALUE_TYPE(3) VROverlayTransform_Cursor = ENUM_VALUE_TYPE(4) VROverlayTransform_DashboardTab = ENUM_VALUE_TYPE(5) VROverlayTransform_DashboardThumb = ENUM_VALUE_TYPE(6) VROverlayTransform_Mountable = ENUM_VALUE_TYPE(7) VROverlayTransform_Projection = ENUM_VALUE_TYPE(8) +VROverlayTransform_Subview = ENUM_VALUE_TYPE(9) VROverlayFlags = ENUM_TYPE VROverlayFlags_NoDashboardTab = ENUM_VALUE_TYPE(8) @@ -1526,6 +1537,7 @@ class ID3D12CommandQueue(Structure): VROverlayFlags_WantsModalBehavior = ENUM_VALUE_TYPE(1048576) VROverlayFlags_IsPremultiplied = ENUM_VALUE_TYPE(2097152) VROverlayFlags_IgnoreTextureAlpha = ENUM_VALUE_TYPE(4194304) +VROverlayFlags_Reserved = ENUM_VALUE_TYPE(67108864) VRMessageOverlayResponse = ENUM_TYPE VRMessageOverlayResponse_ButtonPress_0 = ENUM_VALUE_TYPE(0) @@ -1655,6 +1667,8 @@ class ID3D12CommandQueue(Structure): openvr_bool = c_ubyte PropertyTypeTag_t = c_uint32 +vrshared_uint64_t = c_uint64 +vrshared_double = c_double SpatialAnchorHandle_t = c_uint32 glSharedTextureHandle_t = c_void_p glInt_t = c_int32 @@ -1855,19 +1869,6 @@ class Texture_t(Structure): ] -class TrackedDevicePose_t(Structure): - """describes a single pose for a tracked object""" - - _fields_ = [ - ("mDeviceToAbsoluteTracking", HmdMatrix34_t), - ("vVelocity", HmdVector3_t), - ("vAngularVelocity", HmdVector3_t), - ("eTrackingResult", ETrackingResult), - ("bPoseIsValid", openvr_bool), - ("bDeviceIsConnected", openvr_bool), - ] - - class VRTextureBounds_t(Structure): """ Allows the application to control what part of the provided texture will be used in the @@ -1910,6 +1911,19 @@ class VRTextureWithPoseAndDepth_t(VRTextureWithPose_t): ] +class TrackedDevicePose_t(Structure): + """describes a single pose for a tracked object""" + + _fields_ = [ + ("mDeviceToAbsoluteTracking", HmdMatrix34_t), + ("vVelocity", HmdVector3_t), + ("vAngularVelocity", HmdVector3_t), + ("eTrackingResult", ETrackingResult), + ("bPoseIsValid", openvr_bool), + ("bDeviceIsConnected", openvr_bool), + ] + + class VRVulkanTextureData_t(Structure): """ Data required for passing Vulkan textures to IVRCompositor::Submit. @@ -2392,6 +2406,13 @@ class Compositor_CumulativeStats(Structure): ("m_nNumFramePresentsTimedOut", c_uint32), ("m_nNumDroppedFramesTimedOut", c_uint32), ("m_nNumReprojectedFramesTimedOut", c_uint32), + ("m_nNumFrameSubmits", c_uint32), + ("m_flSumCompositorCPUTimeMS", vrshared_double), + ("m_flSumCompositorGPUTimeMS", vrshared_double), + ("m_flSumTargetFrameTimes", vrshared_double), + ("m_flSumApplicationCPUTimeMS", vrshared_double), + ("m_flSumApplicationGPUTimeMS", vrshared_double), + ("m_nNumFramesWithDepth", c_uint32), ] @@ -4992,8 +5013,6 @@ class IVROverlay_FnTable(Structure): ("getOverlayTransformTrackedDeviceRelative", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, POINTER(TrackedDeviceIndex_t), POINTER(HmdMatrix34_t))), ("setOverlayTransformTrackedDeviceComponent", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, TrackedDeviceIndex_t, c_char_p)), ("getOverlayTransformTrackedDeviceComponent", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, POINTER(TrackedDeviceIndex_t), c_char_p, c_uint32)), - ("getOverlayTransformOverlayRelative", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, POINTER(VROverlayHandle_t), POINTER(HmdMatrix34_t))), - ("setOverlayTransformOverlayRelative", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, VROverlayHandle_t, POINTER(HmdMatrix34_t))), ("setOverlayTransformCursor", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, POINTER(HmdVector2_t))), ("getOverlayTransformCursor", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, POINTER(HmdVector2_t))), ("setOverlayTransformProjection", OPENVR_FNTABLE_CALLTYPE(EVROverlayError, VROverlayHandle_t, ETrackingUniverseOrigin, POINTER(HmdMatrix34_t), POINTER(VROverlayProjection_t), EVREye)), @@ -5237,6 +5256,9 @@ def setOverlaySortOrder(self, overlayHandle, sortOrder) -> None: Within a category overlays are rendered lowest sort order to highest sort order. Overlays with the same sort order are rendered back to front base on distance from the HMD. + Subview overlays are always drawn immediately on top of their parent overlay, and the sort order is + only relative to their peer subviews for that overlay. + Sort order defaults to 0. """ fn = self.function_table.setOverlaySortOrder @@ -5386,21 +5408,6 @@ def getOverlayTransformTrackedDeviceComponent(self, overlayHandle): openvr.error_code.OverlayError.check_error_value(error) return deviceIndex, bytes(componentName.value).decode('utf-8') - def getOverlayTransformOverlayRelative(self, overlayHandle): - """Gets the transform if it is relative to another overlay. Returns an error if the transform is some other type.""" - fn = self.function_table.getOverlayTransformOverlayRelative - overlayHandleParent = VROverlayHandle_t() - parentOverlayToOverlayTransform = HmdMatrix34_t() - error = fn(overlayHandle, byref(overlayHandleParent), byref(parentOverlayToOverlayTransform)) - openvr.error_code.OverlayError.check_error_value(error) - return overlayHandleParent.value, parentOverlayToOverlayTransform - - def setOverlayTransformOverlayRelative(self, overlayHandle, overlayHandleParent, parentOverlayToOverlayTransform) -> None: - """Sets the transform to relative to the transform of the specified overlay. This overlays visibility will also track the parents visibility""" - fn = self.function_table.setOverlayTransformOverlayRelative - error = fn(overlayHandle, overlayHandleParent, byref(parentOverlayToOverlayTransform)) - openvr.error_code.OverlayError.check_error_value(error) - def setOverlayTransformCursor(self, cursorOverlayHandle, hotspot) -> None: """ Sets the hotspot for the specified overlay when that overlay is used as a cursor. These are in texture space with 0,0 in the upper left corner of diff --git a/src/openvr/libopenvr_api_32.dll b/src/openvr/libopenvr_api_32.dll index 2c61e24..c77eadd 100644 Binary files a/src/openvr/libopenvr_api_32.dll and b/src/openvr/libopenvr_api_32.dll differ diff --git a/src/openvr/libopenvr_api_32.so b/src/openvr/libopenvr_api_32.so index 01e1339..2c4b6a9 100644 Binary files a/src/openvr/libopenvr_api_32.so and b/src/openvr/libopenvr_api_32.so differ diff --git a/src/openvr/libopenvr_api_64.dll b/src/openvr/libopenvr_api_64.dll index 2df5818..9bcb286 100644 Binary files a/src/openvr/libopenvr_api_64.dll and b/src/openvr/libopenvr_api_64.dll differ diff --git a/src/openvr/libopenvr_api_64.so b/src/openvr/libopenvr_api_64.so index 75bc5f1..c2a62d7 100644 Binary files a/src/openvr/libopenvr_api_64.so and b/src/openvr/libopenvr_api_64.so differ diff --git a/src/openvr/version.py b/src/openvr/version.py index 28e6827..932b112 100644 --- a/src/openvr/version.py +++ b/src/openvr/version.py @@ -1,7 +1,7 @@ # Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason -# 3) we can import it into your module module +# 3) we can import it into your module # http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package -__version__ = '1.23.0701' +__version__ = '1.26.0701' diff --git a/src/translate/generator.py b/src/translate/generator.py index 28af437..67ac392 100644 --- a/src/translate/generator.py +++ b/src/translate/generator.py @@ -367,7 +367,7 @@ def write_version(version, file_out): # Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason - # 3) we can import it into your module module + # 3) we can import it into your module # http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package __version__ = '{".".join([str(v) for v in version])}' diff --git a/src/translate/openvr.h b/src/translate/openvr.h index 2033f57..7fdfa2a 100644 --- a/src/translate/openvr.h +++ b/src/translate/openvr.h @@ -16,7 +16,7 @@ namespace vr { static const uint32_t k_nSteamVRVersionMajor = 1; - static const uint32_t k_nSteamVRVersionMinor = 23; + static const uint32_t k_nSteamVRVersionMinor = 26; static const uint32_t k_nSteamVRVersionBuild = 7; } // namespace vr @@ -104,40 +104,6 @@ struct VRBoneTransform_t HmdQuaternionf_t orientation; }; -#pragma pack( pop ) - -} // namespace vr - -#endif - -// vrtypes.h - -#ifndef _INCLUDE_VRTYPES_H -#define _INCLUDE_VRTYPES_H - -// Forward declarations to avoid requiring vulkan.h -struct VkDevice_T; -struct VkPhysicalDevice_T; -struct VkInstance_T; -struct VkQueue_T; - -// Forward declarations to avoid requiring d3d12.h -struct ID3D12Resource; -struct ID3D12CommandQueue; - -namespace vr -{ -#pragma pack( push, 8 ) - -/** A handle for a spatial anchor. This handle is only valid during the session it was created in. -* Anchors that live beyond one session should be saved by their string descriptors. */ -typedef uint32_t SpatialAnchorHandle_t; - -typedef void* glSharedTextureHandle_t; -typedef int32_t glInt_t; -typedef uint32_t glUInt_t; - - /** Used to return the post-distortion UVs for each color channel. * UVs range from 0 to 1 with 0,0 in the upper left corner of the * source render target. The 0,0 to 1,1 range covers a single eye. */ @@ -164,9 +130,9 @@ enum ETextureType TextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure TextureType_DXGISharedHandle = 5, // Handle is a HANDLE DXGI share handle, only supported for Overlay render targets. // this texture is used directly by our renderer, so only perform atomic (copyresource or resolve) on it - TextureType_Metal = 6, // Handle is a MTLTexture conforming to the MTLSharedTexture protocol. Textures submitted to IVRCompositor::Submit which - // are of type MTLTextureType2DArray assume layer 0 is the left eye texture (vr::EVREye::Eye_left), layer 1 is the right - // eye texture (vr::EVREye::Eye_Right) + TextureType_Metal = 6, // Handle is a MTLTexture conforming to the MTLSharedTexture protocol. Textures submitted to IVRCompositor::Submit which + // are of type MTLTextureType2DArray assume layer 0 is the left eye texture (vr::EVREye::Eye_left), layer 1 is the right + // eye texture (vr::EVREye::Eye_Right) }; enum EColorSpace @@ -183,6 +149,81 @@ struct Texture_t EColorSpace eColorSpace; }; +/** Allows the application to control what part of the provided texture will be used in the +* frame buffer. */ +struct VRTextureBounds_t +{ + float uMin, vMin; + float uMax, vMax; +}; + +/** Allows specifying pose used to render provided scene texture (if different from value returned by WaitGetPoses). */ +struct VRTextureWithPose_t : public Texture_t +{ + HmdMatrix34_t mDeviceToAbsoluteTracking; // Actual pose used to render scene textures. +}; + +struct VRTextureDepthInfo_t +{ + void* handle; // See ETextureType definition above + HmdMatrix44_t mProjection; + HmdVector2_t vRange; // 0..1 +}; + +struct VRTextureWithDepth_t : public Texture_t +{ + VRTextureDepthInfo_t depth; +}; + +struct VRTextureWithPoseAndDepth_t : public VRTextureWithPose_t +{ + VRTextureDepthInfo_t depth; +}; + +// 64-bit types that are part of public structures +// that are replicated in shared memory. +#if defined(__linux__) || defined(__APPLE__) +typedef uint64_t vrshared_uint64_t __attribute__ ((aligned(8))); +typedef double vrshared_double __attribute__ ((aligned(8))); +#else +typedef uint64_t vrshared_uint64_t; +typedef double vrshared_double; +#endif + +#pragma pack( pop ) + +} // namespace vr + +#endif + +// vrtypes.h + +#ifndef _INCLUDE_VRTYPES_H +#define _INCLUDE_VRTYPES_H + +// Forward declarations to avoid requiring vulkan.h +struct VkDevice_T; +struct VkPhysicalDevice_T; +struct VkInstance_T; +struct VkQueue_T; + +// Forward declarations to avoid requiring d3d12.h +struct ID3D12Resource; +struct ID3D12CommandQueue; + +namespace vr +{ +#pragma pack( push, 8 ) + +/** A handle for a spatial anchor. This handle is only valid during the session it was created in. +* Anchors that live beyond one session should be saved by their string descriptors. */ +typedef uint32_t SpatialAnchorHandle_t; + +typedef void* glSharedTextureHandle_t; +typedef int32_t glInt_t; +typedef uint32_t glUInt_t; + + // Handle to a shared texture (HANDLE on Windows obtained using OpenSharedResource). typedef uint64_t SharedTextureHandle_t; #define INVALID_SHARED_TEXTURE_HANDLE ((vr::SharedTextureHandle_t)0) @@ -484,14 +525,22 @@ enum ETrackedDeviceProperty // Prop_DashboardLayoutPathName_String = 2090, // DELETED Prop_DashboardScale_Float = 2091, Prop_PeerButtonInfo_String = 2092, + Prop_Hmd_SupportsHDR10_Bool = 2093, + Prop_Hmd_EnableParallelRenderCameras_Bool = 2094, + Prop_DriverProvidedChaperoneJson_String = 2095, // higher priority than Prop_DriverProvidedChaperonePath_String Prop_IpdUIRangeMinMeters_Float = 2100, Prop_IpdUIRangeMaxMeters_Float = 2101, Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = 2102, Prop_Hmd_SupportsMicMonitoring_Bool = 2103, Prop_Hmd_SupportsDisplayPortTrainingMode_Bool = 2104, - Prop_SupportsRoomViewDirect_Bool = 2105, - Prop_SupportsAppThrottling_Bool = 2106, + Prop_Hmd_SupportsRoomViewDirect_Bool = 2105, + Prop_Hmd_SupportsAppThrottling_Bool = 2106, + Prop_Hmd_SupportsGpuBusMonitoring_Bool = 2107, + + Prop_DSCVersion_Int32 = 2110, + Prop_DSCSliceCount_Int32 = 2111, + Prop_DSCBPPx16_Int32 = 2112, // Driver requested mura correction properties Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, @@ -613,37 +662,6 @@ static const VRActionSetHandle_t k_ulInvalidActionSetHandle = 0; static const VRInputValueHandle_t k_ulInvalidInputValueHandle = 0; -/** Allows the application to control what part of the provided texture will be used in the -* frame buffer. */ -struct VRTextureBounds_t -{ - float uMin, vMin; - float uMax, vMax; -}; - -/** Allows specifying pose used to render provided scene texture (if different from value returned by WaitGetPoses). */ -struct VRTextureWithPose_t : public Texture_t -{ - HmdMatrix34_t mDeviceToAbsoluteTracking; // Actual pose used to render scene textures. -}; - -struct VRTextureDepthInfo_t -{ - void* handle; // See ETextureType definition above - HmdMatrix44_t mProjection; - HmdVector2_t vRange; // 0..1 -}; - -struct VRTextureWithDepth_t : public Texture_t -{ - VRTextureDepthInfo_t depth; -}; - -struct VRTextureWithPoseAndDepth_t : public VRTextureWithPose_t -{ - VRTextureDepthInfo_t depth; -}; - /** Allows the application to control how scene textures are used by the compositor when calling Submit. */ enum EVRSubmitFlags { @@ -783,7 +801,7 @@ enum EVREventType // VREvent_SceneFocusLost = 402, // data is process // VREvent_SceneFocusGained = 403, // data is process VREvent_SceneApplicationChanged = 404, // data is process - The App actually drawing the scene changed (usually to or from the compositor) - VREvent_SceneFocusChanged = 405, // data is process - New app got access to draw the scene + // VREvent_SceneFocusChanged = 405, // data is process - This is defunct and will not be called. VREvent_InputFocusChanged = 406, // data is process // VREvent_SceneApplicationSecondaryRenderingStarted = 407, VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, // data is process @@ -794,6 +812,8 @@ enum EVREventType VREvent_SceneApplicationStateChanged = 412, // No data; but query VRApplications()->GetSceneApplicationState(); + VREvent_SceneAppPipeDisconnected = 413, // data is process - Called when the scene app's pipe has been closed. + VREvent_ConsoleOpened = 420, VREvent_ConsoleClosed = 421, @@ -1007,6 +1027,9 @@ enum EVRButtonId k_EButton_IndexController_B = k_EButton_ApplicationMenu, k_EButton_IndexController_JoyStick = k_EButton_Axis3, + k_EButton_Reserved0 = 50, + k_EButton_Reserved1 = 51, + k_EButton_Max = 64 }; @@ -2801,7 +2824,6 @@ namespace vr static const char * const k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; static const char * const k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; static const char * const k_pch_SteamVR_DoNotFadeToGrid = "doNotFadeToGrid"; - static const char * const k_pch_SteamVR_RenderCameraMode = "renderCameraMode"; static const char * const k_pch_SteamVR_EnableSharedResourceJournaling = "enableSharedResourceJournaling"; static const char * const k_pch_SteamVR_EnableSafeMode = "enableSafeMode"; static const char * const k_pch_SteamVR_PreferredRefreshRate = "preferredRefreshRate"; @@ -2895,6 +2917,7 @@ namespace vr static const char * const k_pch_Perf_SaveTimingsOnExit_Bool = "saveTimingsOnExit"; static const char * const k_pch_Perf_TestData_Float = "perfTestData"; static const char * const k_pch_Perf_GPUProfiling_Bool = "GPUProfiling"; + static const char * const k_pch_Perf_GpuBusMonitoring_Bool = "gpuBusMonitoring"; //----------------------------------------------------------------------------- // collision bounds keys @@ -2967,6 +2990,7 @@ namespace vr static const char * const k_pch_Dashboard_DashboardScale = "dashboardScale"; static const char * const k_pch_Dashboard_UseStandaloneSystemLayer = "standaloneSystemLayer"; static const char * const k_pch_Dashboard_StickyDashboard = "stickyDashboard"; + static const char * const k_pch_Dashboard_AllowSteamOverlays_Bool = "allowSteamOverlays"; //----------------------------------------------------------------------------- // model skin keys @@ -2997,7 +3021,8 @@ namespace vr // per-app keys - the section name for these is the app key itself. Some of these are prefixed by the controller type static const char* const k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; static const char* const k_pch_App_BindingLegacyAPISuffix_String = "_legacy"; - static const char* const k_pch_App_BindingSteamVRInputAPISuffix_String = "_steamvrinput"; + static const char *const k_pch_App_BindingSteamVRInputAPISuffix_String = "_steamvrinput"; + static const char *const k_pch_App_BindingOpenXRAPISuffix_String = "_openxr"; static const char* const k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; static const char* const k_pch_App_BindingPreviousURLSuffix_String = "PreviousURL"; static const char* const k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; @@ -3278,6 +3303,16 @@ struct Compositor_CumulativeStats uint32_t m_nNumFramePresentsTimedOut; uint32_t m_nNumDroppedFramesTimedOut; uint32_t m_nNumReprojectedFramesTimedOut; + + /** For items in this section, divide all the values by m_nNumFrameSubmits. */ + uint32_t m_nNumFrameSubmits; + vrshared_double m_flSumCompositorCPUTimeMS; + vrshared_double m_flSumCompositorGPUTimeMS; + vrshared_double m_flSumTargetFrameTimes; + vrshared_double m_flSumApplicationCPUTimeMS; + vrshared_double m_flSumApplicationGPUTimeMS; + + uint32_t m_nNumFramesWithDepth; // total frames submitted with depth by the current application }; struct Compositor_StageRenderSettings @@ -3737,13 +3772,14 @@ namespace vr VROverlayTransform_Invalid = -1, VROverlayTransform_Absolute = 0, VROverlayTransform_TrackedDeviceRelative = 1, - VROverlayTransform_SystemOverlay = 2, + //VROverlayTransform_SystemOverlay = 2, // Deleted from the SDK. VROverlayTransform_TrackedComponent = 3, VROverlayTransform_Cursor = 4, VROverlayTransform_DashboardTab = 5, VROverlayTransform_DashboardThumb = 6, VROverlayTransform_Mountable = 7, VROverlayTransform_Projection = 8, + VROverlayTransform_Subview = 9, }; /** Overlay control settings */ @@ -3805,6 +3841,9 @@ namespace vr // If this is set, the alpha values of the overlay texture will be ignored VROverlayFlags_IgnoreTextureAlpha = 1 << 22, + + // Do not use + VROverlayFlags_Reserved = 1 << 26, }; enum VRMessageOverlayResponse @@ -3981,6 +4020,9 @@ namespace vr * Within a category overlays are rendered lowest sort order to highest sort order. Overlays with the same * sort order are rendered back to front base on distance from the HMD. * + * Subview overlays are always drawn immediately on top of their parent overlay, and the sort order is + * only relative to their peer subviews for that overlay. + * * Sort order defaults to 0. */ virtual EVROverlayError SetOverlaySortOrder( VROverlayHandle_t ulOverlayHandle, uint32_t unSortOrder ) = 0; @@ -4041,12 +4083,6 @@ namespace vr /** Gets the transform information when the overlay is rendering on a component. */ virtual EVROverlayError GetOverlayTransformTrackedDeviceComponent( VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t *punDeviceIndex, VR_OUT_STRING() char *pchComponentName, uint32_t unComponentNameSize ) = 0; - /** Gets the transform if it is relative to another overlay. Returns an error if the transform is some other type. */ - virtual vr::EVROverlayError GetOverlayTransformOverlayRelative( VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t *ulOverlayHandleParent, HmdMatrix34_t *pmatParentOverlayToOverlayTransform ) = 0; - - /** Sets the transform to relative to the transform of the specified overlay. This overlays visibility will also track the parents visibility */ - virtual vr::EVROverlayError SetOverlayTransformOverlayRelative( VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t ulOverlayHandleParent, const HmdMatrix34_t *pmatParentOverlayToOverlayTransform ) = 0; - /** Sets the hotspot for the specified overlay when that overlay is used as a cursor. These are in texture space with 0,0 in the upper left corner of * the texture and 1,1 in the lower right corner of the texture. */ virtual EVROverlayError SetOverlayTransformCursor( VROverlayHandle_t ulCursorOverlayHandle, const HmdVector2_t *pvHotspot ) = 0; @@ -4228,7 +4264,7 @@ namespace vr virtual void CloseMessageOverlay() = 0; }; - static const char * const IVROverlay_Version = "IVROverlay_026"; + static const char * const IVROverlay_Version = "IVROverlay_027"; } // namespace vr diff --git a/src/translate/openvr_capi.h b/src/translate/openvr_capi.h index 4046df6..e054f8c 100644 --- a/src/translate/openvr_capi.h +++ b/src/translate/openvr_capi.h @@ -24,7 +24,7 @@ #endif // OPENVR API export macro -#if defined( _WIN32 ) && !defined( _X360 ) +#if defined( _WIN32 ) #if defined( OPENVR_API_EXPORTS ) #define S_API EXTERN_C __declspec( dllexport ) #elif defined( OPENVR_API_NODLL ) @@ -61,6 +61,16 @@ typedef uint64_t VRActionSetHandle_t; typedef uint64_t VRInputValueHandle_t; typedef uint64_t PathHandle_t; +// 64-bit types that are part of public structures +// that are replicated in shared memory. +#if defined(__linux__) || defined(__APPLE__) +typedef uint64_t vrshared_uint64_t __attribute__ ((aligned(8))); +typedef double vrshared_double __attribute__ ((aligned(8))); +#else +typedef uint64_t vrshared_uint64_t; +typedef double vrshared_double; +#endif + // OpenVR Constants @@ -120,7 +130,7 @@ static const unsigned long k_unVROverlayMaxKeyLength = 128; static const unsigned long k_unVROverlayMaxNameLength = 128; static const unsigned long k_unMaxOverlayCount = 128; static const unsigned long k_unMaxOverlayIntersectionMaskPrimitivesCount = 32; -static const char * IVROverlay_Version = "IVROverlay_026"; +static const char * IVROverlay_Version = "IVROverlay_027"; static const char * IVROverlayView_Version = "IVROverlayView_003"; static const unsigned long k_unHeadsetViewMaxWidth = 3840; static const unsigned long k_unHeadsetViewMaxHeight = 2160; @@ -196,7 +206,6 @@ static const char * k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bo static const char * k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; static const char * k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; static const char * k_pch_SteamVR_DoNotFadeToGrid = "doNotFadeToGrid"; -static const char * k_pch_SteamVR_RenderCameraMode = "renderCameraMode"; static const char * k_pch_SteamVR_EnableSharedResourceJournaling = "enableSharedResourceJournaling"; static const char * k_pch_SteamVR_EnableSafeMode = "enableSafeMode"; static const char * k_pch_SteamVR_PreferredRefreshRate = "preferredRefreshRate"; @@ -266,6 +275,7 @@ static const char * k_pch_Perf_AllowTimingStore_Bool = "allowTimingStore"; static const char * k_pch_Perf_SaveTimingsOnExit_Bool = "saveTimingsOnExit"; static const char * k_pch_Perf_TestData_Float = "perfTestData"; static const char * k_pch_Perf_GPUProfiling_Bool = "GPUProfiling"; +static const char * k_pch_Perf_GpuBusMonitoring_Bool = "gpuBusMonitoring"; static const char * k_pch_CollisionBounds_Section = "collisionBounds"; static const char * k_pch_CollisionBounds_Style_Int32 = "CollisionBoundsStyle"; static const char * k_pch_CollisionBounds_GroundPerimeterOn_Bool = "CollisionBoundsGroundPerimeterOn"; @@ -323,6 +333,7 @@ static const char * k_pch_Dashboard_DesktopScale = "desktopScale"; static const char * k_pch_Dashboard_DashboardScale = "dashboardScale"; static const char * k_pch_Dashboard_UseStandaloneSystemLayer = "standaloneSystemLayer"; static const char * k_pch_Dashboard_StickyDashboard = "stickyDashboard"; +static const char * k_pch_Dashboard_AllowSteamOverlays_Bool = "allowSteamOverlays"; static const char * k_pch_modelskin_Section = "modelskins"; static const char * k_pch_Driver_Enable_Bool = "enable"; static const char * k_pch_Driver_BlockedBySafemode_Bool = "blocked_by_safe_mode"; @@ -335,6 +346,7 @@ static const char * k_pch_TrackingOverride_Section = "TrackingOverrides"; static const char * k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; static const char * k_pch_App_BindingLegacyAPISuffix_String = "_legacy"; static const char * k_pch_App_BindingSteamVRInputAPISuffix_String = "_steamvrinput"; +static const char * k_pch_App_BindingOpenXRAPISuffix_String = "_openxr"; static const char * k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; static const char * k_pch_App_BindingPreviousURLSuffix_String = "PreviousURL"; static const char * k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; @@ -402,6 +414,10 @@ static const char * k_pchPathUserElbowLeft = "/user/elbow/left"; static const char * k_pchPathUserElbowRight = "/user/elbow/right"; static const char * k_pchPathUserKneeLeft = "/user/knee/left"; static const char * k_pchPathUserKneeRight = "/user/knee/right"; +static const char * k_pchPathUserWristLeft = "/user/wrist/left"; +static const char * k_pchPathUserWristRight = "/user/wrist/right"; +static const char * k_pchPathUserAnkleLeft = "/user/ankle/left"; +static const char * k_pchPathUserAnkleRight = "/user/ankle/right"; static const char * k_pchPathUserWaist = "/user/waist"; static const char * k_pchPathUserChest = "/user/chest"; static const char * k_pchPathUserCamera = "/user/camera"; @@ -631,13 +647,20 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_CameraGlobalGain_Float = 2089, ETrackedDeviceProperty_Prop_DashboardScale_Float = 2091, ETrackedDeviceProperty_Prop_PeerButtonInfo_String = 2092, + ETrackedDeviceProperty_Prop_Hmd_SupportsHDR10_Bool = 2093, + ETrackedDeviceProperty_Prop_Hmd_EnableParallelRenderCameras_Bool = 2094, + ETrackedDeviceProperty_Prop_DriverProvidedChaperoneJson_String = 2095, ETrackedDeviceProperty_Prop_IpdUIRangeMinMeters_Float = 2100, ETrackedDeviceProperty_Prop_IpdUIRangeMaxMeters_Float = 2101, ETrackedDeviceProperty_Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = 2102, ETrackedDeviceProperty_Prop_Hmd_SupportsMicMonitoring_Bool = 2103, ETrackedDeviceProperty_Prop_Hmd_SupportsDisplayPortTrainingMode_Bool = 2104, - ETrackedDeviceProperty_Prop_SupportsRoomViewDirect_Bool = 2105, - ETrackedDeviceProperty_Prop_SupportsAppThrottling_Bool = 2106, + ETrackedDeviceProperty_Prop_Hmd_SupportsRoomViewDirect_Bool = 2105, + ETrackedDeviceProperty_Prop_Hmd_SupportsAppThrottling_Bool = 2106, + ETrackedDeviceProperty_Prop_Hmd_SupportsGpuBusMonitoring_Bool = 2107, + ETrackedDeviceProperty_Prop_DSCVersion_Int32 = 2110, + ETrackedDeviceProperty_Prop_DSCSliceCount_Int32 = 2111, + ETrackedDeviceProperty_Prop_DSCBPPx16_Int32 = 2112, ETrackedDeviceProperty_Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201, ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerRight_Int32 = 2202, @@ -790,13 +813,13 @@ typedef enum EVREventType EVREventType_VREvent_InputFocusCaptured = 400, EVREventType_VREvent_InputFocusReleased = 401, EVREventType_VREvent_SceneApplicationChanged = 404, - EVREventType_VREvent_SceneFocusChanged = 405, EVREventType_VREvent_InputFocusChanged = 406, EVREventType_VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, EVREventType_VREvent_ActionBindingReloaded = 409, EVREventType_VREvent_HideRenderModels = 410, EVREventType_VREvent_ShowRenderModels = 411, EVREventType_VREvent_SceneApplicationStateChanged = 412, + EVREventType_VREvent_SceneAppPipeDisconnected = 413, EVREventType_VREvent_ConsoleOpened = 420, EVREventType_VREvent_ConsoleClosed = 421, EVREventType_VREvent_OverlayShown = 500, @@ -957,6 +980,8 @@ typedef enum EVRButtonId EVRButtonId_k_EButton_IndexController_A = 2, EVRButtonId_k_EButton_IndexController_B = 1, EVRButtonId_k_EButton_IndexController_JoyStick = 35, + EVRButtonId_k_EButton_Reserved0 = 50, + EVRButtonId_k_EButton_Reserved1 = 51, EVRButtonId_k_EButton_Max = 64, } EVRButtonId; @@ -1568,13 +1593,13 @@ typedef enum VROverlayTransformType VROverlayTransformType_VROverlayTransform_Invalid = -1, VROverlayTransformType_VROverlayTransform_Absolute = 0, VROverlayTransformType_VROverlayTransform_TrackedDeviceRelative = 1, - VROverlayTransformType_VROverlayTransform_SystemOverlay = 2, VROverlayTransformType_VROverlayTransform_TrackedComponent = 3, VROverlayTransformType_VROverlayTransform_Cursor = 4, VROverlayTransformType_VROverlayTransform_DashboardTab = 5, VROverlayTransformType_VROverlayTransform_DashboardThumb = 6, VROverlayTransformType_VROverlayTransform_Mountable = 7, VROverlayTransformType_VROverlayTransform_Projection = 8, + VROverlayTransformType_VROverlayTransform_Subview = 9, } VROverlayTransformType; typedef enum VROverlayFlags @@ -1597,6 +1622,7 @@ typedef enum VROverlayFlags VROverlayFlags_WantsModalBehavior = 1048576, VROverlayFlags_IsPremultiplied = 2097152, VROverlayFlags_IgnoreTextureAlpha = 4194304, + VROverlayFlags_Reserved = 67108864, } VROverlayFlags; typedef enum VRMessageOverlayResponse @@ -1963,16 +1989,6 @@ typedef struct Texture_t enum EColorSpace eColorSpace; } Texture_t; -typedef struct TrackedDevicePose_t -{ - struct HmdMatrix34_t mDeviceToAbsoluteTracking; - struct HmdVector3_t vVelocity; - struct HmdVector3_t vAngularVelocity; - enum ETrackingResult eTrackingResult; - bool bPoseIsValid; - bool bDeviceIsConnected; -} TrackedDevicePose_t; - typedef struct VRTextureBounds_t { float uMin; @@ -2013,6 +2029,16 @@ typedef struct VRTextureWithPoseAndDepth_t struct VRTextureDepthInfo_t depth; } VRTextureWithPoseAndDepth_t; +typedef struct TrackedDevicePose_t +{ + struct HmdMatrix34_t mDeviceToAbsoluteTracking; + struct HmdVector3_t vVelocity; + struct HmdVector3_t vAngularVelocity; + enum ETrackingResult eTrackingResult; + bool bPoseIsValid; + bool bDeviceIsConnected; +} TrackedDevicePose_t; + typedef struct VRVulkanTextureData_t { uint64_t m_nImage; @@ -2341,6 +2367,13 @@ typedef struct Compositor_CumulativeStats uint32_t m_nNumFramePresentsTimedOut; uint32_t m_nNumDroppedFramesTimedOut; uint32_t m_nNumReprojectedFramesTimedOut; + uint32_t m_nNumFrameSubmits; + vrshared_double m_flSumCompositorCPUTimeMS; + vrshared_double m_flSumCompositorGPUTimeMS; + vrshared_double m_flSumTargetFrameTimes; + vrshared_double m_flSumApplicationCPUTimeMS; + vrshared_double m_flSumApplicationGPUTimeMS; + uint32_t m_nNumFramesWithDepth; } Compositor_CumulativeStats; typedef struct Compositor_StageRenderSettings @@ -2921,8 +2954,6 @@ struct VR_IVROverlay_FnTable EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformTrackedDeviceRelative)(VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t * punTrackedDevice, struct HmdMatrix34_t * pmatTrackedDeviceToOverlayTransform); EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTransformTrackedDeviceComponent)(VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t unDeviceIndex, char * pchComponentName); EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformTrackedDeviceComponent)(VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t * punDeviceIndex, char * pchComponentName, uint32_t unComponentNameSize); - EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformOverlayRelative)(VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t * ulOverlayHandleParent, struct HmdMatrix34_t * pmatParentOverlayToOverlayTransform); - EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTransformOverlayRelative)(VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t ulOverlayHandleParent, struct HmdMatrix34_t * pmatParentOverlayToOverlayTransform); EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTransformCursor)(VROverlayHandle_t ulCursorOverlayHandle, struct HmdVector2_t * pvHotspot); EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformCursor)(VROverlayHandle_t ulOverlayHandle, struct HmdVector2_t * pvHotspot); EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTransformProjection)(VROverlayHandle_t ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, struct HmdMatrix34_t * pmatTrackingOriginToOverlayTransform, struct VROverlayProjection_t * pProjection, EVREye eEye);