diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-11-28 20:28:01 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-11-28 20:28:01 (GMT) |
commit | 2fd00b200e5e1b13effdf8773386230891127dbe (patch) | |
tree | ac9ee7c295132aa971358d5d961a9e9cd8ecc76e /src | |
parent | 66611fb5c9641dad2c605be790028d206480ea24 (diff) | |
download | Qt-2fd00b200e5e1b13effdf8773386230891127dbe.zip Qt-2fd00b200e5e1b13effdf8773386230891127dbe.tar.gz Qt-2fd00b200e5e1b13effdf8773386230891127dbe.tar.bz2 |
print out which GLSL shader that failed compilation for better debugging
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qglshaderprogram.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 74382b0..1f39884 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -260,10 +260,27 @@ bool QGLShaderPrivate::compile(QGLShader *q) glGetShaderInfoLog(shader, value, &len, logbuf); log = QString::fromLatin1(logbuf); QString name = q->objectName(); + + char *types[] = { + "Fragment", + "Vertex", + "Geometry", + "" + }; + + char *type = types[3]; + if (shaderType == QGLShader::Fragment) + type = types[0]; + else if (shaderType == QGLShader::Vertex) + type = types[1]; + else if (shaderType == QGLShader::Geometry) + type = types[2]; + if (name.isEmpty()) - qWarning() << "QGLShader::compile:" << log; + qWarning("QGLShader::compile(%s): %s", type, qPrintable(log)); else - qWarning() << "QGLShader::compile[" << name << "]:" << log; + qWarning("QGLShader::compile(%s)[%s]: %s", type, qPrintable(name), qPrintable(log)); + delete [] logbuf; } return compiled; |