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

Side by Side Diff: gpu/command_buffer/service/shader_translator_unittest.cc

Issue 660123002: Detect built-in varyings' invariant setting conflicts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 6
7 #include "gpu/command_buffer/service/shader_translator.h" 7 #include "gpu/command_buffer/service/shader_translator.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace gpu { 10 namespace gpu {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 &info_log, 62 &info_log,
63 &translated_source, 63 &translated_source,
64 &attrib_map, 64 &attrib_map,
65 &uniform_map, 65 &uniform_map,
66 &varying_map, 66 &varying_map,
67 &name_map)); 67 &name_map));
68 // Info log must be NULL. 68 // Info log must be NULL.
69 EXPECT_TRUE(info_log.empty()); 69 EXPECT_TRUE(info_log.empty());
70 // Translated shader must be valid and non-empty. 70 // Translated shader must be valid and non-empty.
71 ASSERT_FALSE(translated_source.empty()); 71 ASSERT_FALSE(translated_source.empty());
72 // There should be no attributes, uniforms, varyings. 72 // There should be no attributes, uniforms, and only one built-in
73 // varying: gl_Position.
73 EXPECT_TRUE(attrib_map.empty()); 74 EXPECT_TRUE(attrib_map.empty());
74 EXPECT_TRUE(uniform_map.empty()); 75 EXPECT_TRUE(uniform_map.empty());
75 EXPECT_TRUE(varying_map.empty()); 76 EXPECT_EQ(1u, varying_map.size());
76 // There should be no name mapping. 77 // There should be no name mapping.
77 EXPECT_TRUE(name_map.empty()); 78 EXPECT_TRUE(name_map.empty());
78 } 79 }
79 80
80 TEST_F(ShaderTranslatorTest, InvalidVertexShader) { 81 TEST_F(ShaderTranslatorTest, InvalidVertexShader) {
81 const char* bad_shader = "foo-bar"; 82 const char* bad_shader = "foo-bar";
82 const char* good_shader = 83 const char* good_shader =
83 "void main() {\n" 84 "void main() {\n"
84 " gl_Position = vec4(1.0);\n" 85 " gl_Position = vec4(1.0);\n"
85 "}"; 86 "}";
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 334
334 EXPECT_EQ(options_1, options_2); 335 EXPECT_EQ(options_1, options_2);
335 EXPECT_NE(options_1, options_3); 336 EXPECT_NE(options_1, options_3);
336 EXPECT_NE(options_1, options_4); 337 EXPECT_NE(options_1, options_4);
337 EXPECT_NE(options_3, options_4); 338 EXPECT_NE(options_3, options_4);
338 } 339 }
339 340
340 } // namespace gles2 341 } // namespace gles2
341 } // namespace gpu 342 } // namespace gpu
342 343
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698