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