summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Albamont <jim.albamont@kdab.com>2020-12-09 14:21:23 -0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-10 07:47:17 +0000
commite6527586835344d579d1cc08017d6d52ed5655df (patch)
tree8cb5cddcddc0f40455de4d45058c9b02ce93758c /src
parent0f96aa009a6b70e0b79491930fbbd4d3626136b4 (diff)
Fix disabling shader cache via environment variable
The tests were a broken too because the QT3D_DISABLE_SHADER_CACHE environment var was still set from the previous test. These tests passed before because the shader builder used the cache if either the QT3D_DISABLE_SHADER_CACHE or QT3D_REBUILD_SHADER_CACHE are not set. Change-Id: Ic04bf3bb8bb7b9b27e3dc9663fe5e96647a3bed4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit fd5c3299553818e99421f54c1b819681335de9aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/render/materialsystem/shaderbuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/materialsystem/shaderbuilder.cpp b/src/render/materialsystem/shaderbuilder.cpp
index 7837c7b75..04cb1bb5c 100644
--- a/src/render/materialsystem/shaderbuilder.cpp
+++ b/src/render/materialsystem/shaderbuilder.cpp
@@ -235,7 +235,7 @@ void ShaderBuilder::generateCode(QShaderProgram::ShaderType type)
const QByteArray cacheKey = hashKeyForShaderGraph(type);
const bool forceRegenerate = qEnvironmentVariableIsSet("QT3D_REBUILD_SHADER_CACHE");
- const bool useCache = !qEnvironmentVariableIsSet("QT3D_DISABLE_SHADER_CACHE") || !forceRegenerate;
+ const bool useCache = !qEnvironmentVariableIsSet("QT3D_DISABLE_SHADER_CACHE") && !forceRegenerate;
const QByteArray userProvidedPath = qgetenv("QT3D_WRITABLE_CACHE_PATH");
const QString cachedFilterPath = QDir(userProvidedPath.isEmpty() ?
QStandardPaths::writableLocation(QStandardPaths::TempLocation)