Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: cc/output/program_binding.cc

Issue 2799743005: Revert of cc: Always log shader compiler errors (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/program_binding.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/program_binding.cc
diff --git a/cc/output/program_binding.cc b/cc/output/program_binding.cc
index 8402e824492a93672d349fae0623380441c8c499..a8f4b6a9f6c29df4964dca45e7f07516020cff13 100644
--- a/cc/output/program_binding.cc
+++ b/cc/output/program_binding.cc
@@ -177,24 +177,21 @@
return !!program_;
}
-bool ProgramBindingBase::Link(GLES2Interface* context,
- const std::string& vertex_source,
- const std::string& fragment_source) {
+bool ProgramBindingBase::Link(GLES2Interface* context) {
context->LinkProgram(program_);
CleanupShaders(context);
if (!program_)
return false;
+#ifndef NDEBUG
int linked = 0;
context->GetProgramiv(program_, GL_LINK_STATUS, &linked);
if (!linked) {
char buffer[1024] = "";
context->GetProgramInfoLog(program_, sizeof(buffer), nullptr, buffer);
- LOG(ERROR) << "Error linking shader: " << buffer << "\n"
- << "Vertex shader:\n"
- << vertex_source << "Fragment shader:\n"
- << fragment_source;
- return false;
- }
+ DLOG(ERROR) << "Error compiling shader: " << buffer;
+ return false;
+ }
+#endif
return true;
}
@@ -224,16 +221,17 @@
shader_source_str,
shader_length);
context->CompileShader(shader);
+#if DCHECK_IS_ON()
int compiled = 0;
context->GetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
if (!compiled) {
char buffer[1024] = "";
context->GetShaderInfoLog(shader, sizeof(buffer), nullptr, buffer);
- LOG(ERROR) << "Error compiling shader: " << buffer << "\n"
- << "Shader program:\n"
- << shader_source;
+ DLOG(ERROR) << "Error compiling shader: " << buffer
+ << "\n shader program: " << shader_source;
return 0u;
}
+#endif
return shader;
}
« no previous file with comments | « cc/output/program_binding.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698