blob: 2bf9b1df04e9056f1d5be5e106510d6720a4659c [file] [log] [blame]
Jarkko Pöyryf38ef812015-04-16 15:49:10 -07001/*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 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 "es31fDefaultVertexArrayObjectTests.hpp"
25
26#include "gluCallLogWrapper.hpp"
27#include "gluRenderContext.hpp"
28
29#include "glwEnums.hpp"
30
31namespace deqp
32{
33namespace gles31
34{
35namespace Functional
36{
37namespace
38{
39
40class VertexAttributeDivisorCase : public TestCase
41{
42public:
43 VertexAttributeDivisorCase (Context& context, const char* name, const char* description);
44 IterateResult iterate (void);
45};
46
47VertexAttributeDivisorCase::VertexAttributeDivisorCase (Context& context, const char* name, const char* description)
48 : TestCase(context, name, description)
49{
50}
51
52VertexAttributeDivisorCase::IterateResult VertexAttributeDivisorCase::iterate (void)
53{
54 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
Jarkko Pöyryf38ef812015-04-16 15:49:10 -070055
56 m_testCtx.getLog() << tcu::TestLog::Message
57 << "Using VertexAttribDivisor with default VAO.\n"
Jarkko Pöyryb459c992015-04-27 15:14:35 -070058 << "Expecting no error."
Jarkko Pöyryf38ef812015-04-16 15:49:10 -070059 << tcu::TestLog::EndMessage;
60
61 gl.enableLogging(true);
62 gl.glBindVertexArray(0);
63
Jarkko Pöyryb459c992015-04-27 15:14:35 -070064 // Using vertexAttribDivisor with default vao is not an error in ES 3.1.
Jarkko Pöyryf38ef812015-04-16 15:49:10 -070065 gl.glVertexAttribDivisor(0, 3);
Jarkko Pöyryb459c992015-04-27 15:14:35 -070066 GLU_EXPECT_NO_ERROR(gl.glGetError(), "VertexAttribDivisor");
Jarkko Pöyryf38ef812015-04-16 15:49:10 -070067
Jarkko Pöyryb459c992015-04-27 15:14:35 -070068 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
Jarkko Pöyryf38ef812015-04-16 15:49:10 -070069 return STOP;
70}
71
72} // anonymous
73
74DefaultVertexArrayObjectTests::DefaultVertexArrayObjectTests (Context& context)
75 : TestCaseGroup(context, "default_vertex_array_object", "Default vertex array object")
76{
77}
78
79void DefaultVertexArrayObjectTests::init (void)
80{
81 addChild(new VertexAttributeDivisorCase(m_context, "vertex_attrib_divisor", "Use VertexAttribDivisor with default VAO"));
82}
83
84} // Functional
85} // gles31
86} // deqp