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

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

Issue 157363007: Fix initializing the compiler parameters before modifying them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 "gpu/command_buffer/service/shader_translator.h" 5 #include "gpu/command_buffer/service/shader_translator.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace gpu { 8 namespace gpu {
9 namespace gles2 { 9 namespace gles2 {
10 10
11 class ShaderTranslatorTest : public testing::Test { 11 class ShaderTranslatorTest : public testing::Test {
12 public: 12 public:
13 ShaderTranslatorTest() { 13 ShaderTranslatorTest() {
14 } 14 }
15 15
16 virtual ~ShaderTranslatorTest() { 16 virtual ~ShaderTranslatorTest() {
17 } 17 }
18 18
19 protected: 19 protected:
20 virtual void SetUp() { 20 virtual void SetUp() {
21 ShBuiltInResources resources; 21 ShBuiltInResources resources;
22 ShInitBuiltInResources(&resources);
22 resources.MaxExpressionComplexity = 32; 23 resources.MaxExpressionComplexity = 32;
23 resources.MaxCallStackDepth = 32; 24 resources.MaxCallStackDepth = 32;
24 ShInitBuiltInResources(&resources); 25
25 vertex_translator_ = new ShaderTranslator(); 26 vertex_translator_ = new ShaderTranslator();
26 fragment_translator_ = new ShaderTranslator(); 27 fragment_translator_ = new ShaderTranslator();
27 28
28 ASSERT_TRUE(vertex_translator_->Init( 29 ASSERT_TRUE(vertex_translator_->Init(
29 SH_VERTEX_SHADER, SH_GLES2_SPEC, &resources, 30 SH_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
30 ShaderTranslatorInterface::kGlsl, 31 ShaderTranslatorInterface::kGlsl,
31 SH_EMULATE_BUILT_IN_FUNCTIONS)); 32 SH_EMULATE_BUILT_IN_FUNCTIONS));
32 ASSERT_TRUE(fragment_translator_->Init( 33 ASSERT_TRUE(fragment_translator_->Init(
33 SH_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources, 34 SH_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources,
34 ShaderTranslatorInterface::kGlsl, 35 ShaderTranslatorInterface::kGlsl,
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 255
255 EXPECT_EQ(options_1, options_2); 256 EXPECT_EQ(options_1, options_2);
256 EXPECT_NE(options_1, options_3); 257 EXPECT_NE(options_1, options_3);
257 EXPECT_NE(options_1, options_4); 258 EXPECT_NE(options_1, options_4);
258 EXPECT_NE(options_3, options_4); 259 EXPECT_NE(options_3, options_4);
259 } 260 }
260 261
261 } // namespace gles2 262 } // namespace gles2
262 } // namespace gpu 263 } // namespace gpu
263 264
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698