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 <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2022-09-16 19:00:01 +02:00
parent cb13ae75e3
commit d5806f8f56
2 changed files with 1 additions and 2 deletions

View File

@ -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()) {

View File

@ -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