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

Unified Diff: cc/output/program_binding.cc

Issue 2712033004: cc: Always log shader compiler errors (Closed)
Patch Set: Fix compile Created 3 years, 10 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 a8f4b6a9f6c29df4964dca45e7f07516020cff13..8402e824492a93672d349fae0623380441c8c499 100644
--- a/cc/output/program_binding.cc
+++ b/cc/output/program_binding.cc
@@ -177,21 +177,24 @@ bool ProgramBindingBase::Init(GLES2Interface* context,
return !!program_;
}
-bool ProgramBindingBase::Link(GLES2Interface* context) {
+bool ProgramBindingBase::Link(GLES2Interface* context,
+ const std::string& vertex_source,
+ const std::string& fragment_source) {
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);
- DLOG(ERROR) << "Error compiling shader: " << buffer;
+ LOG(ERROR) << "Error linking shader: " << buffer << "\n"
+ << "Vertex shader:\n"
+ << vertex_source << "Fragment shader:\n"
+ << fragment_source;
return false;
}
-#endif
return true;
}
@@ -221,17 +224,16 @@ unsigned ProgramBindingBase::LoadShader(GLES2Interface* context,
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);
- DLOG(ERROR) << "Error compiling shader: " << buffer
- << "\n shader program: " << shader_source;
+ LOG(ERROR) << "Error compiling shader: " << buffer << "\n"
+ << "Shader program:\n"
+ << 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