summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglprogrambinarycache.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <[email protected]>2019-09-28 01:00:51 +0200
committerQt Forward Merge Bot <[email protected]>2019-09-28 01:01:03 +0200
commitfbda189e081e6c7abf82334c0ac71b16ec2c37dd (patch)
tree92bdcfeb6c32de9c90ea126714907afa18ef44f1 /src/gui/opengl/qopenglprogrambinarycache.cpp
parentd12bf4eb8353f33499cbec4e105431668dbe8c88 (diff)
parente8d7df4cb2586ba5098fb4f476807ba7992d9cea (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
Diffstat (limited to 'src/gui/opengl/qopenglprogrambinarycache.cpp')
-rw-r--r--src/gui/opengl/qopenglprogrambinarycache.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp
index 54160e1240e..14954714572 100644
--- a/src/gui/opengl/qopenglprogrambinarycache.cpp
+++ b/src/gui/opengl/qopenglprogrambinarycache.cpp
@@ -45,6 +45,7 @@
#include <QDir>
#include <QSaveFile>
#include <QLoggingCategory>
+#include <QCryptographicHash>
#ifdef Q_OS_UNIX
#include <sys/mman.h>
@@ -94,6 +95,15 @@ GLEnvInfo::GLEnvInfo()
glversion = QByteArray(version);
}
+QByteArray QOpenGLProgramBinaryCache::ProgramDesc::cacheKey() const
+{
+ QCryptographicHash keyBuilder(QCryptographicHash::Sha1);
+ for (const QOpenGLProgramBinaryCache::ShaderDesc &shader : shaders)
+ keyBuilder.addData(shader.source);
+
+ return keyBuilder.result().toHex();
+}
+
static inline bool qt_ensureWritableDir(const QString &name)
{
QDir::root().mkpath(name);