mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 07:23:54 +02:00
Run the present thread at highest priority
This commit is contained in:
parent
6a66d74e19
commit
2b127720f8
1 changed files with 8 additions and 1 deletions
|
@ -28,6 +28,11 @@
|
||||||
#include <GLMHelpers.h>
|
#include <GLMHelpers.h>
|
||||||
|
|
||||||
#if THREADED_PRESENT
|
#if THREADED_PRESENT
|
||||||
|
|
||||||
|
// FIXME, for display plugins that don't block on something like vsync, just
|
||||||
|
// cap the present rate at 200
|
||||||
|
// const static unsigned int MAX_PRESENT_RATE = 200;
|
||||||
|
|
||||||
class PresentThread : public QThread, public Dependency {
|
class PresentThread : public QThread, public Dependency {
|
||||||
using Mutex = std::mutex;
|
using Mutex = std::mutex;
|
||||||
using Condition = std::condition_variable;
|
using Condition = std::condition_variable;
|
||||||
|
@ -66,8 +71,10 @@ public:
|
||||||
_context->moveToThread(this);
|
_context->moveToThread(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual void run() override {
|
virtual void run() override {
|
||||||
OpenGLDisplayPlugin* currentPlugin{ nullptr };
|
OpenGLDisplayPlugin* currentPlugin{ nullptr };
|
||||||
|
thread()->setPriority(QThread::HighestPriority);
|
||||||
Q_ASSERT(_context);
|
Q_ASSERT(_context);
|
||||||
while (!_shutdown) {
|
while (!_shutdown) {
|
||||||
if (_pendingMainThreadOperation) {
|
if (_pendingMainThreadOperation) {
|
||||||
|
@ -450,4 +457,4 @@ void OpenGLDisplayPlugin::enableDeactivate() {
|
||||||
_uncustomized = true;
|
_uncustomized = true;
|
||||||
_deactivateWait.notify_one();
|
_deactivateWait.notify_one();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue