1e5c31af7Sopenharmony_ci#ifndef _ESEXTCGEOMETRYSHADERQUALIFIERS_HPP
2e5c31af7Sopenharmony_ci#define _ESEXTCGEOMETRYSHADERQUALIFIERS_HPP
3e5c31af7Sopenharmony_ci/*-------------------------------------------------------------------------
4e5c31af7Sopenharmony_ci * OpenGL Conformance Test Suite
5e5c31af7Sopenharmony_ci * -----------------------------
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Copyright (c) 2015-2016 The Khronos Group Inc.
8e5c31af7Sopenharmony_ci *
9e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
10e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License.
11e5c31af7Sopenharmony_ci * You may obtain a copy of the License at
12e5c31af7Sopenharmony_ci *
13e5c31af7Sopenharmony_ci *      http://www.apache.org/licenses/LICENSE-2.0
14e5c31af7Sopenharmony_ci *
15e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
16e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
17e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and
19e5c31af7Sopenharmony_ci * limitations under the License.
20e5c31af7Sopenharmony_ci *
21e5c31af7Sopenharmony_ci */ /*!
22e5c31af7Sopenharmony_ci * \file
23e5c31af7Sopenharmony_ci * \brief
24e5c31af7Sopenharmony_ci */ /*-------------------------------------------------------------------*/
25e5c31af7Sopenharmony_ci
26e5c31af7Sopenharmony_ci#include "../esextcTestCaseBase.hpp"
27e5c31af7Sopenharmony_ci
28e5c31af7Sopenharmony_cinamespace glcts
29e5c31af7Sopenharmony_ci{
30e5c31af7Sopenharmony_ci/* Implementation of Test 22.1 from CTS_EXT_geometry_shader. Description follows:
31e5c31af7Sopenharmony_ci *
32e5c31af7Sopenharmony_ci *  1. Make sure flat interpolation does not affect data passed from vertex
33e5c31af7Sopenharmony_ci *     shader to geometry shader.
34e5c31af7Sopenharmony_ci *
35e5c31af7Sopenharmony_ci *     Category: API;
36e5c31af7Sopenharmony_ci *               Functional Test.
37e5c31af7Sopenharmony_ci *
38e5c31af7Sopenharmony_ci *     Create a program object and a fragment, geometry and a vertex shader
39e5c31af7Sopenharmony_ci *     object:
40e5c31af7Sopenharmony_ci *
41e5c31af7Sopenharmony_ci *     - Vertex shader object should output a flat interpolated int variable
42e5c31af7Sopenharmony_ci *       named out_vertex. The shader should set it to gl_VertexID; gl_Position
43e5c31af7Sopenharmony_ci *       should be set to (0, 0, 0, 0).
44e5c31af7Sopenharmony_ci *     - Geometry shader object should accept triangles as input and emit
45e5c31af7Sopenharmony_ci *       a maximum of 1 point. The point it emits:
46e5c31af7Sopenharmony_ci *       - should have (0, 0, 0, 0) coordinates if values of out_vertex variable
47e5c31af7Sopenharmony_ci *         being part of subsequent vertices making up the input triangle are not
48e5c31af7Sopenharmony_ci *         equal to (0, 1, 2).
49e5c31af7Sopenharmony_ci *       - should be set to (1, 1, 1, 1) otherwise.
50e5c31af7Sopenharmony_ci *     - Fragment shader object implementation can be boilerplate.
51e5c31af7Sopenharmony_ci *
52e5c31af7Sopenharmony_ci *     Using this program object, a single triangle should be drawn. Transform
53e5c31af7Sopenharmony_ci *     feed-back should be used to capture the result coordinates as set by
54e5c31af7Sopenharmony_ci *     geometry shader. The value recorded should be equal to (1, 1, 1, 1).
55e5c31af7Sopenharmony_ci *
56e5c31af7Sopenharmony_ci **/
57e5c31af7Sopenharmony_ciclass GeometryShaderFlatInterpolationTest : public TestCaseBase
58e5c31af7Sopenharmony_ci{
59e5c31af7Sopenharmony_cipublic:
60e5c31af7Sopenharmony_ci	/* Public methods */
61e5c31af7Sopenharmony_ci	GeometryShaderFlatInterpolationTest(Context& context, const ExtParameters& extParams, const char* name,
62e5c31af7Sopenharmony_ci										const char* description);
63e5c31af7Sopenharmony_ci
64e5c31af7Sopenharmony_ci	virtual ~GeometryShaderFlatInterpolationTest()
65e5c31af7Sopenharmony_ci	{
66e5c31af7Sopenharmony_ci	}
67e5c31af7Sopenharmony_ci
68e5c31af7Sopenharmony_ci	virtual void		  deinit();
69e5c31af7Sopenharmony_ci	virtual IterateResult iterate();
70e5c31af7Sopenharmony_ci
71e5c31af7Sopenharmony_ciprivate:
72e5c31af7Sopenharmony_ci	/* Private methods */
73e5c31af7Sopenharmony_ci	void initProgram();
74e5c31af7Sopenharmony_ci
75e5c31af7Sopenharmony_ci	/* Private variables */
76e5c31af7Sopenharmony_ci	glw::GLuint m_bo_id;
77e5c31af7Sopenharmony_ci	glw::GLuint m_fs_id;
78e5c31af7Sopenharmony_ci	glw::GLuint m_gs_id;
79e5c31af7Sopenharmony_ci	glw::GLuint m_po_id;
80e5c31af7Sopenharmony_ci	glw::GLuint m_vao_id;
81e5c31af7Sopenharmony_ci	glw::GLuint m_vs_id;
82e5c31af7Sopenharmony_ci};
83e5c31af7Sopenharmony_ci
84e5c31af7Sopenharmony_ci} // namespace glcts
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ci#endif // _ESEXTCGEOMETRYSHADERQUALIFIERS_HPP
87