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

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

Issue 2852923004: Remove NameMap from shader translator and shader/program managers (Closed)
Patch Set: split CL 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
Index: gpu/command_buffer/service/shader_manager_unittest.cc
diff --git a/gpu/command_buffer/service/shader_manager_unittest.cc b/gpu/command_buffer/service/shader_manager_unittest.cc
index 64b61852f02649519dd145b0b827de849cbefd1b..a9e8c4a45d5c476e1a99a336e1ab6b488883b358 100644
--- a/gpu/command_buffer/service/shader_manager_unittest.cc
+++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -196,7 +196,7 @@ TEST_F(ShaderManagerTest, DoCompile) {
kOutputVariable1StaticUse, kOutputVariable1Name));
TestHelper::SetShaderStates(
gl_.get(), shader1, true, &kLog, &kTranslatedSource, nullptr, &attrib_map,
- &uniform_map, &varying_map, nullptr, &output_variable_list, nullptr);
+ &uniform_map, &varying_map, nullptr, &output_variable_list);
EXPECT_TRUE(shader1->valid());
// When compilation succeeds, no log is recorded.
EXPECT_STREQ("", shader1->log_info().c_str());
@@ -214,6 +214,8 @@ TEST_F(ShaderManagerTest, DoCompile) {
EXPECT_EQ(it->second.precision, variable_info->precision);
EXPECT_EQ(it->second.staticUse, variable_info->staticUse);
EXPECT_STREQ(it->second.name.c_str(), variable_info->name.c_str());
+ EXPECT_STREQ(it->second.name.c_str(),
+ shader1->GetOriginalNameFromHashedName(it->first)->c_str());
}
// Check uniform infos got copied.
EXPECT_EQ(uniform_map.size(), shader1->uniform_map().size());
@@ -226,6 +228,8 @@ TEST_F(ShaderManagerTest, DoCompile) {
EXPECT_EQ(it->second.precision, variable_info->precision);
EXPECT_EQ(it->second.staticUse, variable_info->staticUse);
EXPECT_STREQ(it->second.name.c_str(), variable_info->name.c_str());
+ EXPECT_STREQ(it->second.name.c_str(),
+ shader1->GetOriginalNameFromHashedName(it->first)->c_str());
}
// Check varying infos got copied.
EXPECT_EQ(varying_map.size(), shader1->varying_map().size());
@@ -238,7 +242,10 @@ TEST_F(ShaderManagerTest, DoCompile) {
EXPECT_EQ(it->second.precision, variable_info->precision);
EXPECT_EQ(it->second.staticUse, variable_info->staticUse);
EXPECT_STREQ(it->second.name.c_str(), variable_info->name.c_str());
+ EXPECT_STREQ(it->second.name.c_str(),
+ shader1->GetOriginalNameFromHashedName(it->first)->c_str());
}
+ // TODO(kainino): Check interface block infos got copied.
Ken Russell (switch to Gerrit) 2017/05/03 22:52:48 What's the plan to address this TODO?
Kai Ninomiya 2017/05/03 23:02:34 I didn't have much of a plan except "not now becau
Ken Russell (switch to Gerrit) 2017/05/03 23:10:02 Could you please do this in a follow-on CL? It wil
// Check output variable infos got copied.
EXPECT_EQ(output_variable_list.size(),
shader1->output_variable_list().size());
@@ -252,13 +259,15 @@ TEST_F(ShaderManagerTest, DoCompile) {
EXPECT_EQ(it->precision, variable_info->precision);
EXPECT_EQ(it->staticUse, variable_info->staticUse);
EXPECT_STREQ(it->name.c_str(), variable_info->name.c_str());
+ EXPECT_STREQ(
+ it->name.c_str(),
+ shader1->GetOriginalNameFromHashedName(it->mappedName)->c_str());
}
// Compile failure case.
- TestHelper::SetShaderStates(gl_.get(), shader1, false, &kLog,
- &kTranslatedSource, nullptr, &attrib_map,
- &uniform_map, &varying_map, nullptr,
- &output_variable_list, nullptr);
+ TestHelper::SetShaderStates(
+ gl_.get(), shader1, false, &kLog, &kTranslatedSource, nullptr,
+ &attrib_map, &uniform_map, &varying_map, nullptr, &output_variable_list);
EXPECT_FALSE(shader1->valid());
EXPECT_STREQ(kLog.c_str(), shader1->log_info().c_str());
EXPECT_STREQ("", shader1->translated_source().c_str());

Powered by Google App Engine
This is Rietveld 408576698