From 0628932fef349d217c0a50a192e7ee6a955994b7 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 26 Sep 2019 11:26:51 +0200 Subject: Move cache key calculation to QOpenGLProgramBinaryCache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This class will likely be used by the OpenGL backend of QRhi as well. Therefore, we need to make it more self-contained and independent. Change-Id: If046ed41e25c70cc9abb45219b451f9179feaa1c Reviewed-by: Christian Strømme --- src/gui/opengl/qopenglshaderprogram.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/gui/opengl/qopenglshaderprogram.cpp') diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index 3c7bd4f90d3..153a5dd9ee5 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -3819,11 +3818,7 @@ bool QOpenGLShaderProgramPrivate::linkBinary() Q_Q(QOpenGLShaderProgram); - QCryptographicHash keyBuilder(QCryptographicHash::Sha1); - for (const QOpenGLProgramBinaryCache::ShaderDesc &shader : qAsConst(binaryProgram.shaders)) - keyBuilder.addData(shader.source); - - const QByteArray cacheKey = keyBuilder.result().toHex(); + const QByteArray cacheKey = binaryProgram.cacheKey(); if (DBG_SHADER_CACHE().isEnabled(QtDebugMsg)) qCDebug(DBG_SHADER_CACHE, "program with %d shaders, cache key %s", binaryProgram.shaders.count(), cacheKey.constData()); -- cgit v1.2.3