OpenGL: Log shader compilation failure

This commit is contained in:
Jeffrey Pfau 2016-03-06 18:36:36 -08:00
parent 9d0865d5d4
commit be2641c77b
2 changed files with 8 additions and 3 deletions

View File

@ -27,6 +27,7 @@ Misc:
- Qt: Remove use of NaN
- 3DS: Use blip_add_delta_fast for a small speed improvement
- FFmpeg: Update dependencies on Ubuntu
- OpenGL: Log shader compilation failure
0.4.0: (2016-02-02)
Features:

View File

@ -5,11 +5,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gles2.h"
#include "core/log.h"
#include "util/configuration.h"
#include "util/formatting.h"
#include "util/vector.h"
#include "util/vfs.h"
mLOG_DECLARE_CATEGORY(OPENGL);
mLOG_DEFINE_CATEGORY(OPENGL, "OpenGL");
#define MAX_PASSES 8
static const GLchar* const _gles2Header =
@ -381,17 +385,17 @@ void mGLES2ShaderInit(struct mGLES2Shader* shader, const char* vs, const char* f
glCompileShader(shader->fragmentShader);
glGetShaderInfoLog(shader->fragmentShader, 1024, 0, log);
if (log[0]) {
printf("%s\n", log);
mLOG(OPENGL, ERROR, "%s\n", log);
}
glCompileShader(shader->vertexShader);
glGetShaderInfoLog(shader->vertexShader, 1024, 0, log);
if (log[0]) {
printf("%s\n", log);
mLOG(OPENGL, ERROR, "%s\n", log);
}
glLinkProgram(shader->program);
glGetProgramInfoLog(shader->program, 1024, 0, log);
if (log[0]) {
printf("%s\n", log);
mLOG(OPENGL, ERROR, "%s\n", log);
}
shader->texLocation = glGetUniformLocation(shader->program, "tex");