| Index: gpu/command_buffer/service/program_manager.cc
|
| diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
|
| index 9f1d10d64a2fc6e6214aa06363da7db3f7b93d36..0324d34c6026993c0981b290e70c34b66d7d86b3 100644
|
| --- a/gpu/command_buffer/service/program_manager.cc
|
| +++ b/gpu/command_buffer/service/program_manager.cc
|
| @@ -180,7 +180,7 @@ std::string Program::ProcessLogInfo(
|
| std::string prior_log;
|
| std::string hashed_name;
|
| while (RE2::Consume(&input,
|
| - "(.*)(webgl_[0123456789abcdefABCDEF]+)",
|
| + "(.*?)(webgl_[0123456789abcdefABCDEF]+)",
|
| &prior_log,
|
| &hashed_name)) {
|
| output += prior_log;
|
| @@ -533,18 +533,24 @@ bool Program::Link(ShaderManager* manager,
|
| set_log_info("glBindAttribLocation() conflicts");
|
| return false;
|
| }
|
| - if (DetectUniformsMismatch()) {
|
| - set_log_info("Uniforms with the same name but different type/precision");
|
| + std::string conflicting_name;
|
| + if (DetectUniformsMismatch(conflicting_name)) {
|
| + std::string info_log = "Uniforms with the same name but different "
|
| + "type/precision: " + conflicting_name;
|
| + set_log_info(ProcessLogInfo(info_log).c_str());
|
| return false;
|
| }
|
| - if (DetectVaryingsMismatch()) {
|
| - set_log_info("Varyings with the same name but different type, "
|
| - "or statically used varyings in fragment shader are not "
|
| - "declared in vertex shader");
|
| + if (DetectVaryingsMismatch(conflicting_name)) {
|
| + std::string info_log = "Varyings with the same name but different type, "
|
| + "or statically used varyings in fragment shader are "
|
| + "not declared in vertex shader: " + conflicting_name;
|
| + set_log_info(ProcessLogInfo(info_log).c_str());
|
| return false;
|
| }
|
| - if (DetectGlobalNameConflicts()) {
|
| - set_log_info("Name conflicts between an uniform and an attribute");
|
| + if (DetectGlobalNameConflicts(conflicting_name)) {
|
| + std::string info_log = "Name conflicts between an uniform and an "
|
| + "attribute: " + conflicting_name;
|
| + set_log_info(ProcessLogInfo(info_log).c_str());
|
| return false;
|
| }
|
| if (!CheckVaryingsPacking()) {
|
| @@ -1005,7 +1011,7 @@ bool Program::DetectAttribLocationBindingConflicts() const {
|
| return false;
|
| }
|
|
|
| -bool Program::DetectUniformsMismatch() const {
|
| +bool Program::DetectUniformsMismatch(std::string& conflicting_name) const {
|
| typedef std::map<std::string, UniformType> UniformMap;
|
| UniformMap uniform_map;
|
| for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
|
| @@ -1024,6 +1030,7 @@ bool Program::DetectUniformsMismatch() const {
|
| // declared by other shader, then the type and precision must match.
|
| if (map_entry->second == type)
|
| continue;
|
| + conflicting_name = name;
|
| return true;
|
| }
|
| }
|
| @@ -1031,7 +1038,7 @@ bool Program::DetectUniformsMismatch() const {
|
| return false;
|
| }
|
|
|
| -bool Program::DetectVaryingsMismatch() const {
|
| +bool Program::DetectVaryingsMismatch(std::string& conflicting_name) const {
|
| DCHECK(attached_shaders_[0] &&
|
| attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
|
| attached_shaders_[1] &&
|
| @@ -1051,20 +1058,24 @@ bool Program::DetectVaryingsMismatch() const {
|
| ShaderTranslator::VariableMap::const_iterator hit =
|
| vertex_varyings->find(name);
|
| if (hit == vertex_varyings->end()) {
|
| - if (iter->second.static_use)
|
| + if (iter->second.static_use) {
|
| + conflicting_name = name;
|
| return true;
|
| + }
|
| continue;
|
| }
|
|
|
| if (hit->second.type != iter->second.type ||
|
| - hit->second.size != iter->second.size)
|
| + hit->second.size != iter->second.size) {
|
| + conflicting_name = name;
|
| return true;
|
| + }
|
|
|
| }
|
| return false;
|
| }
|
|
|
| -bool Program::DetectGlobalNameConflicts() const {
|
| +bool Program::DetectGlobalNameConflicts(std::string& conflicting_name) const {
|
| DCHECK(attached_shaders_[0] &&
|
| attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
|
| attached_shaders_[1] &&
|
| @@ -1078,8 +1089,10 @@ bool Program::DetectGlobalNameConflicts() const {
|
| for (ShaderTranslator::VariableMap::const_iterator iter =
|
| attribs->begin(); iter != attribs->end(); ++iter) {
|
| for (int ii = 0; ii < 2; ++ii) {
|
| - if (uniforms[ii]->find(iter->first) != uniforms[ii]->end())
|
| + if (uniforms[ii]->find(iter->first) != uniforms[ii]->end()) {
|
| + conflicting_name = iter->first;
|
| return true;
|
| + }
|
| }
|
| }
|
| return false;
|
|
|