rhi: QRhiGLes2::gatherUniforms fix gathering in struct

In the case we don't have an array of structs, structPrefix needs to be
suffixed with a dot to get the proper uniform names.

Change-Id: I50ed54c2f7c3cc4556ed1854419bc4fe3a2989f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Paul Lemire 2020-07-30 10:57:00 +02:00
parent c19bafc60c
commit c95fc0f662
1 changed files with 2 additions and 1 deletions

View File

@ -3459,7 +3459,8 @@ void QRhiGles2::gatherUniforms(GLuint program,
const int baseOffset = blockMember.offset;
if (blockMember.arrayDims.isEmpty()) {
for (const QShaderDescription::BlockVariable &structMember : blockMember.structMembers)
registerUniformIfActive(structMember, structPrefix, ub.binding, baseOffset, program, dst);
registerUniformIfActive(structMember, structPrefix + ".", ub.binding,
baseOffset, program, dst);
} else {
if (blockMember.arrayDims.count() > 1) {
qWarning("Array of struct '%s' has more than one dimension. Only the first "