1 #ifndef _ESEXTCTESSELLATIONSHADERPROPERTIES_HPP
2 #define _ESEXTCTESSELLATIONSHADERPROPERTIES_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2014-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 #include "glwEnums.hpp"
28 
29 namespace glcts
30 {
31 
32 /** Implementation for Test Case 5
33  *
34  *  Make sure that the following tessellation stage properties (some of which
35  *  are context-wide, some associated with active program object) have correct
36  *  default values reported by relevant getters:
37  *
38  *  * GL_PATCH_VERTICES_EXT             (default value: 3);
39  *  * GL_PATCH_DEFAULT_OUTER_LEVEL (*)  (default value: 4 x 1.0);
40  *  * GL_PATCH_DEFAULT_INNER_LEVEL (*)  (default value: 2 x 1.0);
41  *
42  *  (*) Only checked on Desktop
43  *
44  **/
45 class TessellationShaderPropertiesDefaultContextWideValues : public TestCaseBase
46 {
47 public:
48     /* Public methods */
49     TessellationShaderPropertiesDefaultContextWideValues(Context &context, const ExtParameters &extParams);
50 
~TessellationShaderPropertiesDefaultContextWideValues(void)51     virtual ~TessellationShaderPropertiesDefaultContextWideValues(void)
52     {
53     }
54 
55     virtual IterateResult iterate(void);
56 };
57 
58 /*  Make sure that the following tessellation stage properties (some of which
59  *  are context-wide, some associated with active program object) have correct
60  *  default values reported by relevant getters:
61  *
62  *  * GL_TESS_CONTROL_OUTPUT_VERTICES_EXT (default value: 0);
63  *  * GL_TESS_GEN_MODE_EXT                (default value: GL_QUADS_EXT);
64  *  * GL_TESS_GEN_SPACING_EXT             (default value: GL_EQUAL);
65  *  * GL_TESS_GEN_VERTEX_ORDER_EXT        (default value: GL_CCW);
66  *  * GL_TESS_GEN_POINT_MODE_EXT          (default value: GL_FALSE);
67  *
68  *  The test should also iterate through a number of program objects, for which
69  *  different tessellation control and evaluation shaders were defined, and verify
70  *  the GL_TESS_* values returned are as defined in input layout qualifiers for
71  *  relevant shaders.
72  *
73  */
74 class TessellationShaderPropertiesProgramObject : public TestCaseBase
75 {
76 public:
77     /* Public methods */
78     TessellationShaderPropertiesProgramObject(Context &context, const ExtParameters &extParams);
79 
~TessellationShaderPropertiesProgramObject(void)80     virtual ~TessellationShaderPropertiesProgramObject(void)
81     {
82     }
83 
84     virtual void deinit(void);
85     void initTest(void);
86     virtual IterateResult iterate(void);
87 
88 private:
89     /* Private type definitions */
90     /* Define a few different tc/te/tc+te shaders we'll attach to a program object,
91      * which will then be queried for tessellation-specific properties
92      */
93     typedef struct _test_descriptor
94     {
95         glw::GLint expected_control_output_vertices_value;
96         glw::GLenum expected_gen_mode_value;
97         glw::GLenum expected_gen_point_mode_value;
98         glw::GLenum expected_gen_spacing_value;
99         glw::GLenum expected_gen_vertex_order_value;
100         const char *tc_body;
101         const char *te_body;
102 
_test_descriptorglcts::TessellationShaderPropertiesProgramObject::_test_descriptor103         _test_descriptor()
104         {
105             expected_control_output_vertices_value = 0;
106             expected_gen_mode_value                = 0;
107             expected_gen_point_mode_value          = 0;
108             expected_gen_spacing_value             = 0;
109             expected_gen_vertex_order_value        = 0;
110             tc_body                                = DE_NULL;
111             te_body                                = DE_NULL;
112         }
113     } _test_descriptor;
114 
115     typedef std::vector<_test_descriptor> _tests;
116     typedef _tests::const_iterator _tests_const_iterator;
117 
118     /* Private variables */
119     glw::GLuint m_fs_id;
120     glw::GLuint m_po_id;
121     glw::GLuint m_tc_id;
122     glw::GLuint m_te_id;
123     glw::GLuint m_vs_id;
124 };
125 
126 } // namespace glcts
127 
128 #endif // _ESEXTCTESSELLATIONSHADERPROPERTIES_HPP
129