* commit 'db6a1358d45430a952aa746f8dfd452d12d7e4be': Log shader source when it fails to compile
This commit is contained in:
@@ -141,11 +141,12 @@ GLuint Program::buildShader(const char* source, GLenum type) {
|
|||||||
GLint status;
|
GLint status;
|
||||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
||||||
if (status != GL_TRUE) {
|
if (status != GL_TRUE) {
|
||||||
|
ALOGE("Error while compiling this shader:\n===\n%s\n===", source);
|
||||||
// Some drivers return wrong values for GL_INFO_LOG_LENGTH
|
// Some drivers return wrong values for GL_INFO_LOG_LENGTH
|
||||||
// use a fixed size instead
|
// use a fixed size instead
|
||||||
GLchar log[512];
|
GLchar log[512];
|
||||||
glGetShaderInfoLog(shader, sizeof(log), 0, &log[0]);
|
glGetShaderInfoLog(shader, sizeof(log), 0, &log[0]);
|
||||||
LOG_ALWAYS_FATAL("Error while compiling shader: %s", log);
|
LOG_ALWAYS_FATAL("Shader info log: %s", log);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user