From fd15f475541a4d13293374f18204cb1b3e010582 Mon Sep 17 00:00:00 2001 From: Rob Tsuk Date: Wed, 5 Nov 2014 13:26:19 -0800 Subject: 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 --- libs/hwui/Program.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libs/hwui/Program.cpp') diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index cc72ae098b0f..0dad0dcae641 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -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; } -- cgit v1.2.3-59-g8ed1b