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