Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd15f475 authored by Rob Tsuk's avatar Rob Tsuk
Browse files

Log shader source when it fails to compile

So that there will be something to diagnose when such failures occur during
stability tests.

Bug: 18092655
Change-Id: I9a9d8d33b34273a477f2a9dbcf092887dcbc91c0
parent 9af44ddf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -141,11 +141,12 @@ GLuint Program::buildShader(const char* source, GLenum type) {
    GLint status;
    glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
    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
        // use a fixed size instead
        GLchar log[512];
        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;
    }