Index: gpu/command_buffer/service/shader_manager.cc |
diff --git a/gpu/command_buffer/service/shader_manager.cc b/gpu/command_buffer/service/shader_manager.cc |
index 38f371764a71905d1f306c6c9268c6e32927b877..8a77b519998ba6835bbf196fb134a8e6705384d0 100644 |
--- a/gpu/command_buffer/service/shader_manager.cc |
+++ b/gpu/command_buffer/service/shader_manager.cc |
@@ -75,7 +75,7 @@ void Shader::DoCompile() { |
bool success = translator->Translate( |
last_compiled_source_, &log_info_, &translated_source_, |
&shader_version_, &attrib_map_, &uniform_map_, &varying_map_, |
- &interface_block_map_, &output_variable_list_, &name_map_); |
+ &interface_block_map_, &output_variable_list_); |
if (!success) { |
return; |
} |
@@ -224,19 +224,22 @@ const std::string* Shader::GetOutputVariableMappedName( |
const std::string* Shader::GetOriginalNameFromHashedName( |
const std::string& hashed_name) const { |
- NameMap::const_iterator it = name_map_.find(hashed_name); |
- if (it != name_map_.end()) |
- return &(it->second); |
- return NULL; |
-} |
- |
-const std::string* Shader::GetMappedName( |
- const std::string& original_name) const { |
- for (const auto& key_value : name_map_) { |
- if (key_value.second == original_name) |
- return &(key_value.first); |
+ if (const auto* info = GetAttribInfo(hashed_name)) { |
+ return &info->name; |
} |
- return NULL; |
+ if (const auto* info = GetUniformInfo(hashed_name)) { |
+ return &info->name; |
+ } |
+ if (const auto* info = GetVaryingInfo(hashed_name)) { |
+ return &info->name; |
+ } |
+ if (const auto* info = GetInterfaceBlockInfo(hashed_name)) { |
+ return &info->name; |
+ } |
+ if (const auto* info = GetOutputVariableInfo(hashed_name)) { |
+ return &info->name; |
+ } |
+ return nullptr; |
} |
const sh::Uniform* Shader::GetUniformInfo(const std::string& name) const { |