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