From d5806f8f56709b79701b6b7862636663d0960ae1 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 16 Sep 2022 19:00:01 +0200 Subject: [PATCH] Avoid assigning the ShaderInfo struct for no good reason There is implicitly shared stuff in it (QShader) and in the extreme qmlbench cases the free() would show up in the VTune profiling results. No point in doing anything anyway apart from clearing the variables list, the rest will be assigned new values anyways. Some improvement in qmlbench for delegated_shadereffect, up from ca. 430 to 442 or something along those lines. (with parent patch combined) Pick-to: 6.4 Change-Id: I0d08a28fc6b91b75eb032fdfbd71d25ee6acde62 Reviewed-by: Qt CI Bot Reviewed-by: Andy Nichols --- src/quick/items/qquickshadereffect.cpp | 2 +- src/quick/scenegraph/qsgadaptationlayer_p.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 97d0c581b7..0ff474a7ef 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -1311,7 +1311,7 @@ bool QQuickShaderEffectImpl::updateShader(Shader shaderType, const QUrl &fileUrl disconnectSignals(shaderType); - m_shaders[shaderType].shaderInfo = QSGGuiThreadShaderEffectManager::ShaderInfo(); + m_shaders[shaderType].shaderInfo.variables.clear(); m_shaders[shaderType].varData.clear(); if (!fileUrl.isEmpty()) { diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h index c20a99a8a9..6042ba67b0 100644 --- a/src/quick/scenegraph/qsgadaptationlayer_p.h +++ b/src/quick/scenegraph/qsgadaptationlayer_p.h @@ -256,7 +256,6 @@ public: Texture // for APIs with separate texture and sampler objects }; struct Variable { - Variable() {} VariableType type = Constant; QByteArray name; uint offset = 0; // for cbuffer members