summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2016-03-06 23:54:52 +0100
committerDavid Tardon <dtardon@redhat.com>2016-04-05 06:46:17 +0000
commit3c02e65e4f0724225adf7cc85dc0e492ba048182 (patch)
treee234c61d03ecef4b2ffae17d7ee877372da408ba /vcl
parent9baa30bcabb7259c3497db6fa774de2a588ae017 (diff)
opengl: fix loading shader with preamble that uses #version
The preamble was inserted into a false position so the shader could was constructed incorrectly and would fail to compile. Change-Id: I4c51adde9014a326bbe38a5d2d17dd0047e33195 Reviewed-on: https://gerrit.libreoffice.org/23463 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 00341d47ce00..8418706c3784 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -156,8 +156,8 @@ static void addPreamble(OString& rShaderSource, const OString& rPreamble)
if (nVersionStrEndPos == -1)
nVersionStrEndPos = nVersionStrStartPos + 8;
- OString aVersionLine = rShaderSource.copy(0, nVersionStrEndPos - nVersionStrStartPos);
- OString aShaderBody = rShaderSource.copy(nVersionStrEndPos - nVersionStrStartPos);
+ OString aVersionLine = rShaderSource.copy(0, nVersionStrEndPos);
+ OString aShaderBody = rShaderSource.copy(nVersionStrEndPos + 1);
rShaderSource = aVersionLine + "\n" + rPreamble + "\n" + aShaderBody;
}