diff options
author | Nicolas Guichard <nicolas.guichard@kdab.com> | 2020-07-16 15:25:41 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-07-16 17:04:38 +0000 |
commit | 923c00c21a78dca999bf66ec3ea2888de9beee85 (patch) | |
tree | 71acd3af379062f6a01fb7a7fc173816bb9dcbb0 /tests | |
parent | a622e52d29146fe229928d398ebb50373279ae15 (diff) |
rhi: fix SubmissionContext::loadShader for Unicode files
QRegularExpression::match takes a QString and not a QByteArray, so
QRegularExpressionMatch::capturedStart is not reliable to locate bytes
in a QByteArray which might contain Unicode data.
This fixes the issue by explicitly working on QStrings.
Change-Id: Ia32ee169718d98e7197d7bfa19ca23e6e243dc25
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
(cherry picked from commit 13067bf7313e2e0e9c16e952bc97dd8854695967)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/rhi/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/manual/rhi/main.cpp b/tests/manual/rhi/main.cpp index f80ccc1c8..b5c89895c 100644 --- a/tests/manual/rhi/main.cpp +++ b/tests/manual/rhi/main.cpp @@ -98,6 +98,10 @@ static const constexpr auto vertex_shader = R"_(#version 450 +/** + * Unicode comment: Ѧ𝙱ƇᗞΣ + */ + layout(location = 0) in vec3 vertexPosition; layout(location = 1) in vec3 vertexColor; layout(location = 0) out vec3 color; @@ -136,6 +140,10 @@ void main() static const constexpr auto fragment_shader = R"_(#version 450 +/** + * Unicode comment: Ѧ𝙱ƇᗞΣ + */ + layout(location = 0) out vec4 fragColor; layout(location = 0) in vec3 color; |