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