1e5c31af7Sopenharmony_ci#ifndef _GL4CES31COMPATIBILITYTESTS_HPP
2e5c31af7Sopenharmony_ci#define _GL4CES31COMPATIBILITYTESTS_HPP
3e5c31af7Sopenharmony_ci/*-------------------------------------------------------------------------
4e5c31af7Sopenharmony_ci * OpenGL Conformance Test Suite
5e5c31af7Sopenharmony_ci * -----------------------------
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Copyright (c) 2015-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/**
27e5c31af7Sopenharmony_ci */ /*!
28e5c31af7Sopenharmony_ci * \file  gl4cES31CompatibilityTests.hpp
29e5c31af7Sopenharmony_ci * \brief Conformance tests for ES3.1 Compatibility feature functionality.
30e5c31af7Sopenharmony_ci */ /*------------------------------------------------------------------------------*/
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_ci/* Includes. */
33e5c31af7Sopenharmony_ci
34e5c31af7Sopenharmony_ci#include "glcTestCase.hpp"
35e5c31af7Sopenharmony_ci#include "glcTestSubcase.hpp"
36e5c31af7Sopenharmony_ci#include "gluShaderUtil.hpp"
37e5c31af7Sopenharmony_ci#include "glwDefs.hpp"
38e5c31af7Sopenharmony_ci#include "tcuDefs.hpp"
39e5c31af7Sopenharmony_ci
40e5c31af7Sopenharmony_ci#include "glwEnums.hpp"
41e5c31af7Sopenharmony_ci#include "glwFunctions.hpp"
42e5c31af7Sopenharmony_ci
43e5c31af7Sopenharmony_ci/* Interface. */
44e5c31af7Sopenharmony_ci
45e5c31af7Sopenharmony_cinamespace gl4cts
46e5c31af7Sopenharmony_ci{
47e5c31af7Sopenharmony_cinamespace es31compatibility
48e5c31af7Sopenharmony_ci{
49e5c31af7Sopenharmony_ci/** @class Tests
50e5c31af7Sopenharmony_ci *
51e5c31af7Sopenharmony_ci *  @brief OpenGL ES 3.1 Compatibility Tests Suite.
52e5c31af7Sopenharmony_ci */
53e5c31af7Sopenharmony_ciclass Tests : public deqp::TestCaseGroup
54e5c31af7Sopenharmony_ci{
55e5c31af7Sopenharmony_cipublic:
56e5c31af7Sopenharmony_ci	/* Public member functions. */
57e5c31af7Sopenharmony_ci	Tests(deqp::Context& context);
58e5c31af7Sopenharmony_ci
59e5c31af7Sopenharmony_ci	void init();
60e5c31af7Sopenharmony_ci
61e5c31af7Sopenharmony_ciprivate:
62e5c31af7Sopenharmony_ci	/* Private member functions. */
63e5c31af7Sopenharmony_ci	Tests(const Tests& other);
64e5c31af7Sopenharmony_ci	Tests& operator=(const Tests& other);
65e5c31af7Sopenharmony_ci};
66e5c31af7Sopenharmony_ci
67e5c31af7Sopenharmony_ci/* Tests class */
68e5c31af7Sopenharmony_ci
69e5c31af7Sopenharmony_ci/** @class ShaderCompilationCompatibilityTests
70e5c31af7Sopenharmony_ci *
71e5c31af7Sopenharmony_ci *  @brief Test verifies that vertex, fragment and compute shaders
72e5c31af7Sopenharmony_ci *         containing line "#version 310 es" compile without
73e5c31af7Sopenharmony_ci *         error.
74e5c31af7Sopenharmony_ci *
75e5c31af7Sopenharmony_ci *         Test verifies that fragment shader using gl_HelperInvocation
76e5c31af7Sopenharmony_ci *         variable compiles without errors.
77e5c31af7Sopenharmony_ci */
78e5c31af7Sopenharmony_ciclass ShaderCompilationCompatibilityTests : public deqp::TestCase
79e5c31af7Sopenharmony_ci{
80e5c31af7Sopenharmony_cipublic:
81e5c31af7Sopenharmony_ci	/* Public member functions. */
82e5c31af7Sopenharmony_ci	ShaderCompilationCompatibilityTests(deqp::Context& context);
83e5c31af7Sopenharmony_ci
84e5c31af7Sopenharmony_ci	virtual tcu::TestNode::IterateResult iterate();
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ciprivate:
87e5c31af7Sopenharmony_ci	/* Private member functions */
88e5c31af7Sopenharmony_ci	ShaderCompilationCompatibilityTests(const ShaderCompilationCompatibilityTests& other);
89e5c31af7Sopenharmony_ci	ShaderCompilationCompatibilityTests& operator=(const ShaderCompilationCompatibilityTests& other);
90e5c31af7Sopenharmony_ci
91e5c31af7Sopenharmony_ci	/* Static member constants. */
92e5c31af7Sopenharmony_ci	static const struct TestShader
93e5c31af7Sopenharmony_ci	{
94e5c31af7Sopenharmony_ci		glw::GLenum		   type;
95e5c31af7Sopenharmony_ci		const glw::GLchar* type_name;
96e5c31af7Sopenharmony_ci		const glw::GLchar* source;
97e5c31af7Sopenharmony_ci	} s_shaders[]; //!< Test cases shaders.
98e5c31af7Sopenharmony_ci
99e5c31af7Sopenharmony_ci	static const glw::GLsizei s_shaders_count; //!< Test cases shaders count.
100e5c31af7Sopenharmony_ci};
101e5c31af7Sopenharmony_ci
102e5c31af7Sopenharmony_ci/* ShaderCompilationCompatibilityTests */
103e5c31af7Sopenharmony_ci
104e5c31af7Sopenharmony_ci/** @class ShaderFunctionalCompatibilityTests
105e5c31af7Sopenharmony_ci *
106e5c31af7Sopenharmony_ci *  @brief Test veryifies that GLSL mix(T, T, Tboolean) function
107e5c31af7Sopenharmony_ci *         works with int, uint and boolean types. Test is performed
108e5c31af7Sopenharmony_ci *         for highp, mediump and lowp precision qualifiers.
109e5c31af7Sopenharmony_ci */
110e5c31af7Sopenharmony_ciclass ShaderFunctionalCompatibilityTest : public deqp::TestCase
111e5c31af7Sopenharmony_ci{
112e5c31af7Sopenharmony_cipublic:
113e5c31af7Sopenharmony_ci	/* Public member functions. */
114e5c31af7Sopenharmony_ci	ShaderFunctionalCompatibilityTest(deqp::Context& context);
115e5c31af7Sopenharmony_ci
116e5c31af7Sopenharmony_ci	virtual tcu::TestNode::IterateResult iterate();
117e5c31af7Sopenharmony_ci
118e5c31af7Sopenharmony_ciprivate:
119e5c31af7Sopenharmony_ci	/* Private member variables. */
120e5c31af7Sopenharmony_ci	glw::GLuint m_po_id;  //!< Program object name.
121e5c31af7Sopenharmony_ci	glw::GLuint m_fbo_id; //!< Framebuffer object name.
122e5c31af7Sopenharmony_ci	glw::GLuint m_rbo_id; //!< Renderbuffer object name.
123e5c31af7Sopenharmony_ci	glw::GLuint m_vao_id; //!< Vertex Array Object name.
124e5c31af7Sopenharmony_ci
125e5c31af7Sopenharmony_ci	/* Static member constants. */
126e5c31af7Sopenharmony_ci	static const glw::GLchar* s_shader_version;		  //!< Shader version string.
127e5c31af7Sopenharmony_ci	static const glw::GLchar* s_vertex_shader_body;   //!< Vertex shader body template.
128e5c31af7Sopenharmony_ci	static const glw::GLchar* s_fragment_shader_body; //!< Fragment shader body template.
129e5c31af7Sopenharmony_ci	static const struct Shader
130e5c31af7Sopenharmony_ci	{
131e5c31af7Sopenharmony_ci		const glw::GLchar* vertex[3];
132e5c31af7Sopenharmony_ci		const glw::GLchar* fragment[3];
133e5c31af7Sopenharmony_ci	} s_shaders[];							   //!< Template parameter cases.
134e5c31af7Sopenharmony_ci	static const glw::GLsizei s_shaders_count; //!< Number of template parameter cases.
135e5c31af7Sopenharmony_ci
136e5c31af7Sopenharmony_ci	/* Private member functions */
137e5c31af7Sopenharmony_ci	ShaderFunctionalCompatibilityTest(const ShaderFunctionalCompatibilityTest& other);
138e5c31af7Sopenharmony_ci	ShaderFunctionalCompatibilityTest& operator=(const ShaderFunctionalCompatibilityTest& other);
139e5c31af7Sopenharmony_ci
140e5c31af7Sopenharmony_ci	bool createProgram(const struct Shader shader_source);
141e5c31af7Sopenharmony_ci	void createFramebufferAndVertexArrayObject();
142e5c31af7Sopenharmony_ci	bool test();
143e5c31af7Sopenharmony_ci	void cleanProgram();
144e5c31af7Sopenharmony_ci	void cleanFramebufferAndVertexArrayObject();
145e5c31af7Sopenharmony_ci};
146e5c31af7Sopenharmony_ci
147e5c31af7Sopenharmony_ci/* ShaderFunctionalCompatibilityTests */
148e5c31af7Sopenharmony_ci
149e5c31af7Sopenharmony_ci/** @class SampleVariablesTests
150e5c31af7Sopenharmony_ci *
151e5c31af7Sopenharmony_ci *  @breif This class groups adjusted OpenGL ES 3.1 Sample Variables Tests.
152e5c31af7Sopenharmony_ci *         Those tests cover a new GLSL built-in constant for the maximum supported
153e5c31af7Sopenharmony_ci *         samples (gl_MaxSamples) which is available in OpenGL ES 3.1 and in new
154e5c31af7Sopenharmony_ci *         compatibility feature of OpenGL 4.5.
155e5c31af7Sopenharmony_ci */
156e5c31af7Sopenharmony_ciclass SampleVariablesTests : public deqp::TestCaseGroup
157e5c31af7Sopenharmony_ci{
158e5c31af7Sopenharmony_cipublic:
159e5c31af7Sopenharmony_ci	SampleVariablesTests(deqp::Context& context, glu::GLSLVersion glslVersion);
160e5c31af7Sopenharmony_ci	~SampleVariablesTests();
161e5c31af7Sopenharmony_ci
162e5c31af7Sopenharmony_ci	void init();
163e5c31af7Sopenharmony_ci
164e5c31af7Sopenharmony_ciprivate:
165e5c31af7Sopenharmony_ci	SampleVariablesTests(const SampleVariablesTests& other);
166e5c31af7Sopenharmony_ci	SampleVariablesTests& operator=(const SampleVariablesTests& other);
167e5c31af7Sopenharmony_ci
168e5c31af7Sopenharmony_ci	enum
169e5c31af7Sopenharmony_ci	{
170e5c31af7Sopenharmony_ci		SAMPLE_MASKS = 8
171e5c31af7Sopenharmony_ci	};
172e5c31af7Sopenharmony_ci
173e5c31af7Sopenharmony_ci	glu::GLSLVersion m_glslVersion;
174e5c31af7Sopenharmony_ci};
175e5c31af7Sopenharmony_ci
176e5c31af7Sopenharmony_ci/* SampleVariablesTests class */
177e5c31af7Sopenharmony_ci
178e5c31af7Sopenharmony_ci/** @class ShaderImageLoadStoreTests
179e5c31af7Sopenharmony_ci *
180e5c31af7Sopenharmony_ci *  @brief This class groups adjusted OpenGL ES 3.1 Shader Image Load
181e5c31af7Sopenharmony_ci *         Store Tests. These tests cover following features of OpenGL
182e5c31af7Sopenharmony_ci *         ES 3.1 which were included to OpenGL 4.5 as a compatibility
183e5c31af7Sopenharmony_ci *         enhancement:
184e5c31af7Sopenharmony_ci *
185e5c31af7Sopenharmony_ci *          -  a MemoryBarrierByRegion API,
186e5c31af7Sopenharmony_ci *          -  a GLSL built-in function imageAtomicExchange,
187e5c31af7Sopenharmony_ci *          -  a set of new GLSL built-in constants (gl_Max*ImageUniforms,
188e5c31af7Sopenharmony_ci *             gl_MaxCombinedShaderOutputResources)
189e5c31af7Sopenharmony_ci *          -  a "coherent" qualifier related to variables taken by the GLSL atomic*
190e5c31af7Sopenharmony_ci *             and imageAtomic* functions.
191e5c31af7Sopenharmony_ci */
192e5c31af7Sopenharmony_ciclass ShaderImageLoadStoreTests : public deqp::TestCaseGroup
193e5c31af7Sopenharmony_ci{
194e5c31af7Sopenharmony_cipublic:
195e5c31af7Sopenharmony_ci	ShaderImageLoadStoreTests(deqp::Context& context);
196e5c31af7Sopenharmony_ci	~ShaderImageLoadStoreTests(void);
197e5c31af7Sopenharmony_ci
198e5c31af7Sopenharmony_ci	void init(void);
199e5c31af7Sopenharmony_ci
200e5c31af7Sopenharmony_ciprivate:
201e5c31af7Sopenharmony_ci	ShaderImageLoadStoreTests(const ShaderImageLoadStoreTests& other);
202e5c31af7Sopenharmony_ci	ShaderImageLoadStoreTests& operator=(const ShaderImageLoadStoreTests& other);
203e5c31af7Sopenharmony_ci};
204e5c31af7Sopenharmony_ci
205e5c31af7Sopenharmony_ci/* ShaderImageLoadStoreTests class */
206e5c31af7Sopenharmony_ci
207e5c31af7Sopenharmony_ci/** @class ShaderStorageBufferObjectTests
208e5c31af7Sopenharmony_ci *
209e5c31af7Sopenharmony_ci *  @brief This class contains adjusted OpenGL ES 3.1 Shader Storage
210e5c31af7Sopenharmony_ci *         Buffer Object Tests. These tests cover minimum required
211e5c31af7Sopenharmony_ci *         size of SSBOs to 2^27 (128 MB) and its general functionality
212e5c31af7Sopenharmony_ci *         included in OpenGL ES 3.1 and in new compatibility feature
213e5c31af7Sopenharmony_ci *         of OpenGL 4.5.
214e5c31af7Sopenharmony_ci */
215e5c31af7Sopenharmony_ciclass ShaderStorageBufferObjectTests : public deqp::TestCaseGroup
216e5c31af7Sopenharmony_ci{
217e5c31af7Sopenharmony_cipublic:
218e5c31af7Sopenharmony_ci	ShaderStorageBufferObjectTests(deqp::Context& context);
219e5c31af7Sopenharmony_ci	~ShaderStorageBufferObjectTests(void);
220e5c31af7Sopenharmony_ci
221e5c31af7Sopenharmony_ci	void init(void);
222e5c31af7Sopenharmony_ci
223e5c31af7Sopenharmony_ciprivate:
224e5c31af7Sopenharmony_ci	ShaderStorageBufferObjectTests(const ShaderStorageBufferObjectTests& other);
225e5c31af7Sopenharmony_ci	ShaderStorageBufferObjectTests& operator=(const ShaderStorageBufferObjectTests& other);
226e5c31af7Sopenharmony_ci};
227e5c31af7Sopenharmony_ci
228e5c31af7Sopenharmony_ci/* ShaderStorageBufferObjectTests class */
229e5c31af7Sopenharmony_ci} /* es31compatibility namespace */
230e5c31af7Sopenharmony_ci} /* gl4cts namespace */
231e5c31af7Sopenharmony_ci
232e5c31af7Sopenharmony_ci#endif // _GL4CES31COMPATIBILITYTESTS_HPP
233