opengl/glshader: print the shader source if compilation fails
The shader log is almost entirely useless without the source CCBUG: 479279
This commit is contained in:
parent
d4a3d6689e
commit
427ce522a2
1 changed files with 5 additions and 0 deletions
|
@ -133,6 +133,11 @@ bool GLShader::compile(GLuint program, GLenum shaderType, const QByteArray &sour
|
|||
qCCritical(KWIN_OPENGL) << "Failed to compile" << typeName << "shader:"
|
||||
<< "\n"
|
||||
<< log;
|
||||
size_t line = 0;
|
||||
const auto split = source.split('\n');
|
||||
for (const auto &l : split) {
|
||||
qCCritical(KWIN_OPENGL).nospace() << "line " << line++ << ":" << l;
|
||||
}
|
||||
} else if (length > 0) {
|
||||
qCDebug(KWIN_OPENGL) << "Shader compile log:" << log;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue