summaryrefslogtreecommitdiffstats
path: root/src/render/graphicshelpers/graphicshelpergl3_3.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-11-18 17:30:58 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-11-18 17:30:58 +0000
commit5e94e34c5b9567980929e677357467806aacaf1a (patch)
treed5b3d6fd82fba5f3a3241ee4a261ab53587fd9d2 /src/render/graphicshelpers/graphicshelpergl3_3.cpp
parentb58719b2222fd3b3527758aaf482b1635af7857c (diff)
parenta951564557c91fdbb6974c089eec374d51011ad1 (diff)
Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/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);