mirror of
https://github.com/JulianGro/overte.git
synced 2025-06-05 10:30:42 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into arrow-actions
This commit is contained in:
commit
342f7edff3
10 changed files with 45 additions and 24 deletions
|
@ -413,9 +413,6 @@ void AvatarMixer::handleAvatarDataPacket(QSharedPointer<ReceivedMessage> message
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarMixer::handleAvatarIdentityPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
|
void AvatarMixer::handleAvatarIdentityPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
nodeList->updateNodeWithDataFromPacket(message, senderNode);
|
|
||||||
|
|
||||||
if (senderNode->getLinkedData()) {
|
if (senderNode->getLinkedData()) {
|
||||||
AvatarMixerClientData* nodeData = dynamic_cast<AvatarMixerClientData*>(senderNode->getLinkedData());
|
AvatarMixerClientData* nodeData = dynamic_cast<AvatarMixerClientData*>(senderNode->getLinkedData());
|
||||||
if (nodeData != nullptr) {
|
if (nodeData != nullptr) {
|
||||||
|
|
|
@ -59,6 +59,11 @@ Item {
|
||||||
font.pixelSize: root.fontSize
|
font.pixelSize: root.fontSize
|
||||||
text: "Avatars: " + root.avatarCount
|
text: "Avatars: " + root.avatarCount
|
||||||
}
|
}
|
||||||
|
Text {
|
||||||
|
color: root.fontColor;
|
||||||
|
font.pixelSize: root.fontSize
|
||||||
|
text: "Frame Rate: " + root.framerate.toFixed(2);
|
||||||
|
}
|
||||||
Text {
|
Text {
|
||||||
color: root.fontColor;
|
color: root.fontColor;
|
||||||
font.pixelSize: root.fontSize
|
font.pixelSize: root.fontSize
|
||||||
|
|
|
@ -1685,7 +1685,6 @@ void Application::paintGL() {
|
||||||
Finally clearFlag([this] { _inPaint = false; });
|
Finally clearFlag([this] { _inPaint = false; });
|
||||||
|
|
||||||
_frameCount++;
|
_frameCount++;
|
||||||
_frameCounter.increment();
|
|
||||||
|
|
||||||
auto lastPaintBegin = usecTimestampNow();
|
auto lastPaintBegin = usecTimestampNow();
|
||||||
PROFILE_RANGE_EX(__FUNCTION__, 0xff0000ff, (uint64_t)_frameCount);
|
PROFILE_RANGE_EX(__FUNCTION__, 0xff0000ff, (uint64_t)_frameCount);
|
||||||
|
@ -1922,6 +1921,7 @@ void Application::paintGL() {
|
||||||
{
|
{
|
||||||
PROFILE_RANGE(__FUNCTION__ "/pluginOutput");
|
PROFILE_RANGE(__FUNCTION__ "/pluginOutput");
|
||||||
PerformanceTimer perfTimer("pluginOutput");
|
PerformanceTimer perfTimer("pluginOutput");
|
||||||
|
_frameCounter.increment();
|
||||||
displayPlugin->submitFrame(frame);
|
displayPlugin->submitFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,10 +117,12 @@ void Stats::updateStats(bool force) {
|
||||||
// we need to take one avatar out so we don't include ourselves
|
// we need to take one avatar out so we don't include ourselves
|
||||||
STAT_UPDATE(avatarCount, avatarManager->size() - 1);
|
STAT_UPDATE(avatarCount, avatarManager->size() - 1);
|
||||||
STAT_UPDATE(serverCount, (int)nodeList->size());
|
STAT_UPDATE(serverCount, (int)nodeList->size());
|
||||||
STAT_UPDATE(renderrate, qApp->getFps());
|
STAT_UPDATE(framerate, qApp->getFps());
|
||||||
if (qApp->getActiveDisplayPlugin()) {
|
if (qApp->getActiveDisplayPlugin()) {
|
||||||
STAT_UPDATE(presentrate, qApp->getActiveDisplayPlugin()->presentRate());
|
auto displayPlugin = qApp->getActiveDisplayPlugin();
|
||||||
STAT_UPDATE(presentnewrate, qApp->getActiveDisplayPlugin()->newFramePresentRate());
|
STAT_UPDATE(renderrate, displayPlugin->renderRate());
|
||||||
|
STAT_UPDATE(presentrate, displayPlugin->presentRate());
|
||||||
|
STAT_UPDATE(presentnewrate, displayPlugin->newFramePresentRate());
|
||||||
STAT_UPDATE(presentdroprate, qApp->getActiveDisplayPlugin()->droppedFrameRate());
|
STAT_UPDATE(presentdroprate, qApp->getActiveDisplayPlugin()->droppedFrameRate());
|
||||||
} else {
|
} else {
|
||||||
STAT_UPDATE(presentrate, -1);
|
STAT_UPDATE(presentrate, -1);
|
||||||
|
|
|
@ -32,8 +32,13 @@ class Stats : public QQuickItem {
|
||||||
Q_PROPERTY(float audioPacketlossDownstream READ getAudioPacketLossDownstream)
|
Q_PROPERTY(float audioPacketlossDownstream READ getAudioPacketLossDownstream)
|
||||||
|
|
||||||
STATS_PROPERTY(int, serverCount, 0)
|
STATS_PROPERTY(int, serverCount, 0)
|
||||||
|
// How often the app is creating new gpu::Frames
|
||||||
|
STATS_PROPERTY(float, framerate, 0)
|
||||||
|
// How often the display plugin is executing a given frame
|
||||||
STATS_PROPERTY(float, renderrate, 0)
|
STATS_PROPERTY(float, renderrate, 0)
|
||||||
|
// How often the display plugin is presenting to the device
|
||||||
STATS_PROPERTY(float, presentrate, 0)
|
STATS_PROPERTY(float, presentrate, 0)
|
||||||
|
|
||||||
STATS_PROPERTY(float, presentnewrate, 0)
|
STATS_PROPERTY(float, presentnewrate, 0)
|
||||||
STATS_PROPERTY(float, presentdroprate, 0)
|
STATS_PROPERTY(float, presentdroprate, 0)
|
||||||
STATS_PROPERTY(int, simrate, 0)
|
STATS_PROPERTY(int, simrate, 0)
|
||||||
|
@ -116,6 +121,7 @@ public slots:
|
||||||
void forceUpdateStats() { updateStats(true); }
|
void forceUpdateStats() { updateStats(true); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void framerateChanged();
|
||||||
void expandedChanged();
|
void expandedChanged();
|
||||||
void timingExpandedChanged();
|
void timingExpandedChanged();
|
||||||
void serverCountChanged();
|
void serverCountChanged();
|
||||||
|
|
|
@ -475,32 +475,28 @@ bool OpenGLDisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLDisplayPlugin::submitFrame(const gpu::FramePointer& newFrame) {
|
void OpenGLDisplayPlugin::submitFrame(const gpu::FramePointer& newFrame) {
|
||||||
if (_lockCurrentTexture) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
withNonPresentThreadLock([&] {
|
withNonPresentThreadLock([&] {
|
||||||
_newFrameQueue.push(newFrame);
|
_newFrameQueue.push(newFrame);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLDisplayPlugin::updateFrameData() {
|
void OpenGLDisplayPlugin::updateFrameData() {
|
||||||
|
if (_lockCurrentTexture) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
withPresentThreadLock([&] {
|
withPresentThreadLock([&] {
|
||||||
gpu::FramePointer oldFrame = _currentFrame;
|
|
||||||
uint32_t skippedCount = 0;
|
|
||||||
if (!_newFrameQueue.empty()) {
|
if (!_newFrameQueue.empty()) {
|
||||||
// We're changing frames, so we can cleanup any GL resources that might have been used by the old frame
|
// We're changing frames, so we can cleanup any GL resources that might have been used by the old frame
|
||||||
_gpuContext->recycle();
|
_gpuContext->recycle();
|
||||||
}
|
}
|
||||||
|
if (_newFrameQueue.size() > 1) {
|
||||||
|
_droppedFrameRate.increment(_newFrameQueue.size() - 1);
|
||||||
|
}
|
||||||
while (!_newFrameQueue.empty()) {
|
while (!_newFrameQueue.empty()) {
|
||||||
_currentFrame = _newFrameQueue.front();
|
_currentFrame = _newFrameQueue.front();
|
||||||
_newFrameQueue.pop();
|
_newFrameQueue.pop();
|
||||||
_gpuContext->consumeFrameUpdates(_currentFrame);
|
_gpuContext->consumeFrameUpdates(_currentFrame);
|
||||||
if (_currentFrame && oldFrame) {
|
|
||||||
skippedCount += (_currentFrame->frameIndex - oldFrame->frameIndex) - 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_droppedFrameRate.increment(skippedCount);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,6 +594,7 @@ void OpenGLDisplayPlugin::internalPresent() {
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
});
|
});
|
||||||
swapBuffers();
|
swapBuffers();
|
||||||
|
_presentRate.increment();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLDisplayPlugin::present() {
|
void OpenGLDisplayPlugin::present() {
|
||||||
|
@ -612,6 +609,13 @@ void OpenGLDisplayPlugin::present() {
|
||||||
|
|
||||||
if (_currentFrame) {
|
if (_currentFrame) {
|
||||||
{
|
{
|
||||||
|
withPresentThreadLock([&] {
|
||||||
|
_renderRate.increment();
|
||||||
|
if (_currentFrame != _lastFrame) {
|
||||||
|
_newFrameRate.increment();
|
||||||
|
}
|
||||||
|
_lastFrame = _currentFrame;
|
||||||
|
});
|
||||||
// Execute the frame rendering commands
|
// Execute the frame rendering commands
|
||||||
PROFILE_RANGE_EX("execute", 0xff00ff00, (uint64_t)presentCount())
|
PROFILE_RANGE_EX("execute", 0xff00ff00, (uint64_t)presentCount())
|
||||||
_gpuContext->executeFrame(_currentFrame);
|
_gpuContext->executeFrame(_currentFrame);
|
||||||
|
@ -628,7 +632,6 @@ void OpenGLDisplayPlugin::present() {
|
||||||
PROFILE_RANGE_EX("internalPresent", 0xff00ffff, (uint64_t)presentCount())
|
PROFILE_RANGE_EX("internalPresent", 0xff00ffff, (uint64_t)presentCount())
|
||||||
internalPresent();
|
internalPresent();
|
||||||
}
|
}
|
||||||
_presentRate.increment();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,17 +640,18 @@ float OpenGLDisplayPlugin::newFramePresentRate() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float OpenGLDisplayPlugin::droppedFrameRate() const {
|
float OpenGLDisplayPlugin::droppedFrameRate() const {
|
||||||
float result;
|
return _droppedFrameRate.rate();
|
||||||
withNonPresentThreadLock([&] {
|
|
||||||
result = _droppedFrameRate.rate();
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float OpenGLDisplayPlugin::presentRate() const {
|
float OpenGLDisplayPlugin::presentRate() const {
|
||||||
return _presentRate.rate();
|
return _presentRate.rate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float OpenGLDisplayPlugin::renderRate() const {
|
||||||
|
return _renderRate.rate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void OpenGLDisplayPlugin::swapBuffers() {
|
void OpenGLDisplayPlugin::swapBuffers() {
|
||||||
static auto context = _container->getPrimaryWidget()->context();
|
static auto context = _container->getPrimaryWidget()->context();
|
||||||
context->swapBuffers();
|
context->swapBuffers();
|
||||||
|
|
|
@ -62,6 +62,8 @@ public:
|
||||||
|
|
||||||
float droppedFrameRate() const override;
|
float droppedFrameRate() const override;
|
||||||
|
|
||||||
|
float renderRate() const override;
|
||||||
|
|
||||||
bool beginFrameRender(uint32_t frameIndex) override;
|
bool beginFrameRender(uint32_t frameIndex) override;
|
||||||
|
|
||||||
virtual bool wantVsync() const { return true; }
|
virtual bool wantVsync() const { return true; }
|
||||||
|
@ -109,8 +111,10 @@ protected:
|
||||||
RateCounter<> _droppedFrameRate;
|
RateCounter<> _droppedFrameRate;
|
||||||
RateCounter<> _newFrameRate;
|
RateCounter<> _newFrameRate;
|
||||||
RateCounter<> _presentRate;
|
RateCounter<> _presentRate;
|
||||||
|
RateCounter<> _renderRate;
|
||||||
|
|
||||||
gpu::FramePointer _currentFrame;
|
gpu::FramePointer _currentFrame;
|
||||||
|
gpu::FramePointer _lastFrame;
|
||||||
gpu::FramebufferPointer _compositeFramebuffer;
|
gpu::FramebufferPointer _compositeFramebuffer;
|
||||||
gpu::PipelinePointer _overlayPipeline;
|
gpu::PipelinePointer _overlayPipeline;
|
||||||
gpu::PipelinePointer _simplePipeline;
|
gpu::PipelinePointer _simplePipeline;
|
||||||
|
|
|
@ -178,6 +178,8 @@ public:
|
||||||
virtual bool beginFrameRender(uint32_t frameIndex) { return true; }
|
virtual bool beginFrameRender(uint32_t frameIndex) { return true; }
|
||||||
|
|
||||||
virtual float devicePixelRatio() { return 1.0f; }
|
virtual float devicePixelRatio() { return 1.0f; }
|
||||||
|
// Rate at which we render frames
|
||||||
|
virtual float renderRate() const { return -1.0f; }
|
||||||
// Rate at which we present to the display device
|
// Rate at which we present to the display device
|
||||||
virtual float presentRate() const { return -1.0f; }
|
virtual float presentRate() const { return -1.0f; }
|
||||||
// Rate at which new frames are being presented to the display device
|
// Rate at which new frames are being presented to the display device
|
||||||
|
|
|
@ -139,6 +139,7 @@ void OculusDisplayPlugin::hmdPresent() {
|
||||||
logWarning("Failed to present");
|
logWarning("Failed to present");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_presentRate.increment();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OculusDisplayPlugin::isHmdMounted() const {
|
bool OculusDisplayPlugin::isHmdMounted() const {
|
||||||
|
|
|
@ -174,6 +174,7 @@ public:
|
||||||
vr::Texture_t texture{ (void*)oglplus::GetName(_framebuffer->color), vr::API_OpenGL, vr::ColorSpace_Auto };
|
vr::Texture_t texture{ (void*)oglplus::GetName(_framebuffer->color), vr::API_OpenGL, vr::ColorSpace_Auto };
|
||||||
vr::VRCompositor()->Submit(vr::Eye_Left, &texture, &leftBounds);
|
vr::VRCompositor()->Submit(vr::Eye_Left, &texture, &leftBounds);
|
||||||
vr::VRCompositor()->Submit(vr::Eye_Right, &texture, &rightBounds);
|
vr::VRCompositor()->Submit(vr::Eye_Right, &texture, &rightBounds);
|
||||||
|
_plugin._presentRate.increment();
|
||||||
PoseData nextRender, nextSim;
|
PoseData nextRender, nextSim;
|
||||||
nextRender.frameIndex = _plugin.presentCount();
|
nextRender.frameIndex = _plugin.presentCount();
|
||||||
vr::VRCompositor()->WaitGetPoses(nextRender.vrPoses, vr::k_unMaxTrackedDeviceCount, nextSim.vrPoses, vr::k_unMaxTrackedDeviceCount);
|
vr::VRCompositor()->WaitGetPoses(nextRender.vrPoses, vr::k_unMaxTrackedDeviceCount, nextSim.vrPoses, vr::k_unMaxTrackedDeviceCount);
|
||||||
|
@ -192,7 +193,6 @@ public:
|
||||||
|
|
||||||
nextRender.update(sensorResetMat);
|
nextRender.update(sensorResetMat);
|
||||||
nextSim.update(sensorResetMat);
|
nextSim.update(sensorResetMat);
|
||||||
|
|
||||||
_plugin.withNonPresentThreadLock([&] {
|
_plugin.withNonPresentThreadLock([&] {
|
||||||
_nextRender = nextRender;
|
_nextRender = nextRender;
|
||||||
_nextSim = nextSim;
|
_nextSim = nextSim;
|
||||||
|
|
Loading…
Reference in a new issue