1 #ifndef _ESEXTCGEOMETRYSHADERPROGRAMRESOURCE_HPP
2 #define _ESEXTCGEOMETRYSHADERPROGRAMRESOURCE_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 
28 namespace glcts
29 {
30 
31 /** Implementation of Group 3. Test description follows:
32  *
33  * 1. Make sure that GL_REFERENCED_BY_GEOMETRY_SHADER_EXT property works
34  *    correctly for all supported interfaces.
35  *
36  *    Category: API.
37  *
38  *    1. Create a program object with boilerplate fragment and vertex shaders,
39  *       as well as an attached geometry shader using all of the features,
40  *       properties of which can later be examined using
41  *       glGetProgramResourceiv() call.
42  *    2. Link the program object.
43  *    3. Use GetProgramResourceiv() calls to verify values reported for
44  *       geometry stage are as expected.
45  **/
46 class GeometryShaderProgramResourceTest : public TestCaseBase
47 {
48 public:
49     /* Public methods */
50     GeometryShaderProgramResourceTest(Context &context, const ExtParameters &extParams, const char *name,
51                                       const char *description);
52 
~GeometryShaderProgramResourceTest()53     virtual ~GeometryShaderProgramResourceTest()
54     {
55     }
56 
57     virtual void deinit(void);
58     virtual IterateResult iterate(void);
59 
60 private:
61     /* Private methods */
62     void initTest(void);
63 
64     bool checkIfResourceAtIndexIsReferenced(glw::GLuint program_object_id, glw::GLenum interface,
65                                             glw::GLuint index) const;
66 
67     bool checkIfResourceIsReferenced(glw::GLuint program_object_id, glw::GLenum interface, const char *name) const;
68 
69     /* Private fields */
70 
71     /* Shader objects */
72     glw::GLuint m_fragment_shader_id;
73     glw::GLuint m_geometry_shader_id;
74     glw::GLuint m_vertex_shader_id;
75 
76     /* Program object */
77     glw::GLuint m_program_object_id;
78 
79     static const char *const m_common_shader_code_definitions_body;
80     static const char *const m_common_shader_code_definitions_atomic_counter_body;
81     static const char *const m_common_shader_code_definitions_ssbo_body;
82 
83     static const char *const m_vertex_shader_code_preamble;
84     static const char *const m_vertex_shader_code_body;
85     static const char *const m_vertex_shader_code_atomic_counter_body;
86     static const char *const m_vertex_shader_code_ssbo_body;
87 
88     static const char *const m_geometry_shader_code_preamble;
89     static const char *const m_geometry_shader_code_body;
90     static const char *const m_geometry_shader_code_atomic_counter_body;
91     static const char *const m_geometry_shader_code_ssbo_body;
92 
93     static const char *const m_fragment_shader_code;
94 
95     bool m_atomic_counters_supported;
96     bool m_ssbos_supported;
97 };
98 
99 } // namespace glcts
100 
101 #endif // _ESEXTCGEOMETRYSHADERPROGRAMRESOURCE_HPP
102