mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:37:51 +02:00
some tweaks
This commit is contained in:
parent
c3f5df8f0b
commit
bfe6ebb44f
4 changed files with 13 additions and 3 deletions
|
@ -1193,6 +1193,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
properties["dropped_frame_rate"] = displayPlugin->droppedFrameRate();
|
properties["dropped_frame_rate"] = displayPlugin->droppedFrameRate();
|
||||||
properties["sim_rate"] = getAverageSimsPerSecond();
|
properties["sim_rate"] = getAverageSimsPerSecond();
|
||||||
properties["avatar_sim_rate"] = getAvatarSimrate();
|
properties["avatar_sim_rate"] = getAvatarSimrate();
|
||||||
|
properties["has_async_reprojection"] = displayPlugin->hasAsyncReprojection();
|
||||||
|
|
||||||
auto bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
auto bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
||||||
properties["packet_rate_in"] = bandwidthRecorder->getCachedTotalAverageInputPacketsPerSecond();
|
properties["packet_rate_in"] = bandwidthRecorder->getCachedTotalAverageInputPacketsPerSecond();
|
||||||
|
@ -1236,6 +1237,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto glInfo = getGLContextData();
|
auto glInfo = getGLContextData();
|
||||||
properties["gl_info"] = glInfo;
|
properties["gl_info"] = glInfo;
|
||||||
properties["gpu_free_memory"] = (int)BYTES_TO_MB(gpu::Context::getFreeGPUMemory());
|
properties["gpu_free_memory"] = (int)BYTES_TO_MB(gpu::Context::getFreeGPUMemory());
|
||||||
|
properties["ideal_thread_count"] = QThread::idealThreadCount();
|
||||||
|
|
||||||
auto hmdHeadPose = getHMDSensorPose();
|
auto hmdHeadPose = getHMDSensorPose();
|
||||||
properties["hmd_head_pose_changed"] = isHMDMode() && (hmdHeadPose != lastHMDHeadPose);
|
properties["hmd_head_pose_changed"] = isHMDMode() && (hmdHeadPose != lastHMDHeadPose);
|
||||||
|
|
|
@ -139,6 +139,7 @@ public:
|
||||||
virtual bool isStereo() const { return isHmd(); }
|
virtual bool isStereo() const { return isHmd(); }
|
||||||
virtual bool isThrottled() const { return false; }
|
virtual bool isThrottled() const { return false; }
|
||||||
virtual float getTargetFrameRate() const { return 0.0f; }
|
virtual float getTargetFrameRate() const { return 0.0f; }
|
||||||
|
virtual bool hasAsyncReprojection() const { return false; }
|
||||||
|
|
||||||
/// Returns a boolean value indicating whether the display is currently visible
|
/// Returns a boolean value indicating whether the display is currently visible
|
||||||
/// to the user. For monitor displays, false might indicate that a screensaver,
|
/// to the user. For monitor displays, false might indicate that a screensaver,
|
||||||
|
|
|
@ -354,7 +354,10 @@ bool OpenVrDisplayPlugin::isSupported() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float OpenVrDisplayPlugin::getTargetFrameRate() const {
|
float OpenVrDisplayPlugin::getTargetFrameRate() const {
|
||||||
return forceInterleavedReprojection ? (TARGET_RATE_OpenVr / 2.0f) : TARGET_RATE_OpenVr;
|
if (forceInterleavedReprojection && !_asyncReprojectionActive) {
|
||||||
|
return TARGET_RATE_OpenVr / 2.0f;
|
||||||
|
}
|
||||||
|
return TARGET_RATE_OpenVr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenVrDisplayPlugin::init() {
|
void OpenVrDisplayPlugin::init() {
|
||||||
|
@ -401,9 +404,10 @@ bool OpenVrDisplayPlugin::internalActivate() {
|
||||||
memset(&timing, 0, sizeof(timing));
|
memset(&timing, 0, sizeof(timing));
|
||||||
timing.m_nSize = sizeof(vr::Compositor_FrameTiming);
|
timing.m_nSize = sizeof(vr::Compositor_FrameTiming);
|
||||||
vr::VRCompositor()->GetFrameTiming(&timing);
|
vr::VRCompositor()->GetFrameTiming(&timing);
|
||||||
bool asyncReprojectionActive = timing.m_nReprojectionFlags & VRCompositor_ReprojectionAsync;
|
_asyncReprojectionActive = timing.m_nReprojectionFlags & VRCompositor_ReprojectionAsync;
|
||||||
|
|
||||||
_threadedSubmit = !asyncReprojectionActive;
|
_threadedSubmit = !_asyncReprojectionActive;
|
||||||
|
qDebug() << "OpenVR Async Reprojection active: " << _asyncReprojectionActive;
|
||||||
qDebug() << "OpenVR Threaded submit enabled: " << _threadedSubmit;
|
qDebug() << "OpenVR Threaded submit enabled: " << _threadedSubmit;
|
||||||
|
|
||||||
_openVrDisplayActive = true;
|
_openVrDisplayActive = true;
|
||||||
|
|
|
@ -41,6 +41,7 @@ public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
||||||
float getTargetFrameRate() const override;
|
float getTargetFrameRate() const override;
|
||||||
|
bool hasAsyncReprojection() const override { return _asyncReprojectionActive; }
|
||||||
|
|
||||||
void customizeContext() override;
|
void customizeContext() override;
|
||||||
void uncustomizeContext() override;
|
void uncustomizeContext() override;
|
||||||
|
@ -82,4 +83,6 @@ private:
|
||||||
std::shared_ptr<OpenVrSubmitThread> _submitThread;
|
std::shared_ptr<OpenVrSubmitThread> _submitThread;
|
||||||
std::shared_ptr<gl::OffscreenContext> _submitCanvas;
|
std::shared_ptr<gl::OffscreenContext> _submitCanvas;
|
||||||
friend class OpenVrSubmitThread;
|
friend class OpenVrSubmitThread;
|
||||||
|
|
||||||
|
bool _asyncReprojectionActive { false };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue