From dee33e19bef4e27d6196db0ddf3e595aaff0590d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Sat, 3 Mar 2018 17:17:25 +0200 Subject: [PATCH] libgui|GL: Cleanup --- doomsday/libs/gui/src/graphics/glprogram.cpp | 8 +++++++- doomsday/libs/gui/src/graphics/glshader.cpp | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doomsday/libs/gui/src/graphics/glprogram.cpp b/doomsday/libs/gui/src/graphics/glprogram.cpp index 6a7949bf11..996900c874 100644 --- a/doomsday/libs/gui/src/graphics/glprogram.cpp +++ b/doomsday/libs/gui/src/graphics/glprogram.cpp @@ -221,15 +221,21 @@ DENG2_PIMPL(GLProgram) if (texturesChanged) { + auto &GL = LIBGUI_GL; // Update the sampler uniforms. for (int unit = 0; unit < textures.size(); ++unit) { int loc = self().glUniformLocation(textures[unit]->name()); if (loc >= 0) { - LIBGUI_GL.glUniform1i(loc, unit); +// qDebug() << "[GLProgram] texture" << textures[unit]->name() << loc << unit; + GL.glUniform1i(loc, unit); LIBGUI_ASSERT_GL_OK(); } +// else +// { +// qDebug() << "[GLProgram] texture" << textures[unit]->name() << "no location!"; +// } } texturesChanged = false; } diff --git a/doomsday/libs/gui/src/graphics/glshader.cpp b/doomsday/libs/gui/src/graphics/glshader.cpp index 33d7dc255a..2237c1a365 100644 --- a/doomsday/libs/gui/src/graphics/glshader.cpp +++ b/doomsday/libs/gui/src/graphics/glshader.cpp @@ -222,7 +222,8 @@ void GLShader::compile(Type shaderType, IByteArray const &shaderSource) LIBGUI_GL.glGetShaderInfoLog(d->name, logSize, &count, reinterpret_cast(log.data())); throw CompilerError("GLShader::compile", - "Compilation of " + String(d->type == Fragment? "fragment" : "vertex") + + "Compilation of " + String(d->type == Fragment? "fragment" : + d->type == Geometry? "geometry" : "vertex") + " shader failed:\n" + log); }