Added reprojection ratio to statistics page.
This commit is contained in:
+13
-20
@@ -299,26 +299,6 @@ void OverlayController::OnTimeoutPumpEvents() {
|
||||
if (!vr::VRSystem())
|
||||
return;
|
||||
|
||||
// tell OpenVR to make some events for us
|
||||
/*for( vr::TrackedDeviceIndex_t unDeviceId = 1; unDeviceId < vr::k_unControllerStateAxisCount; unDeviceId++ ) {
|
||||
if( vr::VROverlay()->HandleControllerOverlayInteractionAsMouse( m_ulOverlayHandle, unDeviceId ) ) {
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
vr::TrackedDevicePose_t devicePoses[vr::k_unMaxTrackedDeviceCount];
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(vr::TrackingUniverseStanding, 0.0f, devicePoses, vr::k_unMaxTrackedDeviceCount);
|
||||
fixFloorTabController.eventLoopTick(devicePoses);
|
||||
statisticsTabController.eventLoopTick(devicePoses);
|
||||
moveCenterTabController.eventLoopTick(vr::VRCompositor()->GetTrackingSpace());
|
||||
steamVRTabController.eventLoopTick();
|
||||
chaperoneTabController.eventLoopTick();
|
||||
settingsTabController.eventLoopTick();
|
||||
reviveTabController.eventLoopTick();
|
||||
audioTabController.eventLoopTick();
|
||||
utilitiesTabController.eventLoopTick();
|
||||
accessibilityTabController.eventLoopTick(vr::VRCompositor()->GetTrackingSpace());
|
||||
|
||||
vr::VREvent_t vrEvent;
|
||||
while (vr::VROverlay()->PollNextOverlayEvent(m_ulOverlayHandle, &vrEvent, sizeof(vrEvent))) {
|
||||
switch (vrEvent.eventType) {
|
||||
@@ -396,6 +376,19 @@ void OverlayController::OnTimeoutPumpEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
vr::TrackedDevicePose_t devicePoses[vr::k_unMaxTrackedDeviceCount];
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(vr::TrackingUniverseStanding, 0.0f, devicePoses, vr::k_unMaxTrackedDeviceCount);
|
||||
fixFloorTabController.eventLoopTick(devicePoses);
|
||||
statisticsTabController.eventLoopTick(devicePoses);
|
||||
moveCenterTabController.eventLoopTick(vr::VRCompositor()->GetTrackingSpace());
|
||||
steamVRTabController.eventLoopTick();
|
||||
chaperoneTabController.eventLoopTick();
|
||||
settingsTabController.eventLoopTick();
|
||||
reviveTabController.eventLoopTick();
|
||||
audioTabController.eventLoopTick();
|
||||
utilitiesTabController.eventLoopTick();
|
||||
accessibilityTabController.eventLoopTick(vr::VRCompositor()->GetTrackingSpace());
|
||||
|
||||
if (m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid) {
|
||||
while (vr::VROverlay()->PollNextOverlayEvent(m_ulOverlayThumbnailHandle, &vrEvent, sizeof(vrEvent))) {
|
||||
switch (vrEvent.eventType) {
|
||||
|
||||
@@ -16,12 +16,15 @@ void StatisticsTabController::initStage2(OverlayController * parent, QQuickWindo
|
||||
void StatisticsTabController::eventLoopTick(vr::TrackedDevicePose_t* devicePoses) {
|
||||
vr::Compositor_CumulativeStats pStats;
|
||||
vr::VRCompositor()->GetCumulativeStats(&pStats, sizeof(vr::Compositor_CumulativeStats));
|
||||
if (pStats.m_nPid != compositorStatsPid) {
|
||||
if (pStats.m_nPid != m_cumStats.m_nPid) {
|
||||
m_cumStats = pStats;
|
||||
m_droppedFramesOffset = 0;
|
||||
m_reprojectedFramesOffset = 0;
|
||||
m_timedOutOffset = 0;
|
||||
compositorStatsPid = pStats.m_nPid;
|
||||
m_totalRatioPresentedOffset = 0;
|
||||
m_totalRatioReprojectedOffset = 0;
|
||||
}
|
||||
m_cumStats = pStats;
|
||||
|
||||
auto& m = devicePoses->mDeviceToAbsoluteTracking.m;
|
||||
|
||||
@@ -170,22 +173,30 @@ float StatisticsTabController::leftControllerMaxSpeed() const {
|
||||
return m_leftControllerMaxSpeed;
|
||||
}
|
||||
|
||||
unsigned StatisticsTabController::presentedFrames() const {
|
||||
return m_cumStats.m_nNumFramePresents - m_presentedFramesOffset;
|
||||
}
|
||||
|
||||
unsigned StatisticsTabController::droppedFrames() const {
|
||||
vr::Compositor_CumulativeStats pStats;
|
||||
vr::VRCompositor()->GetCumulativeStats(&pStats, sizeof(vr::Compositor_CumulativeStats));
|
||||
return pStats.m_nNumDroppedFrames - m_droppedFramesOffset;
|
||||
return m_cumStats.m_nNumDroppedFrames - m_droppedFramesOffset;
|
||||
}
|
||||
|
||||
unsigned StatisticsTabController::reprojectedFrames() const {
|
||||
vr::Compositor_CumulativeStats pStats;
|
||||
vr::VRCompositor()->GetCumulativeStats(&pStats, sizeof(vr::Compositor_CumulativeStats));
|
||||
return pStats.m_nNumReprojectedFrames - m_reprojectedFramesOffset;
|
||||
return m_cumStats.m_nNumReprojectedFrames - m_reprojectedFramesOffset;
|
||||
}
|
||||
|
||||
unsigned StatisticsTabController::timedOut() const {
|
||||
vr::Compositor_CumulativeStats pStats;
|
||||
vr::VRCompositor()->GetCumulativeStats(&pStats, sizeof(vr::Compositor_CumulativeStats));
|
||||
return pStats.m_nNumTimedOut - m_timedOutOffset;
|
||||
return m_cumStats.m_nNumTimedOut - m_timedOutOffset;
|
||||
}
|
||||
|
||||
float StatisticsTabController::totalReprojectedRatio() const {
|
||||
float totalFrames = (float)(m_cumStats.m_nNumFramePresents - m_totalRatioPresentedOffset);
|
||||
float reprojectedFrames = (float)(m_cumStats.m_nNumReprojectedFrames - m_totalRatioReprojectedOffset);
|
||||
if (totalFrames != 0.0f) {
|
||||
return reprojectedFrames / totalFrames;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void StatisticsTabController::statsDistanceResetClicked() {
|
||||
@@ -211,22 +222,25 @@ void StatisticsTabController::statsRightControllerSpeedResetClicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void StatisticsTabController::presentedFramesResetClicked() {
|
||||
m_presentedFramesOffset = m_cumStats.m_nNumFramePresents;
|
||||
}
|
||||
|
||||
void StatisticsTabController::droppedFramesResetClicked() {
|
||||
vr::Compositor_CumulativeStats pStats;
|
||||
vr::VRCompositor()->GetCumulativeStats(&pStats, sizeof(vr::Compositor_CumulativeStats));
|
||||
m_droppedFramesOffset = pStats.m_nNumDroppedFrames;
|
||||
m_droppedFramesOffset = m_cumStats.m_nNumDroppedFrames;
|
||||
}
|
||||
|
||||
void StatisticsTabController::reprojectedFramesResetClicked() {
|
||||
vr::Compositor_CumulativeStats pStats;
|
||||
vr::VRCompositor()->GetCumulativeStats(&pStats, sizeof(vr::Compositor_CumulativeStats));
|
||||
m_reprojectedFramesOffset = pStats.m_nNumReprojectedFrames;
|
||||
m_reprojectedFramesOffset = m_cumStats.m_nNumReprojectedFrames;
|
||||
}
|
||||
|
||||
void StatisticsTabController::timedOutResetClicked() {
|
||||
vr::Compositor_CumulativeStats pStats;
|
||||
vr::VRCompositor()->GetCumulativeStats(&pStats, sizeof(vr::Compositor_CumulativeStats));
|
||||
m_timedOutOffset = pStats.m_nNumTimedOut;
|
||||
m_timedOutOffset = m_cumStats.m_nNumTimedOut;
|
||||
}
|
||||
|
||||
void StatisticsTabController::totalRatioResetClicked() {
|
||||
m_totalRatioPresentedOffset = m_cumStats.m_nNumFramePresents;
|
||||
m_totalRatioReprojectedOffset = m_cumStats.m_nNumReprojectedFrames;
|
||||
}
|
||||
|
||||
} // namespace advconfig
|
||||
|
||||
@@ -18,9 +18,11 @@ class StatisticsTabController : public QObject {
|
||||
Q_PROPERTY(float hmdRotations READ hmdRotations)
|
||||
Q_PROPERTY(float leftControllerMaxSpeed READ leftControllerMaxSpeed)
|
||||
Q_PROPERTY(float rightControllerMaxSpeed READ rightControllerMaxSpeed)
|
||||
Q_PROPERTY(int presentedFrames READ presentedFrames)
|
||||
Q_PROPERTY(int droppedFrames READ droppedFrames)
|
||||
Q_PROPERTY(int reprojectedFrames READ reprojectedFrames)
|
||||
Q_PROPERTY(int timedOut READ timedOut)
|
||||
Q_PROPERTY(float totalReprojectedRatio READ totalReprojectedRatio)
|
||||
|
||||
private:
|
||||
OverlayController* parent;
|
||||
@@ -34,21 +36,20 @@ private:
|
||||
unsigned lastPosTimer = 0;
|
||||
float lastHmdPos[3];
|
||||
bool lastHmdPosValid = false;
|
||||
unsigned compositorStatsPid = 0;
|
||||
|
||||
float m_hmdRotation = 0.0f;
|
||||
|
||||
double m_hmdDistanceMoved = 0.0;
|
||||
|
||||
float m_leftControllerMaxSpeed = 0.0f;
|
||||
|
||||
float m_rightControllerMaxSpeed = 0.0f;
|
||||
|
||||
vr::Compositor_CumulativeStats m_cumStats;
|
||||
unsigned m_presentedFramesOffset = 0;
|
||||
unsigned m_droppedFramesOffset = 0;
|
||||
|
||||
unsigned m_reprojectedFramesOffset = 0;
|
||||
|
||||
unsigned m_timedOutOffset = 0;
|
||||
unsigned m_totalRatioPresentedOffset = 0;
|
||||
unsigned m_totalRatioReprojectedOffset = 0;
|
||||
|
||||
public:
|
||||
void initStage1();
|
||||
@@ -61,18 +62,22 @@ public:
|
||||
float rightControllerMaxSpeed() const;
|
||||
float leftControllerMaxSpeed() const;
|
||||
|
||||
unsigned presentedFrames() const;
|
||||
unsigned droppedFrames() const;
|
||||
unsigned reprojectedFrames() const;
|
||||
unsigned timedOut() const;
|
||||
float totalReprojectedRatio() const;
|
||||
|
||||
public slots:
|
||||
void statsDistanceResetClicked();
|
||||
void statsRotationResetClicked();
|
||||
void statsLeftControllerSpeedResetClicked();
|
||||
void statsRightControllerSpeedResetClicked();
|
||||
void presentedFramesResetClicked();
|
||||
void droppedFramesResetClicked();
|
||||
void reprojectedFramesResetClicked();
|
||||
void timedOutResetClicked();
|
||||
void totalRatioResetClicked();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user