summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2016-03-06 23:54:52 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2016-03-07 00:20:59 +0100
commited51d4293dd919a03edca11ec48c607bbfa31076 (patch)
treeeefc3d0a51826fc6749c487b51a1b5abad713bd3 /vcl/source/opengl
parent729572957402e43d055482b51080034109b16ec6 (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
Diffstat (limited to 'vcl/source/opengl')
-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 aae3cc2d31cd..47fe8feeb762 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -157,8 +157,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;
}