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

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

Issue 906613005: Add glUniformBlockBinding to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uniform
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" 9 #include "gpu/command_buffer/common/gles2_cmd_format.h"
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 kInvalidSharedMemoryId, 1340 kInvalidSharedMemoryId,
1341 kSharedMemoryOffset); 1341 kSharedMemoryOffset);
1342 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); 1342 EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
1343 cmd.Init(client_program_id_, 1343 cmd.Init(client_program_id_,
1344 kBucketId, 1344 kBucketId,
1345 kSharedMemoryId, 1345 kSharedMemoryId,
1346 kInvalidSharedMemoryOffset); 1346 kInvalidSharedMemoryOffset);
1347 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); 1347 EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
1348 } 1348 }
1349 1349
1350 TEST_P(GLES2DecoderWithShaderTest, UniformBlockBindingValidArgs) {
1351 EXPECT_CALL(*gl_, UniformBlockBinding(kServiceProgramId, 2, 3));
1352 SpecializedSetup<cmds::UniformBlockBinding, 0>(true);
1353 cmds::UniformBlockBinding cmd;
1354 cmd.Init(client_program_id_, 2, 3);
1355 decoder_->set_unsafe_es3_apis_enabled(true);
1356 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1357 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1358 decoder_->set_unsafe_es3_apis_enabled(false);
1359 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
1360 }
1361
1350 TEST_P(GLES2DecoderWithShaderTest, BindUniformLocationCHROMIUMBucket) { 1362 TEST_P(GLES2DecoderWithShaderTest, BindUniformLocationCHROMIUMBucket) {
1351 const uint32 kBucketId = 123; 1363 const uint32 kBucketId = 123;
1352 const GLint kLocation = 2; 1364 const GLint kLocation = 2;
1353 const char* kName = "testing"; 1365 const char* kName = "testing";
1354 const char* kBadName1 = "gl_testing"; 1366 const char* kBadName1 = "gl_testing";
1355 const char* kBadName2 = "testing[1]"; 1367 const char* kBadName2 = "testing[1]";
1356 1368
1357 SetBucketAsCString(kBucketId, kName); 1369 SetBucketAsCString(kBucketId, kName);
1358 BindUniformLocationCHROMIUMBucket cmd; 1370 BindUniformLocationCHROMIUMBucket cmd;
1359 cmd.Init(client_program_id_, 1371 cmd.Init(client_program_id_,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 } 1465 }
1454 1466
1455 // TODO(gman): DeleteProgram 1467 // TODO(gman): DeleteProgram
1456 1468
1457 // TODO(gman): UseProgram 1469 // TODO(gman): UseProgram
1458 1470
1459 // TODO(gman): DeleteShader 1471 // TODO(gman): DeleteShader
1460 1472
1461 } // namespace gles2 1473 } // namespace gles2
1462 } // namespace gpu 1474 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698