diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-26 11:26:51 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-26 17:02:39 +0200 |
commit | 0628932fef349d217c0a50a192e7ee6a955994b7 (patch) | |
tree | 63645ca4ffa1598b03f9d79b152424ef88dd32bb /src/gui/opengl/qopenglshaderprogram.cpp | |
parent | c06627a230ea758c64ac70a9962a69c843fd0e08 (diff) |
Move cache key calculation to QOpenGLProgramBinaryCache
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 <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/opengl/qopenglshaderprogram.cpp')
-rw-r--r-- | src/gui/opengl/qopenglshaderprogram.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index 3c7bd4f90d..153a5dd9ee 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -47,7 +47,6 @@ #include <QtCore/qvarlengtharray.h> #include <QtCore/qvector.h> #include <QtCore/qloggingcategory.h> -#include <QtCore/qcryptographichash.h> #include <QtCore/qcoreapplication.h> #include <QtGui/qtransform.h> #include <QtGui/QColor> @@ -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()); |