diff options
Diffstat (limited to 'src/quick/scenegraph/coreapi')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 12 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrenderer.cpp | 19 |
2 files changed, 14 insertions, 17 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index ce331cc883..ac45cf70db 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -128,8 +128,9 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material) if (shader) return shader; - if (QSG_LOG_TIME_COMPILATION().isDebugEnabled() || QQuickProfiler::profilingSceneGraph()) + if (QSG_LOG_TIME_COMPILATION().isDebugEnabled()) qsg_renderer_timer.start(); + Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphContextFrame); QSGMaterialShader *s = material->createShader(); QOpenGLContext *ctx = QOpenGLContext::currentContext(); @@ -159,8 +160,7 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material) qCDebug(QSG_LOG_TIME_COMPILATION, "shader compiled in %dms", (int) qsg_renderer_timer.elapsed()); - Q_QUICK_SG_PROFILE(QQuickProfiler::SceneGraphContextFrame, ( - qsg_renderer_timer.nsecsElapsed())); + Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame); rewrittenShaders[type] = shader; return shader; @@ -173,8 +173,9 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate if (shader) return shader; - if (QSG_LOG_TIME_COMPILATION().isDebugEnabled() || QQuickProfiler::profilingSceneGraph()) + if (QSG_LOG_TIME_COMPILATION().isDebugEnabled()) qsg_renderer_timer.start(); + Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphContextFrame); QSGMaterialShader *s = static_cast<QSGMaterialShader *>(material->createShader()); context->compile(s, material); @@ -190,8 +191,7 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate qCDebug(QSG_LOG_TIME_COMPILATION, "shader compiled in %dms (no rewrite)", (int) qsg_renderer_timer.elapsed()); - Q_QUICK_SG_PROFILE(QQuickProfiler::SceneGraphContextFrame, ( - qsg_renderer_timer.nsecsElapsed())); + Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame); return shader; } diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index dd089425f6..ce86408434 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -176,10 +176,11 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) m_is_rendering = true; - bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled() || - QQuickProfiler::profilingSceneGraph(); + bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled(); if (profileFrames) frameTimer.start(); + Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphRendererFrame); + qint64 bindTime = 0; qint64 renderTime = 0; @@ -189,6 +190,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) bindable.bind(); if (profileFrames) bindTime = frameTimer.nsecsElapsed(); + Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame); // Sanity check that attribute registers are disabled if (qsg_sanity_check) { @@ -206,6 +208,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) render(); if (profileFrames) renderTime = frameTimer.nsecsElapsed(); + Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRendererFrame); m_is_rendering = false; m_changed_emitted = false; @@ -218,13 +221,6 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) int((updatePassTime - preprocessTime) / 1000000), int((bindTime - updatePassTime) / 1000000), int((renderTime - bindTime) / 1000000)); - - Q_QUICK_SG_PROFILE(QQuickProfiler::SceneGraphRendererFrame, ( - preprocessTime, - updatePassTime - preprocessTime, - bindTime - updatePassTime, - renderTime - bindTime)); - } /*! @@ -273,15 +269,16 @@ void QSGRenderer::preprocess() } } - bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled()|| - QQuickProfiler::profilingSceneGraph(); + bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled(); if (profileFrames) preprocessTime = frameTimer.nsecsElapsed(); + Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame); nodeUpdater()->updateStates(root); if (profileFrames) updatePassTime = frameTimer.nsecsElapsed(); + Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame); } void QSGRenderer::addNodesToPreprocess(QSGNode *node) |