Commit b4150db9 authored by gman@chromium.org's avatar gman@chromium.org

Add logging for shaders that don't compile

BUG=139409


Review URL: https://chromiumcodereview.appspot.com/10824120

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149355 0039d316-1c4b-4281-b951-d872f2087c98
parent 10053295
......@@ -454,8 +454,6 @@ void ProgramManager::ForceCompileShader(const std::string* source,
// We cannot reach here if we are using the shader translator.
// All invalid shaders must be rejected by the translator.
// All translated shaders must compile.
LOG_IF(ERROR, translator)
<< "Shader translator allowed/produced an invalid shader.";
GLint max_len = 0;
glGetShaderiv(info->service_id(), GL_INFO_LOG_LENGTH, &max_len);
scoped_array<char> temp(new char[max_len]);
......@@ -464,6 +462,12 @@ void ProgramManager::ForceCompileShader(const std::string* source,
DCHECK(max_len == 0 || len < max_len);
DCHECK(len == 0 || temp[len] == '\0');
info->SetStatus(false, std::string(temp.get(), len).c_str(), NULL);
LOG_IF(ERROR, translator)
<< "Shader translator allowed/produced an invalid shader "
<< "unless the driver is buggy:"
<< "\n--original-shader--\n" << (source ? *source : "")
<< "\n--translated-shader--\n" << shader_src
<< "\n--info-log--\n" << *info->log_info();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment