Hi, when I am debugging the GLSL shaders, I am getting some strange assertions from the above function. I was surprised that the GLSL shaders created by HlmsPbs and HlmsUnlit are not hitting those assertions and narrow the behavior to this line:
Code: Select all
layout(std140) uniform;
The implementation in GLSLProgram::extractLayoutQualifiers() parses this line and then aborts the parsing:
Code: Select all
StringVector parts = StringUtil::split( line, " " );
if( parts.size() < 3 )
{
// This is a malformed attribute.
// It should contain 3 parts, i.e. "attribute vec4 vertex".
break;
}
In my shaders I didn't write this statement "layout(std140) uniform" and hence it tried to continue the parsing. The first assertion it hits with the following line:
Code: Select all
layout(binding = 0, std430) readonly buffer worldMatricesBuf
Is this function still needed? For HlmsPbs and HlmsUnlit it does nothing. The behavior strongly depends on the way how the shader is written - even if there is a line "// layout(std140) uniform" (so commented out), the method aborts. Splitting the line using spaces is also strange as the spaces are not required by GLSL at some places - like "layout(binding=0)" is same as "layout ( binding = 0 )" and the behavior of the mentioned function is strongly influenced.