1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 Module
3 * -------------------------------------------------
5 * Copyright 2015 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * \brief Default vertex array tests
22 *//*--------------------------------------------------------------------*/
24 #include "es31fDefaultVertexArrayObjectTests.hpp"
26 #include "gluCallLogWrapper.hpp"
27 #include "gluRenderContext.hpp"
29 #include "glwEnums.hpp"
40 class VertexAttributeDivisorCase : public TestCase
43 VertexAttributeDivisorCase (Context& context, const char* name, const char* description);
45 IterateResult iterate (void);
48 VertexAttributeDivisorCase::VertexAttributeDivisorCase (Context& context, const char* name, const char* description)
49 : TestCase(context, name, description)
53 void VertexAttributeDivisorCase::init (void)
55 if (!glu::isContextTypeES(m_context.getRenderContext().getType()))
57 throw tcu::NotSupportedError("The Use VertexAttribDivisor with default VAO test is not supported in the GL context");
61 VertexAttributeDivisorCase::IterateResult VertexAttributeDivisorCase::iterate (void)
63 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
65 m_testCtx.getLog() << tcu::TestLog::Message
66 << "Using VertexAttribDivisor with default VAO.\n"
67 << "Expecting no error."
68 << tcu::TestLog::EndMessage;
70 gl.enableLogging(true);
71 gl.glBindVertexArray(0);
73 // Using vertexAttribDivisor with default vao is not an error in ES 3.1.
74 gl.glVertexAttribDivisor(0, 3);
75 GLU_EXPECT_NO_ERROR(gl.glGetError(), "VertexAttribDivisor");
77 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
83 DefaultVertexArrayObjectTests::DefaultVertexArrayObjectTests (Context& context)
84 : TestCaseGroup(context, "default_vertex_array_object", "Default vertex array object")
88 void DefaultVertexArrayObjectTests::init (void)
90 addChild(new VertexAttributeDivisorCase(m_context, "vertex_attrib_divisor", "Use VertexAttribDivisor with default VAO"));