diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2014-12-11 20:00:28 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-12-14 09:59:12 +0100 |
commit | 0d49ebdf30ed8a4f5d88dae71ef3042e89100303 (patch) | |
tree | 8eb7aabcc2f291ff4929ad88678d3d2e58678e8e /src/gui/opengl/qopenglshaderprogram.cpp | |
parent | a69b2c01684756c959de7645451f02397ca19b51 (diff) |
GLSL #version directive does not have to be at start of line
The #version directive detector of QOpenGLShaderProgram is using an
incorrect regular expression to detect the #version directive in the
preprocessed shader source code.
It is allowed to have whitespace before the #version.
Task-number: QTBUG-43240
Change-Id: If60670f49cb40148e5e7fbe6da6c798e8f636c3d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/gui/opengl/qopenglshaderprogram.cpp')
-rw-r--r-- | src/gui/opengl/qopenglshaderprogram.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index d64847510b..7d165aed48 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -481,7 +481,7 @@ static QVersionDirectivePosition findVersionDirectivePosition(const char *source int splitPosition = 0; int linePosition = 1; - static const QRegularExpression pattern(QStringLiteral("^#\\s*version.*(\\n)?"), + static const QRegularExpression pattern(QStringLiteral("^\\s*#\\s*version.*(\\n)?"), QRegularExpression::MultilineOption | QRegularExpression::OptimizeOnFirstUsageOption); QRegularExpressionMatch match = pattern.match(working); |