1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 Module
3 * -------------------------------------------------
4 *
5 * Copyright 2015 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 *//*!
20 * \file
21 * \brief Default vertex array tests
22 *//*--------------------------------------------------------------------*/
23
24 #include "es3fDefaultVertexArrayObjectTests.hpp"
25
26 #include "gluCallLogWrapper.hpp"
27 #include "gluRenderContext.hpp"
28
29 namespace deqp
30 {
31 namespace gles3
32 {
33 namespace Functional
34 {
35 namespace
36 {
37
38 class VertexAttributeDivisorCase : public TestCase
39 {
40 public:
41 VertexAttributeDivisorCase(Context &context, const char *name, const char *description);
42 IterateResult iterate(void);
43 };
44
VertexAttributeDivisorCase(Context & context,const char * name,const char * description)45 VertexAttributeDivisorCase::VertexAttributeDivisorCase(Context &context, const char *name, const char *description)
46 : TestCase(context, name, description)
47 {
48 }
49
iterate(void)50 VertexAttributeDivisorCase::IterateResult VertexAttributeDivisorCase::iterate(void)
51 {
52 glu::CallLogWrapper gl(m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
53
54 m_testCtx.getLog() << tcu::TestLog::Message << "Using VertexAttribDivisor with default VAO.\n"
55 << "Expecting no error." << tcu::TestLog::EndMessage;
56
57 gl.enableLogging(true);
58 gl.glBindVertexArray(0);
59
60 // Using vertexAttribDivisor with default vao is not an error in ES 3.0.
61 gl.glVertexAttribDivisor(0, 3);
62 GLU_EXPECT_NO_ERROR(gl.glGetError(), "VertexAttribDivisor");
63
64 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
65 return STOP;
66 }
67
68 } // namespace
69
DefaultVertexArrayObjectTests(Context & context)70 DefaultVertexArrayObjectTests::DefaultVertexArrayObjectTests(Context &context)
71 : TestCaseGroup(context, "default_vertex_array_object", "Default vertex array object")
72 {
73 }
74
init(void)75 void DefaultVertexArrayObjectTests::init(void)
76 {
77 addChild(
78 new VertexAttributeDivisorCase(m_context, "vertex_attrib_divisor", "Use VertexAttribDivisor with default VAO"));
79 }
80
81 } // namespace Functional
82 } // namespace gles3
83 } // namespace deqp
84