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
3 // found in the LICENSE file.
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
7 #include "gpu/command_buffer/common/gles2_cmd_format.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
10 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
11 #include "gpu/command_buffer/service/context_group.h"
12 #include "gpu/command_buffer/service/program_manager.h"
13 #include "gpu/command_buffer/service/test_helper.h"
14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "ui/gl/gl_mock.h"
17 using ::gfx::MockGLInterface
;
19 using ::testing::AnyNumber
;
20 using ::testing::DoAll
;
21 using ::testing::InSequence
;
22 using ::testing::MatcherCast
;
23 using ::testing::Pointee
;
24 using ::testing::Return
;
25 using ::testing::SetArrayArgument
;
26 using ::testing::SetArgumentPointee
;
27 using ::testing::StrEq
;
33 void ShaderCacheCb(const std::string
& key
, const std::string
& shader
) {
37 class GLES2DecoderTest2
: public GLES2DecoderTestBase
{
39 GLES2DecoderTest2() { }
41 void TestAcceptedUniform(GLenum uniform_type
, uint32 accepts_apis
) {
42 SetupShaderForUniform(uniform_type
);
43 bool valid_uniform
= false;
45 EXPECT_CALL(*gl_
, Uniform1i(1, _
)).Times(AnyNumber());
46 EXPECT_CALL(*gl_
, Uniform1iv(1, _
, _
)).Times(AnyNumber());
47 EXPECT_CALL(*gl_
, Uniform2iv(1, _
, _
)).Times(AnyNumber());
48 EXPECT_CALL(*gl_
, Uniform3iv(1, _
, _
)).Times(AnyNumber());
49 EXPECT_CALL(*gl_
, Uniform4iv(1, _
, _
)).Times(AnyNumber());
50 EXPECT_CALL(*gl_
, Uniform1f(1, _
)).Times(AnyNumber());
51 EXPECT_CALL(*gl_
, Uniform1fv(1, _
, _
)).Times(AnyNumber());
52 EXPECT_CALL(*gl_
, Uniform2fv(1, _
, _
)).Times(AnyNumber());
53 EXPECT_CALL(*gl_
, Uniform3fv(1, _
, _
)).Times(AnyNumber());
54 EXPECT_CALL(*gl_
, Uniform4fv(1, _
, _
)).Times(AnyNumber());
55 EXPECT_CALL(*gl_
, UniformMatrix2fv(1, _
, _
, _
)).Times(AnyNumber());
56 EXPECT_CALL(*gl_
, UniformMatrix3fv(1, _
, _
, _
)).Times(AnyNumber());
57 EXPECT_CALL(*gl_
, UniformMatrix4fv(1, _
, _
, _
)).Times(AnyNumber());
60 valid_uniform
= accepts_apis
& Program::kUniform1i
;
63 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
64 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
69 valid_uniform
= accepts_apis
& Program::kUniform1i
;
70 cmds::Uniform1ivImmediate
& cmd
=
71 *GetImmediateAs
<cmds::Uniform1ivImmediate
>();
72 GLint data
[2][1] = {{0}};
73 cmd
.Init(1, 2, &data
[0][0]);
74 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
75 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
80 valid_uniform
= accepts_apis
& Program::kUniform2i
;
83 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
84 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
89 valid_uniform
= accepts_apis
& Program::kUniform2i
;
90 cmds::Uniform2ivImmediate
& cmd
=
91 *GetImmediateAs
<cmds::Uniform2ivImmediate
>();
92 GLint data
[2][2] = {{0}};
93 cmd
.Init(1, 2, &data
[0][0]);
94 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
95 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
100 valid_uniform
= accepts_apis
& Program::kUniform3i
;
102 cmd
.Init(1, 2, 3, 4);
103 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
104 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
109 valid_uniform
= accepts_apis
& Program::kUniform3i
;
110 cmds::Uniform3ivImmediate
& cmd
=
111 *GetImmediateAs
<cmds::Uniform3ivImmediate
>();
112 GLint data
[2][3] = {{0}};
113 cmd
.Init(1, 2, &data
[0][0]);
114 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
115 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
120 valid_uniform
= accepts_apis
& Program::kUniform4i
;
122 cmd
.Init(1, 2, 3, 4, 5);
123 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
124 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
129 valid_uniform
= accepts_apis
& Program::kUniform4i
;
130 cmds::Uniform4ivImmediate
& cmd
=
131 *GetImmediateAs
<cmds::Uniform4ivImmediate
>();
132 GLint data
[2][4] = {{0}};
133 cmd
.Init(1, 2, &data
[0][0]);
134 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
135 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
142 valid_uniform
= accepts_apis
& Program::kUniform1f
;
145 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
146 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
151 valid_uniform
= accepts_apis
& Program::kUniform1f
;
152 cmds::Uniform1fvImmediate
& cmd
=
153 *GetImmediateAs
<cmds::Uniform1fvImmediate
>();
154 GLfloat data
[2][1] = {{0.0f
}};
155 cmd
.Init(1, 2, &data
[0][0]);
156 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
157 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
162 valid_uniform
= accepts_apis
& Program::kUniform2f
;
165 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
166 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
171 valid_uniform
= accepts_apis
& Program::kUniform2f
;
172 cmds::Uniform2fvImmediate
& cmd
=
173 *GetImmediateAs
<cmds::Uniform2fvImmediate
>();
174 GLfloat data
[2][2] = {{0.0f
}};
175 cmd
.Init(1, 2, &data
[0][0]);
176 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
177 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
182 valid_uniform
= accepts_apis
& Program::kUniform3f
;
184 cmd
.Init(1, 2, 3, 4);
185 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
186 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
191 valid_uniform
= accepts_apis
& Program::kUniform3f
;
192 cmds::Uniform3fvImmediate
& cmd
=
193 *GetImmediateAs
<cmds::Uniform3fvImmediate
>();
194 GLfloat data
[2][3] = {{0.0f
}};
195 cmd
.Init(1, 2, &data
[0][0]);
196 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
197 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
202 valid_uniform
= accepts_apis
& Program::kUniform4f
;
204 cmd
.Init(1, 2, 3, 4, 5);
205 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
206 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
211 valid_uniform
= accepts_apis
& Program::kUniform4f
;
212 cmds::Uniform4fvImmediate
& cmd
=
213 *GetImmediateAs
<cmds::Uniform4fvImmediate
>();
214 GLfloat data
[2][4] = {{0.0f
}};
215 cmd
.Init(1, 2, &data
[0][0]);
216 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
217 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
222 valid_uniform
= accepts_apis
& Program::kUniformMatrix2f
;
223 cmds::UniformMatrix2fvImmediate
& cmd
=
224 *GetImmediateAs
<cmds::UniformMatrix2fvImmediate
>();
225 GLfloat data
[2][2 * 2] = {{0.0f
}};
227 cmd
.Init(1, 2, &data
[0][0]);
228 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
229 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
234 valid_uniform
= accepts_apis
& Program::kUniformMatrix3f
;
235 cmds::UniformMatrix3fvImmediate
& cmd
=
236 *GetImmediateAs
<cmds::UniformMatrix3fvImmediate
>();
237 GLfloat data
[2][3 * 3] = {{0.0f
}};
238 cmd
.Init(1, 2, &data
[0][0]);
239 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
240 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
245 valid_uniform
= accepts_apis
& Program::kUniformMatrix4f
;
246 cmds::UniformMatrix4fvImmediate
& cmd
=
247 *GetImmediateAs
<cmds::UniformMatrix4fvImmediate
>();
248 GLfloat data
[2][4 * 4] = {{0.0f
}};
249 cmd
.Init(1, 2, &data
[0][0]);
250 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(data
)));
251 EXPECT_EQ(valid_uniform
? GL_NO_ERROR
: GL_INVALID_OPERATION
,
257 INSTANTIATE_TEST_CASE_P(Service
, GLES2DecoderTest2
, ::testing::Bool());
260 void GLES2DecoderTestBase::SpecializedSetup
<cmds::GetProgramInfoLog
, 0>(
262 const GLuint kClientVertexShaderId
= 5001;
263 const GLuint kServiceVertexShaderId
= 6001;
264 const GLuint kClientFragmentShaderId
= 5002;
265 const GLuint kServiceFragmentShaderId
= 6002;
266 const char* log
= "hello"; // Matches auto-generated unit test.
268 GL_VERTEX_SHADER
, kClientVertexShaderId
, kServiceVertexShaderId
);
270 GL_FRAGMENT_SHADER
, kClientFragmentShaderId
, kServiceFragmentShaderId
);
272 TestHelper::SetShaderStates(
273 gl_
.get(), GetShader(kClientVertexShaderId
), true);
274 TestHelper::SetShaderStates(
275 gl_
.get(), GetShader(kClientFragmentShaderId
), true);
279 AttachShader(kServiceProgramId
, kServiceVertexShaderId
))
281 .RetiresOnSaturation();
283 AttachShader(kServiceProgramId
, kServiceFragmentShaderId
))
285 .RetiresOnSaturation();
286 EXPECT_CALL(*gl_
, LinkProgram(kServiceProgramId
))
288 .RetiresOnSaturation();
289 EXPECT_CALL(*gl_
, GetProgramiv(kServiceProgramId
, GL_LINK_STATUS
, _
))
290 .WillOnce(SetArgumentPointee
<2>(1));
292 GetProgramiv(kServiceProgramId
, GL_INFO_LOG_LENGTH
, _
))
293 .WillOnce(SetArgumentPointee
<2>(strlen(log
) + 1))
294 .RetiresOnSaturation();
296 GetProgramInfoLog(kServiceProgramId
, strlen(log
) + 1, _
, _
))
298 SetArgumentPointee
<2>(strlen(log
)),
299 SetArrayArgument
<3>(log
, log
+ strlen(log
) + 1)))
300 .RetiresOnSaturation();
301 EXPECT_CALL(*gl_
, GetProgramiv(kServiceProgramId
, GL_ACTIVE_ATTRIBUTES
, _
))
302 .WillOnce(SetArgumentPointee
<2>(0));
305 GetProgramiv(kServiceProgramId
, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
, _
))
306 .WillOnce(SetArgumentPointee
<2>(0));
307 EXPECT_CALL(*gl_
, GetProgramiv(kServiceProgramId
, GL_ACTIVE_UNIFORMS
, _
))
308 .WillOnce(SetArgumentPointee
<2>(0));
311 GetProgramiv(kServiceProgramId
, GL_ACTIVE_UNIFORM_MAX_LENGTH
, _
))
312 .WillOnce(SetArgumentPointee
<2>(0));
314 Program
* program
= GetProgram(client_program_id_
);
315 ASSERT_TRUE(program
!= NULL
);
317 cmds::AttachShader attach_cmd
;
318 attach_cmd
.Init(client_program_id_
, kClientVertexShaderId
);
319 EXPECT_EQ(error::kNoError
, ExecuteCmd(attach_cmd
));
321 attach_cmd
.Init(client_program_id_
, kClientFragmentShaderId
);
322 EXPECT_EQ(error::kNoError
, ExecuteCmd(attach_cmd
));
324 program
->Link(NULL
, Program::kCountOnlyStaticallyUsed
,
325 base::Bind(&ShaderCacheCb
));
329 void GLES2DecoderTestBase::SpecializedSetup
<
330 cmds::GetRenderbufferParameteriv
, 0>(
332 DoBindRenderbuffer(GL_RENDERBUFFER
, client_renderbuffer_id_
,
333 kServiceRenderbufferId
);
337 void GLES2DecoderTestBase::SpecializedSetup
<cmds::RenderbufferStorage
, 0>(
339 DoBindRenderbuffer(GL_RENDERBUFFER
, client_renderbuffer_id_
,
340 kServiceRenderbufferId
);
342 EnsureRenderbufferBound(false);
343 EXPECT_CALL(*gl_
, GetError())
344 .WillOnce(Return(GL_NO_ERROR
))
345 .RetiresOnSaturation();
347 RenderbufferStorageEXT(GL_RENDERBUFFER
, _
, 3, 4))
349 .RetiresOnSaturation();
350 EXPECT_CALL(*gl_
, GetError())
351 .WillOnce(Return(GL_NO_ERROR
))
352 .RetiresOnSaturation();
357 void GLES2DecoderTestBase::SpecializedSetup
<cmds::GenQueriesEXTImmediate
, 0>(
360 // Make the client_query_id_ so that trying to make it again
362 cmds::GenQueriesEXTImmediate
& cmd
=
363 *GetImmediateAs
<cmds::GenQueriesEXTImmediate
>();
364 cmd
.Init(1, &client_query_id_
);
365 EXPECT_EQ(error::kNoError
,
366 ExecuteImmediateCmd(cmd
, sizeof(client_query_id_
)));
371 void GLES2DecoderTestBase::SpecializedSetup
<cmds::DeleteQueriesEXTImmediate
, 0>(
374 // Make the client_query_id_ so that trying to delete it will succeed.
375 cmds::GenQueriesEXTImmediate
& cmd
=
376 *GetImmediateAs
<cmds::GenQueriesEXTImmediate
>();
377 cmd
.Init(1, &client_query_id_
);
378 EXPECT_EQ(error::kNoError
,
379 ExecuteImmediateCmd(cmd
, sizeof(client_query_id_
)));
384 void GLES2DecoderTestBase::SpecializedSetup
<cmds::LinkProgram
, 0>(
386 const GLuint kClientVertexShaderId
= 5001;
387 const GLuint kServiceVertexShaderId
= 6001;
388 const GLuint kClientFragmentShaderId
= 5002;
389 const GLuint kServiceFragmentShaderId
= 6002;
391 GL_VERTEX_SHADER
, kClientVertexShaderId
, kServiceVertexShaderId
);
393 GL_FRAGMENT_SHADER
, kClientFragmentShaderId
, kServiceFragmentShaderId
);
395 TestHelper::SetShaderStates(
396 gl_
.get(), GetShader(kClientVertexShaderId
), true);
397 TestHelper::SetShaderStates(
398 gl_
.get(), GetShader(kClientFragmentShaderId
), true);
402 AttachShader(kServiceProgramId
, kServiceVertexShaderId
))
404 .RetiresOnSaturation();
406 AttachShader(kServiceProgramId
, kServiceFragmentShaderId
))
408 .RetiresOnSaturation();
409 EXPECT_CALL(*gl_
, GetProgramiv(kServiceProgramId
, GL_LINK_STATUS
, _
))
410 .WillOnce(SetArgumentPointee
<2>(1));
412 GetProgramiv(kServiceProgramId
, GL_INFO_LOG_LENGTH
, _
))
413 .WillOnce(SetArgumentPointee
<2>(0))
414 .RetiresOnSaturation();
415 EXPECT_CALL(*gl_
, GetProgramiv(kServiceProgramId
, GL_ACTIVE_ATTRIBUTES
, _
))
416 .WillOnce(SetArgumentPointee
<2>(0));
419 GetProgramiv(kServiceProgramId
, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
, _
))
420 .WillOnce(SetArgumentPointee
<2>(0));
421 EXPECT_CALL(*gl_
, GetProgramiv(kServiceProgramId
, GL_ACTIVE_UNIFORMS
, _
))
422 .WillOnce(SetArgumentPointee
<2>(0));
425 GetProgramiv(kServiceProgramId
, GL_ACTIVE_UNIFORM_MAX_LENGTH
, _
))
426 .WillOnce(SetArgumentPointee
<2>(0));
428 cmds::AttachShader attach_cmd
;
429 attach_cmd
.Init(client_program_id_
, kClientVertexShaderId
);
430 EXPECT_EQ(error::kNoError
, ExecuteCmd(attach_cmd
));
432 attach_cmd
.Init(client_program_id_
, kClientFragmentShaderId
);
433 EXPECT_EQ(error::kNoError
, ExecuteCmd(attach_cmd
));
437 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform1f
, 0>(
439 SetupShaderForUniform(GL_FLOAT
);
443 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform1fvImmediate
, 0>(
445 SetupShaderForUniform(GL_FLOAT
);
449 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform1ivImmediate
, 0>(
451 SetupShaderForUniform(GL_INT
);
455 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform2f
, 0>(
457 SetupShaderForUniform(GL_FLOAT_VEC2
);
461 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform2i
, 0>(
463 SetupShaderForUniform(GL_INT_VEC2
);
467 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform2fvImmediate
, 0>(
469 SetupShaderForUniform(GL_FLOAT_VEC2
);
473 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform2ivImmediate
, 0>(
475 SetupShaderForUniform(GL_INT_VEC2
);
479 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform3f
, 0>(
481 SetupShaderForUniform(GL_FLOAT_VEC3
);
485 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform3i
, 0>(
487 SetupShaderForUniform(GL_INT_VEC3
);
491 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform3fvImmediate
, 0>(
493 SetupShaderForUniform(GL_FLOAT_VEC3
);
497 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform3ivImmediate
, 0>(
499 SetupShaderForUniform(GL_INT_VEC3
);
503 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform4f
, 0>(
505 SetupShaderForUniform(GL_FLOAT_VEC4
);
509 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform4i
, 0>(
511 SetupShaderForUniform(GL_INT_VEC4
);
515 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform4fvImmediate
, 0>(
517 SetupShaderForUniform(GL_FLOAT_VEC4
);
521 void GLES2DecoderTestBase::SpecializedSetup
<cmds::Uniform4ivImmediate
, 0>(
523 SetupShaderForUniform(GL_INT_VEC4
);
527 void GLES2DecoderTestBase::SpecializedSetup
<cmds::UniformMatrix2fvImmediate
, 0>(
529 SetupShaderForUniform(GL_FLOAT_MAT2
);
533 void GLES2DecoderTestBase::SpecializedSetup
<cmds::TexParameterf
, 0>(
535 DoBindTexture(GL_TEXTURE_2D
, client_texture_id_
, kServiceTextureId
);
539 void GLES2DecoderTestBase::SpecializedSetup
<cmds::TexParameteri
, 0>(
541 DoBindTexture(GL_TEXTURE_2D
, client_texture_id_
, kServiceTextureId
);
545 void GLES2DecoderTestBase::SpecializedSetup
<cmds::TexParameterfvImmediate
, 0>(
547 DoBindTexture(GL_TEXTURE_2D
, client_texture_id_
, kServiceTextureId
);
551 void GLES2DecoderTestBase::SpecializedSetup
<cmds::TexParameterivImmediate
, 0>(
553 DoBindTexture(GL_TEXTURE_2D
, client_texture_id_
, kServiceTextureId
);
557 void GLES2DecoderTestBase::SpecializedSetup
<cmds::GetVertexAttribiv
, 0>(
559 DoBindBuffer(GL_ARRAY_BUFFER
, client_buffer_id_
, kServiceBufferId
);
560 DoVertexAttribPointer(1, 1, GL_FLOAT
, 0, 0);
562 EXPECT_CALL(*gl_
, GetError())
563 .WillOnce(Return(GL_NO_ERROR
))
564 .WillOnce(Return(GL_NO_ERROR
))
565 .RetiresOnSaturation();
570 void GLES2DecoderTestBase::SpecializedSetup
<cmds::GetVertexAttribfv
, 0>(
572 DoBindBuffer(GL_ARRAY_BUFFER
, client_buffer_id_
, kServiceBufferId
);
573 DoVertexAttribPointer(1, 1, GL_FLOAT
, 0, 0);
575 EXPECT_CALL(*gl_
, GetError())
576 .WillOnce(Return(GL_NO_ERROR
))
577 .WillOnce(Return(GL_NO_ERROR
))
578 .RetiresOnSaturation();
583 void GLES2DecoderTestBase::SpecializedSetup
<cmds::GetVertexAttribIiv
, 0>(
585 DoBindBuffer(GL_ARRAY_BUFFER
, client_buffer_id_
, kServiceBufferId
);
586 DoVertexAttribPointer(1, 1, GL_FLOAT
, 0, 0);
588 EXPECT_CALL(*gl_
, GetError())
589 .WillOnce(Return(GL_NO_ERROR
))
590 .WillOnce(Return(GL_NO_ERROR
))
591 .RetiresOnSaturation();
596 void GLES2DecoderTestBase::SpecializedSetup
<cmds::GetVertexAttribIuiv
, 0>(
598 DoBindBuffer(GL_ARRAY_BUFFER
, client_buffer_id_
, kServiceBufferId
);
599 DoVertexAttribPointer(1, 1, GL_FLOAT
, 0, 0);
601 EXPECT_CALL(*gl_
, GetError())
602 .WillOnce(Return(GL_NO_ERROR
))
603 .WillOnce(Return(GL_NO_ERROR
))
604 .RetiresOnSaturation();
609 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h"
611 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_INT
) {
612 TestAcceptedUniform(GL_INT
, Program::kUniform1i
);
615 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_INT_VEC2
) {
616 TestAcceptedUniform(GL_INT_VEC2
, Program::kUniform2i
);
619 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_INT_VEC3
) {
620 TestAcceptedUniform(GL_INT_VEC3
, Program::kUniform3i
);
623 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_INT_VEC4
) {
624 TestAcceptedUniform(GL_INT_VEC4
, Program::kUniform4i
);
627 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_BOOL
) {
628 TestAcceptedUniform(GL_BOOL
, Program::kUniform1i
| Program::kUniform1f
);
631 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_BOOL_VEC2
) {
632 TestAcceptedUniform(GL_BOOL_VEC2
, Program::kUniform2i
| Program::kUniform2f
);
635 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_BOOL_VEC3
) {
636 TestAcceptedUniform(GL_BOOL_VEC3
, Program::kUniform3i
| Program::kUniform3f
);
639 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_BOOL_VEC4
) {
640 TestAcceptedUniform(GL_BOOL_VEC4
, Program::kUniform4i
| Program::kUniform4f
);
643 TEST_P(GLES2DecoderTest2
, AcceptsUniformTypeFLOAT
) {
644 TestAcceptedUniform(GL_FLOAT
, Program::kUniform1f
);
647 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_FLOAT_VEC2
) {
648 TestAcceptedUniform(GL_FLOAT_VEC2
, Program::kUniform2f
);
651 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_FLOAT_VEC3
) {
652 TestAcceptedUniform(GL_FLOAT_VEC3
, Program::kUniform3f
);
655 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_FLOAT_VEC4
) {
656 TestAcceptedUniform(GL_FLOAT_VEC4
, Program::kUniform4f
);
659 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_FLOAT_MAT2
) {
660 TestAcceptedUniform(GL_FLOAT_MAT2
, Program::kUniformMatrix2f
);
663 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_FLOAT_MAT3
) {
664 TestAcceptedUniform(GL_FLOAT_MAT3
, Program::kUniformMatrix3f
);
667 TEST_P(GLES2DecoderTest2
, AcceptsUniform_GL_FLOAT_MAT4
) {
668 TestAcceptedUniform(GL_FLOAT_MAT4
, Program::kUniformMatrix4f
);