Skip to content

Commit

Permalink
gpu: Update tests to match new translator naming.
Browse files Browse the repository at this point in the history
ANGLE 855d964 added a "_u" prefix to names coming out of the shader
translator.  Update tests to match.
Roll ANGLE e8ef2bc..855d964 at the same time because there is no way
to land these separately.

https://chromium.googlesource.com/angle/angle.git/+log/e8ef2bc..855d964

BUG=angleproject:2139

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I3742fa6c66f04c2cb80b3724cb0161e846ee026f
Reviewed-on: https://chromium-review.googlesource.com/646503
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499533}
  • Loading branch information
fjhenigman authored and Commit Bot committed Sep 5, 2017
1 parent 2a8cf48 commit c37b36c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling ANGLE
# and whatever else without interference from each other.
'angle_revision': 'e8ef2bc4bd019fd6080db5a1a5f0dd18bc0ccd25',
'angle_revision': '855d964bd0d05f6b2cb303f625506cf53d37e94f',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling build tools
# and whatever else without interference from each other.
Expand Down
14 changes: 8 additions & 6 deletions gpu/command_buffer/service/shader_translator_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ TEST_F(ShaderTranslatorTest, GetAttributes) {
// There should be one attribute with following characteristics:
// name:vPosition type:GL_FLOAT_VEC4 size:0.
EXPECT_EQ(1u, attrib_map.size());
AttributeMap::const_iterator iter = attrib_map.find("vPosition");
// The shader translator adds a "_u" prefix to user-defined names.
AttributeMap::const_iterator iter = attrib_map.find("_uvPosition");
EXPECT_TRUE(iter != attrib_map.end());
EXPECT_EQ(static_cast<GLenum>(GL_FLOAT_VEC4), iter->second.type);
EXPECT_EQ(0u, iter->second.arraySize);
Expand Down Expand Up @@ -289,20 +290,21 @@ TEST_F(ShaderTranslatorTest, GetUniforms) {
// 2. name:bar[1].foo.color[0] type:GL_FLOAT_VEC4 size:1
// However, there will be only one entry "bar" in the map.
EXPECT_EQ(1u, uniform_map.size());
UniformMap::const_iterator iter = uniform_map.find("bar");
// The shader translator adds a "_u" prefix to user-defined names.
UniformMap::const_iterator iter = uniform_map.find("_ubar");
EXPECT_TRUE(iter != uniform_map.end());
// First uniform.
const sh::ShaderVariable* info;
std::string original_name;
EXPECT_TRUE(iter->second.findInfoByMappedName(
"bar[0].foo.color[0]", &info, &original_name));
EXPECT_TRUE(iter->second.findInfoByMappedName("_ubar[0]._ufoo._ucolor[0]",
&info, &original_name));
EXPECT_EQ(static_cast<GLenum>(GL_FLOAT_VEC4), info->type);
EXPECT_EQ(1u, info->arraySize);
EXPECT_STREQ("color", info->name.c_str());
EXPECT_STREQ("bar[0].foo.color[0]", original_name.c_str());
// Second uniform.
EXPECT_TRUE(iter->second.findInfoByMappedName(
"bar[1].foo.color[0]", &info, &original_name));
EXPECT_TRUE(iter->second.findInfoByMappedName("_ubar[1]._ufoo._ucolor[0]",
&info, &original_name));
EXPECT_EQ(static_cast<GLenum>(GL_FLOAT_VEC4), info->type);
EXPECT_EQ(1u, info->arraySize);
EXPECT_STREQ("color", info->name.c_str());
Expand Down

0 comments on commit c37b36c

Please sign in to comment.