From 58ed7422f550d32b5ace9edc7a4887727f53493a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 17 Jun 2020 16:27:12 +0200 Subject: Remove broken profiler/trace points in the scenegraph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As the todo note says: this profiling is all wrong Not reporting something is better than reporting something bogus. The other profiling points, f.ex. in the render loops, seem to work as expected and give reasonable results in the QML Profiler view in Creator. The autotest needs fixing because there is no SGContextFrame events left with the rhi code path either atm, just like with the software backend. Change-Id: Iee2d3feb586108db50c83c6c03ea415384561ede Reviewed-by: Christian Strømme --- src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 22 --------------- src/quick/scenegraph/util/qsgrhiatlastexture.cpp | 34 +---------------------- 2 files changed, 1 insertion(+), 55 deletions(-) (limited to 'src/quick/scenegraph') diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 23469ddcdf..e1507ce6a7 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -49,13 +49,10 @@ #include #include -#include #include "qsgmaterialshader_p.h" #include "qsgrhivisualizer_p.h" -#include - #include QT_BEGIN_NAMESPACE @@ -251,11 +248,6 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material, if (shader) return shader; - Q_TRACE_SCOPE(QSG_prepareMaterial); - if (QSG_LOG_TIME_COMPILATION().isDebugEnabled()) - qsg_renderer_timer.start(); - Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphContextFrame); - shader = new Shader; QSGMaterialShader *s = static_cast(material->createShader(renderMode)); context->initializeRhiShader(s, QShader::BatchableVertexShader); @@ -269,11 +261,6 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material, shader->lastOpacity = 0; - qCDebug(QSG_LOG_TIME_COMPILATION, "material shaders prepared in %dms", (int) qsg_renderer_timer.elapsed()); - - Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame, - QQuickProfiler::SceneGraphContextMaterialCompile); - rewrittenShaders[key] = shader; return shader; } @@ -289,11 +276,6 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate if (shader) return shader; - Q_TRACE_SCOPE(QSG_prepareMaterial); - if (QSG_LOG_TIME_COMPILATION().isDebugEnabled()) - qsg_renderer_timer.start(); - Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphContextFrame); - shader = new Shader; QSGMaterialShader *s = static_cast(material->createShader(renderMode)); context->initializeRhiShader(s, QShader::StandardShader); @@ -309,10 +291,6 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate stockShaders[key] = shader; - qCDebug(QSG_LOG_TIME_COMPILATION, "shader compiled in %dms (no rewrite)", (int) qsg_renderer_timer.elapsed()); - - Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame, - QQuickProfiler::SceneGraphContextMaterialCompile); return shader; } diff --git a/src/quick/scenegraph/util/qsgrhiatlastexture.cpp b/src/quick/scenegraph/util/qsgrhiatlastexture.cpp index ce697a13fc..82aa680faf 100644 --- a/src/quick/scenegraph/util/qsgrhiatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgrhiatlastexture.cpp @@ -46,19 +46,11 @@ #include #include -#include #include #include #include #include -#include - -#if 0 -#include -#include -#endif - QT_BEGIN_NAMESPACE int qt_sg_envInt(const char *name, int defaultValue); @@ -183,33 +175,9 @@ void AtlasBase::commitTextureOperations(QRhiResourceUpdateBatch *resourceUpdates } } - for (TextureBase *t : m_pending_uploads) { - // ### this profiling is all wrong, the real work is done elsewhere - bool profileFrames = QSG_LOG_TIME_TEXTURE().isDebugEnabled(); - if (profileFrames) - qsg_renderer_timer.start(); - - Q_TRACE_SCOPE(QSG_texture_prepare); - Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphTexturePrepare); - - // Skip bind, convert, swizzle; they're irrelevant - Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphTexturePrepare, - QQuickProfiler::SceneGraphTexturePrepareStart, 3); - Q_TRACE(QSG_texture_upload_entry); - + for (TextureBase *t : m_pending_uploads) enqueueTextureUpload(t, resourceUpdates); - Q_TRACE(QSG_texture_upload_exit); - Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare, - QQuickProfiler::SceneGraphTexturePrepareUpload); - - // Skip mipmap; unused - Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphTexturePrepare, - QQuickProfiler::SceneGraphTexturePrepareUpload, 1); - Q_QUICK_SG_PROFILE_REPORT(QQuickProfiler::SceneGraphTexturePrepare, - QQuickProfiler::SceneGraphTexturePrepareMipmap); - } - m_pending_uploads.clear(); } -- cgit v1.2.3