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

Unified Diff: gpu/command_buffer/service/shader_manager.cc

Issue 2857083002: Fix behavior of GetOriginalNameFromHashedName (Closed)
Patch Set: remove GetMappedName 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 | « gpu/command_buffer/service/shader_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7db7dd4e465de7568817e8d26885445d3eec7b22 100644
--- a/gpu/command_buffer/service/shader_manager.cc
+++ b/gpu/command_buffer/service/shader_manager.cc
@@ -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 {
« no previous file with comments | « gpu/command_buffer/service/shader_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698