summaryrefslogtreecommitdiffstats
path: root/src/render/graphicshelpers/graphicshelpergl3_3.cpp
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@qt.io>2017-11-17 11:32:23 +0100
committerAndy Nichols <andy.nichols@qt.io>2017-11-17 11:41:20 +0100
commita951564557c91fdbb6974c089eec374d51011ad1 (patch)
treed885c370a563bc0490770811be32af3809d90e95 /src/render/graphicshelpers/graphicshelpergl3_3.cpp
parent91ac8d0264a3777a9d61f704001d032747e25c9f (diff)
parente3e9372a353b641580f15dbbc09a488b8cb26d64 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Diffstat (limited to 'src/render/graphicshelpers/graphicshelpergl3_3.cpp')
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3_3.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/render/graphicshelpers/graphicshelpergl3_3.cpp b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
index 40f8076bb..40c2bafeb 100644
--- a/src/render/graphicshelpers/graphicshelpergl3_3.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
@@ -206,6 +206,9 @@ QVector<ShaderUniform> GraphicsHelperGL3_3::programUniformsAndLocations(GLuint p
uniformName[sizeof(uniformName) - 1] = '\0';
uniform.m_location = m_funcs->glGetUniformLocation(programId, uniformName);
uniform.m_name = QString::fromUtf8(uniformName, uniformNameLength);
+ // Work around for uniform array names that aren't returned with [0] by some drivers
+ if (uniform.m_size > 1 && !uniform.m_name.endsWith(QLatin1String("[0]")))
+ uniform.m_name.append(QLatin1String("[0]"));
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_BLOCK_INDEX, &uniform.m_blockIndex);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_OFFSET, &uniform.m_offset);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_ARRAY_STRIDE, &uniform.m_arrayStride);