diff --git a/doomsday/libs/gui/src/graphics/glshader.cpp b/doomsday/libs/gui/src/graphics/glshader.cpp index fe8050979f..477ab2525b 100644 --- a/doomsday/libs/gui/src/graphics/glshader.cpp +++ b/doomsday/libs/gui/src/graphics/glshader.cpp @@ -43,7 +43,7 @@ DENG2_PIMPL(GLShader) { if (!name) { - name = LIBGUI_GL.glCreateShader(type == Vertex ? GL_VERTEX_SHADER + name = LIBGUI_GL.glCreateShader(type == Vertex ? GL_VERTEX_SHADER : type == Geometry ? GL_GEOMETRY_SHADER : GL_FRAGMENT_SHADER); LIBGUI_ASSERT_GL_OK(); @@ -221,6 +221,17 @@ void GLShader::compile(Type shaderType, IByteArray const &shaderSource) Block log{Block::Size(logSize)}; LIBGUI_GL.glGetShaderInfoLog(d->name, logSize, &count, reinterpret_cast(log.data())); +#if defined (DENG2_DEBUG) + { + QTextStream ins(src); + int lineNum = 1; + while (!ins.atEnd()) + { + qDebug("%4i: %s", lineNum++, ins.readLine().toLatin1().constData()); + } + } +#endif + throw CompilerError("GLShader::compile", "Compilation of " + String(d->type == Fragment? "fragment" : d->type == Geometry? "geometry" : diff --git a/doomsday/libs/gui/src/graphics/glshaderbank.cpp b/doomsday/libs/gui/src/graphics/glshaderbank.cpp index 5783e612a4..129f50234e 100644 --- a/doomsday/libs/gui/src/graphics/glshaderbank.cpp +++ b/doomsday/libs/gui/src/graphics/glshaderbank.cpp @@ -33,6 +33,11 @@ namespace de { +//static int countLines(String const &text) +//{ +// return text.count(QChar('\n')); +//} + static String processIncludes(String source, String const &sourceFolderPath) { QRegularExpression const re("#include\\s+['\"]([^\"']+)['\"]"); @@ -46,7 +51,8 @@ static String processIncludes(String source, String const &sourceFolderPath) incSource = processIncludes(incSource, incFilePath.fileNamePath()); Rangei const capRange(found.capturedStart(), found.capturedEnd()); - source = source.substr(0, capRange.start) + String const prefix = source.substr(0, capRange.start); + source = prefix //+ String::format("#line %i\n", countLines(prefix)) + incSource + source.substr(capRange.end); } diff --git a/doomsday/libs/gui/src/graphics/modeldrawable.cpp b/doomsday/libs/gui/src/graphics/modeldrawable.cpp index 11645c31a8..4f0812ddf8 100644 --- a/doomsday/libs/gui/src/graphics/modeldrawable.cpp +++ b/doomsday/libs/gui/src/graphics/modeldrawable.cpp @@ -1685,6 +1685,15 @@ void ModelDrawable::drawInstanced(GLBuffer const &instanceAttribs, { d->drawInstanced(instanceAttribs, animation); } +#if defined (DENG2_DEBUG) + else + { + qDebug() << "[ModelDrawable] drawInstanced isReady:" + << isReady() + << "program:" << d->program + << "atlas:" << d->glData.textureBank.atlas(); + } +#endif } ModelDrawable::Pass const *ModelDrawable::currentPass() const