• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _ESEXTCTESSELLATIONSHADERXFB_HPP
2 #define _ESEXTCTESSELLATIONSHADERXFB_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 /** Implementation for Test Case 10
32  *
33  *  Verify transform feed-back captures data from appropriate shader stage.
34  *  Consider the following scenarios:
35  *
36  *  * vertex shader, tessellation control + evaluation shader, geometry shaders
37  *    are defined (output should be taken from geometry shader);
38  *  * vertex shader, tessellation control + evaluation shaders are defined
39  *    (output should be taken from tessellation evaluation shader);
40  *
41  *  Verify the following shader/stage combination is invalid and neither links
42  *  nor is considered a valid combination of stages for a pipeline object:
43  *
44  *  * vertex shader, tessellation control shaders are defined;
45  *
46  *  Make sure to include separate shader objects in the test.
47  **/
48 class TessellationShaderXFB : public TestCaseBase
49 {
50 public:
51 	/* Public methods */
52 	TessellationShaderXFB(Context& context, const ExtParameters& extParams);
53 
~TessellationShaderXFB(void)54 	virtual ~TessellationShaderXFB(void)
55 	{
56 	}
57 
58 	virtual void		  deinit(void);
59 	void				  initTest(void);
60 	virtual IterateResult iterate(void);
61 
62 private:
63 	/* Private definitions */
64 	typedef struct _test_descriptor
65 	{
66 		/* Allowed values:
67 		 *
68 		 * GL_GEOMETRY_SHADER_EXT / GL_TESS_CONTROL_SHADER_EXT / GL_TESS_EVALUATION_SHADER_EXT /
69 		 * GL_VERTEX_SHADER.
70 		 */
71 		glw::GLenum expected_data_source;
72 		int			expected_n_values;
73 		bool		should_draw_call_fail;
74 		bool		requires_pipeline;
75 		glw::GLenum tf_mode;
76 
77 		bool use_gs;
78 		bool use_tc;
79 		bool use_te;
80 
_test_descriptorglcts::TessellationShaderXFB::_test_descriptor81 		_test_descriptor()
82 		{
83 			expected_data_source  = GL_NONE;
84 			expected_n_values	 = 0;
85 			should_draw_call_fail = false;
86 			requires_pipeline	 = false;
87 			tf_mode				  = GL_POINTS;
88 			use_gs				  = false;
89 			use_tc				  = false;
90 			use_te				  = false;
91 		}
92 	} _test_descriptor;
93 
94 	/* Private variables */
95 	glw::GLuint m_bo_id;
96 	glw::GLuint m_fs_id;
97 	glw::GLuint m_gs_id;
98 	glw::GLuint m_po_id;
99 	glw::GLuint m_tc_id;
100 	glw::GLuint m_te_id;
101 	glw::GLuint m_vs_id;
102 
103 	glw::GLuint m_pipeline_id;
104 	glw::GLuint m_fs_program_id;
105 	glw::GLuint m_gs_program_id;
106 	glw::GLuint m_tc_program_id;
107 	glw::GLuint m_te_program_id;
108 	glw::GLuint m_vs_program_id;
109 
110 	glw::GLuint m_vao_id;
111 
112 	/* Private methods */
113 	glw::GLuint createSeparableProgram(glw::GLenum shader_type, unsigned int n_strings, const char* const* strings,
114 									   unsigned int n_varyings, const char* const* varyings, bool should_succeed);
115 };
116 
117 } // namespace glcts
118 
119 #endif // _ESEXTCTESSELLATIONSHADERXFB_HPP
120