1e5c31af7Sopenharmony_ci/*-------------------------------------------------------------------------
2e5c31af7Sopenharmony_ci * OpenGL Conformance Test Suite
3e5c31af7Sopenharmony_ci * -----------------------------
4e5c31af7Sopenharmony_ci *
5e5c31af7Sopenharmony_ci * Copyright (c) 2015-2016 The Khronos Group Inc.
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
8e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License.
9e5c31af7Sopenharmony_ci * You may obtain a copy of the License at
10e5c31af7Sopenharmony_ci *
11e5c31af7Sopenharmony_ci *      http://www.apache.org/licenses/LICENSE-2.0
12e5c31af7Sopenharmony_ci *
13e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
14e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
15e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and
17e5c31af7Sopenharmony_ci * limitations under the License.
18e5c31af7Sopenharmony_ci *
19e5c31af7Sopenharmony_ci */ /*!
20e5c31af7Sopenharmony_ci * \file
21e5c31af7Sopenharmony_ci * \brief
22e5c31af7Sopenharmony_ci */ /*-------------------------------------------------------------------*/
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ci/* Includes. */
25e5c31af7Sopenharmony_ci#include "gl4cES31CompatibilityTests.hpp"
26e5c31af7Sopenharmony_ci#include "gluContextInfo.hpp"
27e5c31af7Sopenharmony_ci#include "gluDefs.hpp"
28e5c31af7Sopenharmony_ci#include "gluRenderContext.hpp"
29e5c31af7Sopenharmony_ci#include "gluStrUtil.hpp"
30e5c31af7Sopenharmony_ci#include "tcuTestLog.hpp"
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_ci/******************************** Test Group Implementation       ********************************/
33e5c31af7Sopenharmony_ci
34e5c31af7Sopenharmony_ci/** @brief ES3.1 Compatibility tests group constructor.
35e5c31af7Sopenharmony_ci *
36e5c31af7Sopenharmony_ci *  @param [in] context     OpenGL context.
37e5c31af7Sopenharmony_ci */
38e5c31af7Sopenharmony_cigl4cts::es31compatibility::Tests::Tests(deqp::Context& context)
39e5c31af7Sopenharmony_ci	: TestCaseGroup(context, "es_31_compatibility", "ES3.1 Compatibility Test Suite")
40e5c31af7Sopenharmony_ci{
41e5c31af7Sopenharmony_ci	/* Intentionally left blank */
42e5c31af7Sopenharmony_ci}
43e5c31af7Sopenharmony_ci
44e5c31af7Sopenharmony_ci/** @brief ES3.1 Compatibility Tests initializer. */
45e5c31af7Sopenharmony_civoid gl4cts::es31compatibility::Tests::init()
46e5c31af7Sopenharmony_ci{
47e5c31af7Sopenharmony_ci	/* New tests. */
48e5c31af7Sopenharmony_ci	addChild(new gl4cts::es31compatibility::ShaderCompilationCompatibilityTests(m_context));
49e5c31af7Sopenharmony_ci	addChild(new gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest(m_context));
50e5c31af7Sopenharmony_ci
51e5c31af7Sopenharmony_ci	/* Ported tests. */
52e5c31af7Sopenharmony_ci	addChild(new gl4cts::es31compatibility::SampleVariablesTests(m_context, glu::GLSL_VERSION_310_ES));
53e5c31af7Sopenharmony_ci	addChild(new gl4cts::es31compatibility::ShaderImageLoadStoreTests(m_context));
54e5c31af7Sopenharmony_ci	addChild(new gl4cts::es31compatibility::ShaderStorageBufferObjectTests(m_context));
55e5c31af7Sopenharmony_ci}
56e5c31af7Sopenharmony_ci
57e5c31af7Sopenharmony_ci/******************************** Shader Compilation Compatibility Tests Implementation   ********************************/
58e5c31af7Sopenharmony_ci
59e5c31af7Sopenharmony_ci/** @brief ShaderCompilationCompatibilityTests constructor.
60e5c31af7Sopenharmony_ci *
61e5c31af7Sopenharmony_ci *  @param [in] context     OpenGL context.
62e5c31af7Sopenharmony_ci */
63e5c31af7Sopenharmony_cigl4cts::es31compatibility::ShaderCompilationCompatibilityTests::ShaderCompilationCompatibilityTests(
64e5c31af7Sopenharmony_ci	deqp::Context& context)
65e5c31af7Sopenharmony_ci	: deqp::TestCase(context, "shader_compilation", "Shader Compilation Compatibility Test")
66e5c31af7Sopenharmony_ci{
67e5c31af7Sopenharmony_ci}
68e5c31af7Sopenharmony_ci
69e5c31af7Sopenharmony_ci/** @brief ShaderCompilationCompatibilityTests test cases iterations.
70e5c31af7Sopenharmony_ci */
71e5c31af7Sopenharmony_citcu::TestNode::IterateResult gl4cts::es31compatibility::ShaderCompilationCompatibilityTests::iterate()
72e5c31af7Sopenharmony_ci{
73e5c31af7Sopenharmony_ci	/* Shortcut for GL functionality. */
74e5c31af7Sopenharmony_ci	const glw::Functions& gl = m_context.getRenderContext().getFunctions();
75e5c31af7Sopenharmony_ci
76e5c31af7Sopenharmony_ci	/* OpenGL support query. */
77e5c31af7Sopenharmony_ci	bool is_at_least_gl_45 = (glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5)));
78e5c31af7Sopenharmony_ci	bool is_arb_es31_compatibility = m_context.getContextInfo().isExtensionSupported("GL_ARB_ES3_1_compatibility");
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ci	/* Running tests. */
81e5c31af7Sopenharmony_ci	bool is_ok	= true;
82e5c31af7Sopenharmony_ci	bool is_error = false;
83e5c31af7Sopenharmony_ci
84e5c31af7Sopenharmony_ci	glw::GLuint shader = 0;
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ci	/* Test */
87e5c31af7Sopenharmony_ci	try
88e5c31af7Sopenharmony_ci	{
89e5c31af7Sopenharmony_ci		if (is_at_least_gl_45 || is_arb_es31_compatibility)
90e5c31af7Sopenharmony_ci		{
91e5c31af7Sopenharmony_ci			for (glw::GLsizei i = 0; i < s_shaders_count; ++i)
92e5c31af7Sopenharmony_ci			{
93e5c31af7Sopenharmony_ci				/* Shader compilation. */
94e5c31af7Sopenharmony_ci				shader = gl.createShader(s_shaders[i].type);
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glCreateShader call failed.");
97e5c31af7Sopenharmony_ci
98e5c31af7Sopenharmony_ci				if (0 == shader)
99e5c31af7Sopenharmony_ci				{
100e5c31af7Sopenharmony_ci					throw 0;
101e5c31af7Sopenharmony_ci				}
102e5c31af7Sopenharmony_ci
103e5c31af7Sopenharmony_ci				gl.shaderSource(shader, 1, &(s_shaders[i].source), NULL);
104e5c31af7Sopenharmony_ci
105e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glShaderSource call failed.");
106e5c31af7Sopenharmony_ci
107e5c31af7Sopenharmony_ci				gl.compileShader(shader);
108e5c31af7Sopenharmony_ci
109e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glCompileShader call failed.");
110e5c31af7Sopenharmony_ci
111e5c31af7Sopenharmony_ci				/* Checking for errors. */
112e5c31af7Sopenharmony_ci				glw::GLint status = GL_FALSE;
113e5c31af7Sopenharmony_ci
114e5c31af7Sopenharmony_ci				gl.getShaderiv(shader, GL_COMPILE_STATUS, &status);
115e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderiv call failed.");
116e5c31af7Sopenharmony_ci
117e5c31af7Sopenharmony_ci				if (GL_FALSE == status)
118e5c31af7Sopenharmony_ci				{
119e5c31af7Sopenharmony_ci					/* Setup result. */
120e5c31af7Sopenharmony_ci					is_ok = false;
121e5c31af7Sopenharmony_ci
122e5c31af7Sopenharmony_ci					/* Getting compilation informations. */
123e5c31af7Sopenharmony_ci					glw::GLint log_size = 0;
124e5c31af7Sopenharmony_ci
125e5c31af7Sopenharmony_ci					gl.getShaderiv(shader, GL_INFO_LOG_LENGTH, &log_size);
126e5c31af7Sopenharmony_ci
127e5c31af7Sopenharmony_ci					GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderiv() call failed.");
128e5c31af7Sopenharmony_ci
129e5c31af7Sopenharmony_ci					if (log_size)
130e5c31af7Sopenharmony_ci					{
131e5c31af7Sopenharmony_ci						glw::GLchar* log = new glw::GLchar[log_size];
132e5c31af7Sopenharmony_ci
133e5c31af7Sopenharmony_ci						if (log)
134e5c31af7Sopenharmony_ci						{
135e5c31af7Sopenharmony_ci							memset(log, 0, log_size);
136e5c31af7Sopenharmony_ci
137e5c31af7Sopenharmony_ci							gl.getShaderInfoLog(shader, log_size, DE_NULL, log);
138e5c31af7Sopenharmony_ci
139e5c31af7Sopenharmony_ci							/* Logging. */
140e5c31af7Sopenharmony_ci							m_context.getTestContext().getLog() << tcu::TestLog::Message << "Compilation of "
141e5c31af7Sopenharmony_ci																<< s_shaders[i].type_name
142e5c31af7Sopenharmony_ci																<< " shader have failed.\n Shader source was:\n"
143e5c31af7Sopenharmony_ci																<< s_shaders[i].source << "\nCompillation log:\n"
144e5c31af7Sopenharmony_ci																<< log << tcu::TestLog::EndMessage;
145e5c31af7Sopenharmony_ci
146e5c31af7Sopenharmony_ci							delete[] log;
147e5c31af7Sopenharmony_ci
148e5c31af7Sopenharmony_ci							GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderInfoLog() call failed.");
149e5c31af7Sopenharmony_ci						}
150e5c31af7Sopenharmony_ci					}
151e5c31af7Sopenharmony_ci				}
152e5c31af7Sopenharmony_ci
153e5c31af7Sopenharmony_ci				/* Cleanup. */
154e5c31af7Sopenharmony_ci				gl.deleteShader(shader);
155e5c31af7Sopenharmony_ci
156e5c31af7Sopenharmony_ci				shader = 0;
157e5c31af7Sopenharmony_ci
158e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glDeleteShader call failed.");
159e5c31af7Sopenharmony_ci			}
160e5c31af7Sopenharmony_ci		}
161e5c31af7Sopenharmony_ci	}
162e5c31af7Sopenharmony_ci	catch (...)
163e5c31af7Sopenharmony_ci	{
164e5c31af7Sopenharmony_ci		is_ok	= false;
165e5c31af7Sopenharmony_ci		is_error = true;
166e5c31af7Sopenharmony_ci	}
167e5c31af7Sopenharmony_ci
168e5c31af7Sopenharmony_ci	/* Cleanup. */
169e5c31af7Sopenharmony_ci	if (0 != shader)
170e5c31af7Sopenharmony_ci	{
171e5c31af7Sopenharmony_ci		gl.deleteShader(shader);
172e5c31af7Sopenharmony_ci
173e5c31af7Sopenharmony_ci		shader = 0;
174e5c31af7Sopenharmony_ci	}
175e5c31af7Sopenharmony_ci
176e5c31af7Sopenharmony_ci	/* Result's setup and logging. */
177e5c31af7Sopenharmony_ci	if (is_ok)
178e5c31af7Sopenharmony_ci	{
179e5c31af7Sopenharmony_ci		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
180e5c31af7Sopenharmony_ci	}
181e5c31af7Sopenharmony_ci	else
182e5c31af7Sopenharmony_ci	{
183e5c31af7Sopenharmony_ci		if (is_error)
184e5c31af7Sopenharmony_ci		{
185e5c31af7Sopenharmony_ci			m_context.getTestContext().getLog() << tcu::TestLog::Message
186e5c31af7Sopenharmony_ci												<< "Internal error has occured during the Shader Version Test."
187e5c31af7Sopenharmony_ci												<< tcu::TestLog::EndMessage;
188e5c31af7Sopenharmony_ci
189e5c31af7Sopenharmony_ci			m_testCtx.setTestResult(QP_TEST_RESULT_INTERNAL_ERROR, "Test error.");
190e5c31af7Sopenharmony_ci		}
191e5c31af7Sopenharmony_ci		else
192e5c31af7Sopenharmony_ci		{
193e5c31af7Sopenharmony_ci			m_context.getTestContext().getLog() << tcu::TestLog::Message << "The Shader Version Test has failed."
194e5c31af7Sopenharmony_ci												<< tcu::TestLog::EndMessage;
195e5c31af7Sopenharmony_ci
196e5c31af7Sopenharmony_ci			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
197e5c31af7Sopenharmony_ci		}
198e5c31af7Sopenharmony_ci	}
199e5c31af7Sopenharmony_ci
200e5c31af7Sopenharmony_ci	return STOP;
201e5c31af7Sopenharmony_ci}
202e5c31af7Sopenharmony_ci
203e5c31af7Sopenharmony_ciconst gl4cts::es31compatibility::ShaderCompilationCompatibilityTests::TestShader
204e5c31af7Sopenharmony_ci	gl4cts::es31compatibility::ShaderCompilationCompatibilityTests::s_shaders[] = {
205e5c31af7Sopenharmony_ci		{ /* Shader for testing ES 3.1 version string support.*/
206e5c31af7Sopenharmony_ci		  GL_VERTEX_SHADER, "vertex", "#version 310 es\n"
207e5c31af7Sopenharmony_ci									  "\n"
208e5c31af7Sopenharmony_ci									  "void main()\n"
209e5c31af7Sopenharmony_ci									  "{\n"
210e5c31af7Sopenharmony_ci									  "    gl_Position = vec4(1.0);\n"
211e5c31af7Sopenharmony_ci									  "}\n" },
212e5c31af7Sopenharmony_ci		{ /* Shader for testing ES 3.1 version string support.*/
213e5c31af7Sopenharmony_ci		  GL_FRAGMENT_SHADER, "fragment", "#version 310 es\n"
214e5c31af7Sopenharmony_ci										  "\n"
215e5c31af7Sopenharmony_ci										  "out highp vec4 color;"
216e5c31af7Sopenharmony_ci										  "\n"
217e5c31af7Sopenharmony_ci										  "void main()\n"
218e5c31af7Sopenharmony_ci										  "{\n"
219e5c31af7Sopenharmony_ci										  "    color = vec4(1.0);\n"
220e5c31af7Sopenharmony_ci										  "}\n" },
221e5c31af7Sopenharmony_ci		{ /* Shader for testing that gl_HelperInvocation variable is supported.*/
222e5c31af7Sopenharmony_ci		  GL_FRAGMENT_SHADER, "fragment", "#version 310 es\n"
223e5c31af7Sopenharmony_ci										  "\n"
224e5c31af7Sopenharmony_ci										  "out highp vec4 color;"
225e5c31af7Sopenharmony_ci										  "\n"
226e5c31af7Sopenharmony_ci										  "void main()\n"
227e5c31af7Sopenharmony_ci										  "{\n"
228e5c31af7Sopenharmony_ci										  "    if(gl_HelperInvocation)\n"
229e5c31af7Sopenharmony_ci										  "    {\n"
230e5c31af7Sopenharmony_ci										  "        color = vec4(1.0);\n"
231e5c31af7Sopenharmony_ci										  "    }\n"
232e5c31af7Sopenharmony_ci										  "    else\n"
233e5c31af7Sopenharmony_ci										  "    {\n"
234e5c31af7Sopenharmony_ci										  "        color = vec4(0.0);\n"
235e5c31af7Sopenharmony_ci										  "    }\n"
236e5c31af7Sopenharmony_ci										  "}\n" },
237e5c31af7Sopenharmony_ci		{ /* Shader for testing ES 3.1 version string support.*/
238e5c31af7Sopenharmony_ci		  GL_COMPUTE_SHADER, "compute",
239e5c31af7Sopenharmony_ci		  "#version 310 es\n"
240e5c31af7Sopenharmony_ci		  "\n"
241e5c31af7Sopenharmony_ci		  "layout(local_size_x = 128) in;\n"
242e5c31af7Sopenharmony_ci		  "layout(std140, binding = 0) buffer Output\n"
243e5c31af7Sopenharmony_ci		  "{\n"
244e5c31af7Sopenharmony_ci		  "    uint elements[];\n"
245e5c31af7Sopenharmony_ci		  "} output_data;\n"
246e5c31af7Sopenharmony_ci		  "\n"
247e5c31af7Sopenharmony_ci		  "void main()\n"
248e5c31af7Sopenharmony_ci		  "{\n"
249e5c31af7Sopenharmony_ci		  "    output_data.elements[gl_GlobalInvocationID.x] = gl_GlobalInvocationID.x * gl_GlobalInvocationID.x;\n"
250e5c31af7Sopenharmony_ci		  "}\n" }
251e5c31af7Sopenharmony_ci	};
252e5c31af7Sopenharmony_ci
253e5c31af7Sopenharmony_ciconst glw::GLsizei gl4cts::es31compatibility::ShaderCompilationCompatibilityTests::s_shaders_count =
254e5c31af7Sopenharmony_ci	sizeof(s_shaders) / sizeof(s_shaders[0]);
255e5c31af7Sopenharmony_ci
256e5c31af7Sopenharmony_ci/******************************** Shader Functional Compatibility Test Implementation   ********************************/
257e5c31af7Sopenharmony_ci
258e5c31af7Sopenharmony_ci/** @brief Shader Functional Compatibility Test constructor.
259e5c31af7Sopenharmony_ci *
260e5c31af7Sopenharmony_ci *  @param [in] context     OpenGL context.
261e5c31af7Sopenharmony_ci */
262e5c31af7Sopenharmony_cigl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::ShaderFunctionalCompatibilityTest(deqp::Context& context)
263e5c31af7Sopenharmony_ci	: deqp::TestCase(context, "shader_functional", "Shader Functional Compatibility Test")
264e5c31af7Sopenharmony_ci	, m_po_id(0)
265e5c31af7Sopenharmony_ci	, m_fbo_id(0)
266e5c31af7Sopenharmony_ci	, m_rbo_id(0)
267e5c31af7Sopenharmony_ci	, m_vao_id(0)
268e5c31af7Sopenharmony_ci{
269e5c31af7Sopenharmony_ci}
270e5c31af7Sopenharmony_ci
271e5c31af7Sopenharmony_ci/** @brief ShaderCompilationCompatibilityTests test cases iterations.
272e5c31af7Sopenharmony_ci */
273e5c31af7Sopenharmony_citcu::TestNode::IterateResult gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::iterate()
274e5c31af7Sopenharmony_ci{
275e5c31af7Sopenharmony_ci	/* OpenGL support query. */
276e5c31af7Sopenharmony_ci	bool is_at_least_gl_45 = (glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5)));
277e5c31af7Sopenharmony_ci	bool is_arb_es31_compatibility = m_context.getContextInfo().isExtensionSupported("GL_ARB_ES3_1_compatibility");
278e5c31af7Sopenharmony_ci
279e5c31af7Sopenharmony_ci	/* Running tests. */
280e5c31af7Sopenharmony_ci	bool is_ok	= true;
281e5c31af7Sopenharmony_ci	bool is_error = false;
282e5c31af7Sopenharmony_ci
283e5c31af7Sopenharmony_ci	/* Test */
284e5c31af7Sopenharmony_ci	try
285e5c31af7Sopenharmony_ci	{
286e5c31af7Sopenharmony_ci		if (is_at_least_gl_45 || is_arb_es31_compatibility)
287e5c31af7Sopenharmony_ci		{
288e5c31af7Sopenharmony_ci			createFramebufferAndVertexArrayObject();
289e5c31af7Sopenharmony_ci
290e5c31af7Sopenharmony_ci			for (glw::GLsizei i = 0; i < s_shaders_count; ++i)
291e5c31af7Sopenharmony_ci			{
292e5c31af7Sopenharmony_ci				if (!createProgram(s_shaders[i]))
293e5c31af7Sopenharmony_ci				{
294e5c31af7Sopenharmony_ci					is_ok = false;
295e5c31af7Sopenharmony_ci
296e5c31af7Sopenharmony_ci					continue; /* if createProgram failed we shall omit this iteration */
297e5c31af7Sopenharmony_ci				}
298e5c31af7Sopenharmony_ci
299e5c31af7Sopenharmony_ci				is_ok &= test();
300e5c31af7Sopenharmony_ci
301e5c31af7Sopenharmony_ci				cleanProgram();
302e5c31af7Sopenharmony_ci			}
303e5c31af7Sopenharmony_ci
304e5c31af7Sopenharmony_ci			cleanFramebufferAndVertexArrayObject();
305e5c31af7Sopenharmony_ci		}
306e5c31af7Sopenharmony_ci	}
307e5c31af7Sopenharmony_ci	catch (...)
308e5c31af7Sopenharmony_ci	{
309e5c31af7Sopenharmony_ci		/* Result setup. */
310e5c31af7Sopenharmony_ci		is_ok	= false;
311e5c31af7Sopenharmony_ci		is_error = true;
312e5c31af7Sopenharmony_ci
313e5c31af7Sopenharmony_ci		/* Cleanup. */
314e5c31af7Sopenharmony_ci		cleanProgram();
315e5c31af7Sopenharmony_ci		cleanFramebufferAndVertexArrayObject();
316e5c31af7Sopenharmony_ci	}
317e5c31af7Sopenharmony_ci
318e5c31af7Sopenharmony_ci	/* Result's setup. */
319e5c31af7Sopenharmony_ci	if (is_ok)
320e5c31af7Sopenharmony_ci	{
321e5c31af7Sopenharmony_ci		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
322e5c31af7Sopenharmony_ci	}
323e5c31af7Sopenharmony_ci	else
324e5c31af7Sopenharmony_ci	{
325e5c31af7Sopenharmony_ci		if (is_error)
326e5c31af7Sopenharmony_ci		{
327e5c31af7Sopenharmony_ci			m_context.getTestContext().getLog() << tcu::TestLog::Message
328e5c31af7Sopenharmony_ci												<< "Internal error has occured during the Shader Version Test."
329e5c31af7Sopenharmony_ci												<< tcu::TestLog::EndMessage;
330e5c31af7Sopenharmony_ci
331e5c31af7Sopenharmony_ci			m_testCtx.setTestResult(QP_TEST_RESULT_INTERNAL_ERROR, "Test error.");
332e5c31af7Sopenharmony_ci		}
333e5c31af7Sopenharmony_ci		else
334e5c31af7Sopenharmony_ci		{
335e5c31af7Sopenharmony_ci			m_context.getTestContext().getLog() << tcu::TestLog::Message << "The Shader Version Test has failed."
336e5c31af7Sopenharmony_ci												<< tcu::TestLog::EndMessage;
337e5c31af7Sopenharmony_ci
338e5c31af7Sopenharmony_ci			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
339e5c31af7Sopenharmony_ci		}
340e5c31af7Sopenharmony_ci	}
341e5c31af7Sopenharmony_ci
342e5c31af7Sopenharmony_ci	return STOP;
343e5c31af7Sopenharmony_ci}
344e5c31af7Sopenharmony_ci
345e5c31af7Sopenharmony_ci/** @brief Create program object
346e5c31af7Sopenharmony_ci *
347e5c31af7Sopenharmony_ci *  @note Program object is going to be stored into m_po_id.
348e5c31af7Sopenharmony_ci *        If building succeeded program will be set current (glUseProgram).
349e5c31af7Sopenharmony_ci *
350e5c31af7Sopenharmony_ci *  @param [in] shader_source   Shader source to be builded.
351e5c31af7Sopenharmony_ci *
352e5c31af7Sopenharmony_ci *  @return True if succeeded, false otherwise.
353e5c31af7Sopenharmony_ci */
354e5c31af7Sopenharmony_cibool gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::createProgram(const struct Shader shader_source)
355e5c31af7Sopenharmony_ci{
356e5c31af7Sopenharmony_ci	/* Shortcut for GL functionality. */
357e5c31af7Sopenharmony_ci	const glw::Functions& gl = m_context.getRenderContext().getFunctions();
358e5c31af7Sopenharmony_ci
359e5c31af7Sopenharmony_ci	struct _Shader
360e5c31af7Sopenharmony_ci	{
361e5c31af7Sopenharmony_ci		const glw::GLchar* const* source;
362e5c31af7Sopenharmony_ci		const glw::GLenum		  type;
363e5c31af7Sopenharmony_ci		glw::GLuint				  id;
364e5c31af7Sopenharmony_ci	} shader[] = { { shader_source.vertex, GL_VERTEX_SHADER, 0 }, { shader_source.fragment, GL_FRAGMENT_SHADER, 0 } };
365e5c31af7Sopenharmony_ci
366e5c31af7Sopenharmony_ci	glw::GLuint const shader_count = sizeof(shader) / sizeof(shader[0]);
367e5c31af7Sopenharmony_ci
368e5c31af7Sopenharmony_ci	try
369e5c31af7Sopenharmony_ci	{
370e5c31af7Sopenharmony_ci		/* Make sure m_po_id is cleaned. */
371e5c31af7Sopenharmony_ci		if (m_po_id)
372e5c31af7Sopenharmony_ci		{
373e5c31af7Sopenharmony_ci			cleanProgram();
374e5c31af7Sopenharmony_ci		}
375e5c31af7Sopenharmony_ci
376e5c31af7Sopenharmony_ci		/* Create program. */
377e5c31af7Sopenharmony_ci		m_po_id = gl.createProgram();
378e5c31af7Sopenharmony_ci		GLU_EXPECT_NO_ERROR(gl.getError(), "glCreateProgram call failed.");
379e5c31af7Sopenharmony_ci
380e5c31af7Sopenharmony_ci		/* Shader compilation. */
381e5c31af7Sopenharmony_ci
382e5c31af7Sopenharmony_ci		for (glw::GLuint i = 0; i < shader_count; ++i)
383e5c31af7Sopenharmony_ci		{
384e5c31af7Sopenharmony_ci			if (DE_NULL != shader[i].source)
385e5c31af7Sopenharmony_ci			{
386e5c31af7Sopenharmony_ci				shader[i].id = gl.createShader(shader[i].type);
387e5c31af7Sopenharmony_ci
388e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glCreateShader call failed.");
389e5c31af7Sopenharmony_ci
390e5c31af7Sopenharmony_ci				gl.attachShader(m_po_id, shader[i].id);
391e5c31af7Sopenharmony_ci
392e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glAttachShader call failed.");
393e5c31af7Sopenharmony_ci
394e5c31af7Sopenharmony_ci				gl.shaderSource(shader[i].id, 3, shader[i].source, NULL);
395e5c31af7Sopenharmony_ci
396e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glShaderSource call failed.");
397e5c31af7Sopenharmony_ci
398e5c31af7Sopenharmony_ci				gl.compileShader(shader[i].id);
399e5c31af7Sopenharmony_ci
400e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glCompileShader call failed.");
401e5c31af7Sopenharmony_ci
402e5c31af7Sopenharmony_ci				glw::GLint status = GL_FALSE;
403e5c31af7Sopenharmony_ci
404e5c31af7Sopenharmony_ci				gl.getShaderiv(shader[i].id, GL_COMPILE_STATUS, &status);
405e5c31af7Sopenharmony_ci				GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderiv call failed.");
406e5c31af7Sopenharmony_ci
407e5c31af7Sopenharmony_ci				if (GL_FALSE == status)
408e5c31af7Sopenharmony_ci				{
409e5c31af7Sopenharmony_ci					glw::GLint log_size = 0;
410e5c31af7Sopenharmony_ci
411e5c31af7Sopenharmony_ci					gl.getShaderiv(shader[i].id, GL_INFO_LOG_LENGTH, &log_size);
412e5c31af7Sopenharmony_ci
413e5c31af7Sopenharmony_ci					GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderiv() call failed.");
414e5c31af7Sopenharmony_ci
415e5c31af7Sopenharmony_ci					if (log_size)
416e5c31af7Sopenharmony_ci					{
417e5c31af7Sopenharmony_ci						glw::GLchar* log = new glw::GLchar[log_size];
418e5c31af7Sopenharmony_ci
419e5c31af7Sopenharmony_ci						if (log)
420e5c31af7Sopenharmony_ci						{
421e5c31af7Sopenharmony_ci							memset(log, 0, log_size);
422e5c31af7Sopenharmony_ci
423e5c31af7Sopenharmony_ci							gl.getShaderInfoLog(shader[i].id, log_size, DE_NULL, log);
424e5c31af7Sopenharmony_ci
425e5c31af7Sopenharmony_ci							m_context.getTestContext().getLog()
426e5c31af7Sopenharmony_ci								<< tcu::TestLog::Message << "Compilation of shader has failed.\nShader source:\n"
427e5c31af7Sopenharmony_ci								<< shader[i].source[0] << shader[i].source[1] << shader[i].source[2]
428e5c31af7Sopenharmony_ci								<< "\nCompillation log:\n"
429e5c31af7Sopenharmony_ci								<< log << tcu::TestLog::EndMessage;
430e5c31af7Sopenharmony_ci
431e5c31af7Sopenharmony_ci							delete[] log;
432e5c31af7Sopenharmony_ci
433e5c31af7Sopenharmony_ci							GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderInfoLog() call failed.");
434e5c31af7Sopenharmony_ci						}
435e5c31af7Sopenharmony_ci					}
436e5c31af7Sopenharmony_ci
437e5c31af7Sopenharmony_ci					throw 0;
438e5c31af7Sopenharmony_ci				}
439e5c31af7Sopenharmony_ci			}
440e5c31af7Sopenharmony_ci		}
441e5c31af7Sopenharmony_ci
442e5c31af7Sopenharmony_ci		/* Link. */
443e5c31af7Sopenharmony_ci		gl.linkProgram(m_po_id);
444e5c31af7Sopenharmony_ci
445e5c31af7Sopenharmony_ci		GLU_EXPECT_NO_ERROR(gl.getError(), "glLinkProgram call failed.");
446e5c31af7Sopenharmony_ci
447e5c31af7Sopenharmony_ci		glw::GLint status = GL_FALSE;
448e5c31af7Sopenharmony_ci
449e5c31af7Sopenharmony_ci		gl.getProgramiv(m_po_id, GL_LINK_STATUS, &status);
450e5c31af7Sopenharmony_ci
451e5c31af7Sopenharmony_ci		if (GL_TRUE == status)
452e5c31af7Sopenharmony_ci		{
453e5c31af7Sopenharmony_ci			for (glw::GLuint i = 0; i < shader_count; ++i)
454e5c31af7Sopenharmony_ci			{
455e5c31af7Sopenharmony_ci				if (shader[i].id)
456e5c31af7Sopenharmony_ci				{
457e5c31af7Sopenharmony_ci					gl.detachShader(m_po_id, shader[i].id);
458e5c31af7Sopenharmony_ci
459e5c31af7Sopenharmony_ci					GLU_EXPECT_NO_ERROR(gl.getError(), "glDetachShader call failed.");
460e5c31af7Sopenharmony_ci				}
461e5c31af7Sopenharmony_ci			}
462e5c31af7Sopenharmony_ci		}
463e5c31af7Sopenharmony_ci		else
464e5c31af7Sopenharmony_ci		{
465e5c31af7Sopenharmony_ci			glw::GLint log_size = 0;
466e5c31af7Sopenharmony_ci
467e5c31af7Sopenharmony_ci			gl.getProgramiv(m_po_id, GL_INFO_LOG_LENGTH, &log_size);
468e5c31af7Sopenharmony_ci
469e5c31af7Sopenharmony_ci			GLU_EXPECT_NO_ERROR(gl.getError(), "glGetProgramiv() call failed.");
470e5c31af7Sopenharmony_ci
471e5c31af7Sopenharmony_ci			if (log_size)
472e5c31af7Sopenharmony_ci			{
473e5c31af7Sopenharmony_ci				glw::GLchar* log = new glw::GLchar[log_size];
474e5c31af7Sopenharmony_ci
475e5c31af7Sopenharmony_ci				if (log)
476e5c31af7Sopenharmony_ci				{
477e5c31af7Sopenharmony_ci					memset(log, 0, log_size);
478e5c31af7Sopenharmony_ci
479e5c31af7Sopenharmony_ci					gl.getProgramInfoLog(m_po_id, log_size, DE_NULL, log);
480e5c31af7Sopenharmony_ci
481e5c31af7Sopenharmony_ci					m_context.getTestContext().getLog() << tcu::TestLog::Message
482e5c31af7Sopenharmony_ci														<< "Linkage of shader program has failed.\nLinkage log:\n"
483e5c31af7Sopenharmony_ci														<< log << tcu::TestLog::EndMessage;
484e5c31af7Sopenharmony_ci
485e5c31af7Sopenharmony_ci					delete[] log;
486e5c31af7Sopenharmony_ci
487e5c31af7Sopenharmony_ci					GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderInfoLog() call failed.");
488e5c31af7Sopenharmony_ci				}
489e5c31af7Sopenharmony_ci			}
490e5c31af7Sopenharmony_ci
491e5c31af7Sopenharmony_ci			throw 0;
492e5c31af7Sopenharmony_ci		}
493e5c31af7Sopenharmony_ci	}
494e5c31af7Sopenharmony_ci	catch (...)
495e5c31af7Sopenharmony_ci	{
496e5c31af7Sopenharmony_ci		if (m_po_id)
497e5c31af7Sopenharmony_ci		{
498e5c31af7Sopenharmony_ci			gl.deleteProgram(m_po_id);
499e5c31af7Sopenharmony_ci
500e5c31af7Sopenharmony_ci			m_po_id = 0;
501e5c31af7Sopenharmony_ci		}
502e5c31af7Sopenharmony_ci	}
503e5c31af7Sopenharmony_ci
504e5c31af7Sopenharmony_ci	for (glw::GLuint i = 0; i < shader_count; ++i)
505e5c31af7Sopenharmony_ci	{
506e5c31af7Sopenharmony_ci		if (0 != shader[i].id)
507e5c31af7Sopenharmony_ci		{
508e5c31af7Sopenharmony_ci			gl.deleteShader(shader[i].id);
509e5c31af7Sopenharmony_ci
510e5c31af7Sopenharmony_ci			shader[i].id = 0;
511e5c31af7Sopenharmony_ci		}
512e5c31af7Sopenharmony_ci	}
513e5c31af7Sopenharmony_ci
514e5c31af7Sopenharmony_ci	if (m_po_id)
515e5c31af7Sopenharmony_ci	{
516e5c31af7Sopenharmony_ci		gl.useProgram(m_po_id);
517e5c31af7Sopenharmony_ci
518e5c31af7Sopenharmony_ci		GLU_EXPECT_NO_ERROR(gl.getError(), "glUseProgram call failed.");
519e5c31af7Sopenharmony_ci
520e5c31af7Sopenharmony_ci		return true;
521e5c31af7Sopenharmony_ci	}
522e5c31af7Sopenharmony_ci
523e5c31af7Sopenharmony_ci	return false;
524e5c31af7Sopenharmony_ci}
525e5c31af7Sopenharmony_ci
526e5c31af7Sopenharmony_ci/** @brief Create framebuffer and vertex array object.
527e5c31af7Sopenharmony_ci *
528e5c31af7Sopenharmony_ci *  @note Frembuffer will be stored in m_fbo_id and m_rbo_id.
529e5c31af7Sopenharmony_ci *        Vertex array object will be stored in m_vao_id.
530e5c31af7Sopenharmony_ci *        Function will throw 0 if erro has occured.
531e5c31af7Sopenharmony_ci */
532e5c31af7Sopenharmony_civoid gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::createFramebufferAndVertexArrayObject()
533e5c31af7Sopenharmony_ci{
534e5c31af7Sopenharmony_ci	/* Shortcut for GL functionality. */
535e5c31af7Sopenharmony_ci	const glw::Functions& gl = m_context.getRenderContext().getFunctions();
536e5c31af7Sopenharmony_ci
537e5c31af7Sopenharmony_ci	/* Prepare framebuffer. */
538e5c31af7Sopenharmony_ci	gl.clearColor(0.0f, 0.0f, 0.0f, 0.0f);
539e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glClearColor call failed.");
540e5c31af7Sopenharmony_ci
541e5c31af7Sopenharmony_ci	gl.genFramebuffers(1, &m_fbo_id);
542e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glGenFramebuffers call failed.");
543e5c31af7Sopenharmony_ci
544e5c31af7Sopenharmony_ci	gl.genRenderbuffers(1, &m_rbo_id);
545e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glGenRenderbuffers call failed.");
546e5c31af7Sopenharmony_ci
547e5c31af7Sopenharmony_ci	gl.bindFramebuffer(GL_FRAMEBUFFER, m_fbo_id);
548e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glBindFramebuffer call failed.");
549e5c31af7Sopenharmony_ci
550e5c31af7Sopenharmony_ci	gl.bindRenderbuffer(GL_RENDERBUFFER, m_rbo_id);
551e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glBindRenderbuffer call failed.");
552e5c31af7Sopenharmony_ci
553e5c31af7Sopenharmony_ci	gl.renderbufferStorage(GL_RENDERBUFFER, GL_R8, 1 /* x size */, 1 /* y size */);
554e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glRenderbufferStorage call failed.");
555e5c31af7Sopenharmony_ci
556e5c31af7Sopenharmony_ci	gl.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_rbo_id);
557e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glFramebufferRenderbuffer call failed.");
558e5c31af7Sopenharmony_ci
559e5c31af7Sopenharmony_ci	/* Check if all went ok. */
560e5c31af7Sopenharmony_ci	if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
561e5c31af7Sopenharmony_ci	{
562e5c31af7Sopenharmony_ci		throw 0;
563e5c31af7Sopenharmony_ci	}
564e5c31af7Sopenharmony_ci
565e5c31af7Sopenharmony_ci	/* View Setup. */
566e5c31af7Sopenharmony_ci	gl.viewport(0, 0, 1 /* x size */, 1 /* y size */);
567e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glViewport call failed.");
568e5c31af7Sopenharmony_ci
569e5c31af7Sopenharmony_ci	/* Create and bind empty vertex array object. */
570e5c31af7Sopenharmony_ci	gl.genVertexArrays(1, &m_vao_id);
571e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glGenVertexArrays() call failed.");
572e5c31af7Sopenharmony_ci
573e5c31af7Sopenharmony_ci	if (0 == m_vao_id)
574e5c31af7Sopenharmony_ci	{
575e5c31af7Sopenharmony_ci		throw 0;
576e5c31af7Sopenharmony_ci	}
577e5c31af7Sopenharmony_ci
578e5c31af7Sopenharmony_ci	gl.bindVertexArray(m_vao_id);
579e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glBindVertexArray() call failed.");
580e5c31af7Sopenharmony_ci}
581e5c31af7Sopenharmony_ci
582e5c31af7Sopenharmony_ci/** @brief Run test case.
583e5c31af7Sopenharmony_ci *
584e5c31af7Sopenharmony_ci *  @note Test case run in following order:
585e5c31af7Sopenharmony_ci *         *  clear screen with 0 value (color setup in createFramebufferAndVertexArrayObject);
586e5c31af7Sopenharmony_ci *         *  draw full screen quad;
587e5c31af7Sopenharmony_ci *         *  fetch pixel from screen using glReadPixel (view is 1x1 pixel in size);
588e5c31af7Sopenharmony_ci *         *  compare results (1.0f is expected as the result of the shader).
589e5c31af7Sopenharmony_ci */
590e5c31af7Sopenharmony_cibool gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::test()
591e5c31af7Sopenharmony_ci{
592e5c31af7Sopenharmony_ci	/* Shortcut for GL functionality. */
593e5c31af7Sopenharmony_ci	const glw::Functions& gl = m_context.getRenderContext().getFunctions();
594e5c31af7Sopenharmony_ci
595e5c31af7Sopenharmony_ci	/* Make sure objects are cleaned. */
596e5c31af7Sopenharmony_ci	if (m_fbo_id || m_rbo_id || m_vao_id)
597e5c31af7Sopenharmony_ci	{
598e5c31af7Sopenharmony_ci		cleanFramebufferAndVertexArrayObject();
599e5c31af7Sopenharmony_ci	}
600e5c31af7Sopenharmony_ci
601e5c31af7Sopenharmony_ci	/* Drawing quad which shall output result. */
602e5c31af7Sopenharmony_ci	gl.clear(GL_COLOR_BUFFER_BIT);
603e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glClear() call failed.");
604e5c31af7Sopenharmony_ci
605e5c31af7Sopenharmony_ci	gl.drawArrays(GL_TRIANGLE_STRIP, 0, 4);
606e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glDrawArrays() call failed.");
607e5c31af7Sopenharmony_ci
608e5c31af7Sopenharmony_ci	/* Fetching result. */
609e5c31af7Sopenharmony_ci	glw::GLfloat red = -1.f;
610e5c31af7Sopenharmony_ci
611e5c31af7Sopenharmony_ci	gl.readPixels(0, 0, 1, 1, GL_RED, GL_FLOAT, &red);
612e5c31af7Sopenharmony_ci	GLU_EXPECT_NO_ERROR(gl.getError(), "glReadPixels() call failed.");
613e5c31af7Sopenharmony_ci
614e5c31af7Sopenharmony_ci	if (de::abs(1.f - red) <= 0.125 /* Precision. */)
615e5c31af7Sopenharmony_ci	{
616e5c31af7Sopenharmony_ci		return true;
617e5c31af7Sopenharmony_ci	}
618e5c31af7Sopenharmony_ci
619e5c31af7Sopenharmony_ci	return false;
620e5c31af7Sopenharmony_ci}
621e5c31af7Sopenharmony_ci
622e5c31af7Sopenharmony_ci/** @brief Release program object.
623e5c31af7Sopenharmony_ci */
624e5c31af7Sopenharmony_civoid gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::cleanProgram()
625e5c31af7Sopenharmony_ci{
626e5c31af7Sopenharmony_ci	/* Shortcut for GL functionality. */
627e5c31af7Sopenharmony_ci	const glw::Functions& gl = m_context.getRenderContext().getFunctions();
628e5c31af7Sopenharmony_ci
629e5c31af7Sopenharmony_ci	/* Deleting program. */
630e5c31af7Sopenharmony_ci	if (m_po_id)
631e5c31af7Sopenharmony_ci	{
632e5c31af7Sopenharmony_ci		gl.useProgram(0);
633e5c31af7Sopenharmony_ci
634e5c31af7Sopenharmony_ci		gl.deleteProgram(m_po_id);
635e5c31af7Sopenharmony_ci
636e5c31af7Sopenharmony_ci		m_po_id = 0;
637e5c31af7Sopenharmony_ci	}
638e5c31af7Sopenharmony_ci}
639e5c31af7Sopenharmony_ci
640e5c31af7Sopenharmony_ci/** @brief Release framebuffer, renderbuffer and vertex array objects.
641e5c31af7Sopenharmony_ci */
642e5c31af7Sopenharmony_civoid gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::cleanFramebufferAndVertexArrayObject()
643e5c31af7Sopenharmony_ci{
644e5c31af7Sopenharmony_ci	/* Shortcut for GL functionality. */
645e5c31af7Sopenharmony_ci	const glw::Functions& gl = m_context.getRenderContext().getFunctions();
646e5c31af7Sopenharmony_ci
647e5c31af7Sopenharmony_ci	/* Deleting view. */
648e5c31af7Sopenharmony_ci	if (m_fbo_id)
649e5c31af7Sopenharmony_ci	{
650e5c31af7Sopenharmony_ci		gl.deleteFramebuffers(1, &m_fbo_id);
651e5c31af7Sopenharmony_ci
652e5c31af7Sopenharmony_ci		m_fbo_id = 0;
653e5c31af7Sopenharmony_ci	}
654e5c31af7Sopenharmony_ci
655e5c31af7Sopenharmony_ci	if (m_rbo_id)
656e5c31af7Sopenharmony_ci	{
657e5c31af7Sopenharmony_ci		gl.deleteRenderbuffers(1, &m_rbo_id);
658e5c31af7Sopenharmony_ci
659e5c31af7Sopenharmony_ci		m_rbo_id = 0;
660e5c31af7Sopenharmony_ci	}
661e5c31af7Sopenharmony_ci
662e5c31af7Sopenharmony_ci	if (m_vao_id)
663e5c31af7Sopenharmony_ci	{
664e5c31af7Sopenharmony_ci		gl.deleteVertexArrays(1, &m_vao_id);
665e5c31af7Sopenharmony_ci
666e5c31af7Sopenharmony_ci		m_vao_id = 0;
667e5c31af7Sopenharmony_ci	}
668e5c31af7Sopenharmony_ci}
669e5c31af7Sopenharmony_ci
670e5c31af7Sopenharmony_ciconst glw::GLchar* gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::s_shader_version = "#version 310 es\n";
671e5c31af7Sopenharmony_ci
672e5c31af7Sopenharmony_ciconst glw::GLchar* gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::s_vertex_shader_body =
673e5c31af7Sopenharmony_ci	"\n"
674e5c31af7Sopenharmony_ci	"out highp float vout;\n"
675e5c31af7Sopenharmony_ci	"\n"
676e5c31af7Sopenharmony_ci	"void main()\n"
677e5c31af7Sopenharmony_ci	"{\n"
678e5c31af7Sopenharmony_ci	"    switch(gl_VertexID % 4)\n"
679e5c31af7Sopenharmony_ci	"    {\n"
680e5c31af7Sopenharmony_ci	"    case 0:\n"
681e5c31af7Sopenharmony_ci	"       gl_Position = vec4(-1.0, -1.0,  0.0,  1.0);\n"
682e5c31af7Sopenharmony_ci	"       break;\n"
683e5c31af7Sopenharmony_ci	"    case 1:\n"
684e5c31af7Sopenharmony_ci	"       gl_Position = vec4( 1.0, -1.0,  0.0,  1.0);\n"
685e5c31af7Sopenharmony_ci	"       break;\n"
686e5c31af7Sopenharmony_ci	"    case 2:\n"
687e5c31af7Sopenharmony_ci	"       gl_Position = vec4(-1.0,  1.0,  0.0,  1.0);\n"
688e5c31af7Sopenharmony_ci	"       break;\n"
689e5c31af7Sopenharmony_ci	"    case 3:\n"
690e5c31af7Sopenharmony_ci	"       gl_Position = vec4( 1.0,  1.0,  0.0,  1.0);\n"
691e5c31af7Sopenharmony_ci	"       break;\n"
692e5c31af7Sopenharmony_ci	"    }\n"
693e5c31af7Sopenharmony_ci	"\n"
694e5c31af7Sopenharmony_ci	"    vout = float(gl_VertexID % 4);\n   /* Always less than 4. */"
695e5c31af7Sopenharmony_ci	"}\n";
696e5c31af7Sopenharmony_ci
697e5c31af7Sopenharmony_ciconst glw::GLchar* gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::s_fragment_shader_body =
698e5c31af7Sopenharmony_ci	"\n"
699e5c31af7Sopenharmony_ci	"in highp float vout;\n"
700e5c31af7Sopenharmony_ci	"\n"
701e5c31af7Sopenharmony_ci	"out highp vec4 result;\n"
702e5c31af7Sopenharmony_ci	"\n"
703e5c31af7Sopenharmony_ci	"void main()\n"
704e5c31af7Sopenharmony_ci	"{\n"
705e5c31af7Sopenharmony_ci	"    TTYPE a = LEFT;\n"
706e5c31af7Sopenharmony_ci	"    TTYPE b = RIGHT;\n"
707e5c31af7Sopenharmony_ci	"    BTYPE c = BDATA && BTYPE(vout < 4.0);\n    /* Making sure that expression is not compile time constant. */"
708e5c31af7Sopenharmony_ci	"\n"
709e5c31af7Sopenharmony_ci	"    TTYPE mixed = mix(a, b, c);\n"
710e5c31af7Sopenharmony_ci	"\n"
711e5c31af7Sopenharmony_ci	"    if(REFERENCE == mixed)\n"
712e5c31af7Sopenharmony_ci	"    {\n"
713e5c31af7Sopenharmony_ci	"        result = vec4(1.0);\n"
714e5c31af7Sopenharmony_ci	"    }\n"
715e5c31af7Sopenharmony_ci	"    else\n"
716e5c31af7Sopenharmony_ci	"    {\n"
717e5c31af7Sopenharmony_ci	"        result = vec4(0.0);\n"
718e5c31af7Sopenharmony_ci	"    }\n"
719e5c31af7Sopenharmony_ci	"}\n";
720e5c31af7Sopenharmony_ci
721e5c31af7Sopenharmony_ciconst struct gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::Shader
722e5c31af7Sopenharmony_ci	gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::s_shaders[] = {
723e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
724e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp int\n"
725e5c31af7Sopenharmony_ci							  "#define BTYPE        bool\n"
726e5c31af7Sopenharmony_ci							  "#define LEFT        -1\n"
727e5c31af7Sopenharmony_ci							  "#define RIGHT       -2\n"
728e5c31af7Sopenharmony_ci							  "#define BDATA        true\n"
729e5c31af7Sopenharmony_ci							  "#define REFERENCE   -2\n",
730e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
731e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
732e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp uint\n"
733e5c31af7Sopenharmony_ci							  "#define BTYPE        bool\n"
734e5c31af7Sopenharmony_ci							  "#define LEFT         1u\n"
735e5c31af7Sopenharmony_ci							  "#define RIGHT        2u\n"
736e5c31af7Sopenharmony_ci							  "#define BDATA        true\n"
737e5c31af7Sopenharmony_ci							  "#define REFERENCE    2u\n",
738e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
739e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
740e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump int\n"
741e5c31af7Sopenharmony_ci							  "#define BTYPE        bool\n"
742e5c31af7Sopenharmony_ci							  "#define LEFT        -1\n"
743e5c31af7Sopenharmony_ci							  "#define RIGHT       -2\n"
744e5c31af7Sopenharmony_ci							  "#define BDATA        true\n"
745e5c31af7Sopenharmony_ci							  "#define REFERENCE   -2\n",
746e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
747e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
748e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump uint\n"
749e5c31af7Sopenharmony_ci							  "#define BTYPE        bool\n"
750e5c31af7Sopenharmony_ci							  "#define LEFT         1u\n"
751e5c31af7Sopenharmony_ci							  "#define RIGHT        2u\n"
752e5c31af7Sopenharmony_ci							  "#define BDATA        true\n"
753e5c31af7Sopenharmony_ci							  "#define REFERENCE    2u\n",
754e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
755e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
756e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp int\n"
757e5c31af7Sopenharmony_ci							  "#define BTYPE        bool\n"
758e5c31af7Sopenharmony_ci							  "#define LEFT        -1\n"
759e5c31af7Sopenharmony_ci							  "#define RIGHT       -2\n"
760e5c31af7Sopenharmony_ci							  "#define BDATA        true\n"
761e5c31af7Sopenharmony_ci							  "#define REFERENCE   -2\n",
762e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
763e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
764e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp uint\n"
765e5c31af7Sopenharmony_ci							  "#define BTYPE        bool\n"
766e5c31af7Sopenharmony_ci							  "#define LEFT         1u\n"
767e5c31af7Sopenharmony_ci							  "#define RIGHT        2u\n"
768e5c31af7Sopenharmony_ci							  "#define BDATA        true\n"
769e5c31af7Sopenharmony_ci							  "#define REFERENCE    2u\n",
770e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
771e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
772e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        bool\n"
773e5c31af7Sopenharmony_ci							  "#define BTYPE        bool\n"
774e5c31af7Sopenharmony_ci							  "#define LEFT         false\n"
775e5c31af7Sopenharmony_ci							  "#define RIGHT        true\n"
776e5c31af7Sopenharmony_ci							  "#define BDATA        true\n"
777e5c31af7Sopenharmony_ci							  "#define REFERENCE    true\n",
778e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
779e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
780e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp ivec2\n"
781e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec2\n"
782e5c31af7Sopenharmony_ci							  "#define LEFT         ivec2(-1, -2)\n"
783e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec2(-3, -4)\n"
784e5c31af7Sopenharmony_ci							  "#define BDATA        bvec2(true, false)\n"
785e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec2(-3, -2)\n",
786e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
787e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
788e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp uvec2\n"
789e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec2\n"
790e5c31af7Sopenharmony_ci							  "#define LEFT         uvec2(1, 2)\n"
791e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec2(3, 4)\n"
792e5c31af7Sopenharmony_ci							  "#define BDATA        bvec2(true, false)\n"
793e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec2(3, 2)\n",
794e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
795e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
796e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump ivec2\n"
797e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec2\n"
798e5c31af7Sopenharmony_ci							  "#define LEFT         ivec2(-1, -2)\n"
799e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec2(-3, -4)\n"
800e5c31af7Sopenharmony_ci							  "#define BDATA        bvec2(true, false)\n"
801e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec2(-3, -2)\n",
802e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
803e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
804e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump uvec2\n"
805e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec2\n"
806e5c31af7Sopenharmony_ci							  "#define LEFT         uvec2(1, 2)\n"
807e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec2(3, 4)\n"
808e5c31af7Sopenharmony_ci							  "#define BDATA        bvec2(true, false)\n"
809e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec2(3, 2)\n",
810e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
811e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
812e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp ivec2\n"
813e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec2\n"
814e5c31af7Sopenharmony_ci							  "#define LEFT         ivec2(-1, -2)\n"
815e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec2(-3, -4)\n"
816e5c31af7Sopenharmony_ci							  "#define BDATA        bvec2(true, false)\n"
817e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec2(-3, -2)\n",
818e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
819e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
820e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp uvec2\n"
821e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec2\n"
822e5c31af7Sopenharmony_ci							  "#define LEFT         uvec2(1, 2)\n"
823e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec2(3, 4)\n"
824e5c31af7Sopenharmony_ci							  "#define BDATA        bvec2(true, false)\n"
825e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec2(3, 2)\n",
826e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
827e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
828e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        bvec2\n"
829e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec2\n"
830e5c31af7Sopenharmony_ci							  "#define LEFT         bvec2(true,  true)\n"
831e5c31af7Sopenharmony_ci							  "#define RIGHT        bvec2(false, false)\n"
832e5c31af7Sopenharmony_ci							  "#define BDATA        bvec2(true,  false)\n"
833e5c31af7Sopenharmony_ci							  "#define REFERENCE    bvec2(false, true)\n",
834e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
835e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
836e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp ivec3\n"
837e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec3\n"
838e5c31af7Sopenharmony_ci							  "#define LEFT         ivec3(-1, -2, -3)\n"
839e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec3(-4, -5, -6)\n"
840e5c31af7Sopenharmony_ci							  "#define BDATA        bvec3(true, false, true)\n"
841e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec3(-4, -2, -6)\n",
842e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
843e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
844e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp uvec3\n"
845e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec3\n"
846e5c31af7Sopenharmony_ci							  "#define LEFT         uvec3(1, 2, 3)\n"
847e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec3(4, 5, 6)\n"
848e5c31af7Sopenharmony_ci							  "#define BDATA        bvec3(true, false, true)\n"
849e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec3(4, 2, 6)\n",
850e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
851e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
852e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump ivec3\n"
853e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec3\n"
854e5c31af7Sopenharmony_ci							  "#define LEFT         ivec3(-1, -2, -3)\n"
855e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec3(-4, -5, -6)\n"
856e5c31af7Sopenharmony_ci							  "#define BDATA        bvec3(true, false, true)\n"
857e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec3(-4, -2, -6)\n",
858e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
859e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
860e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump uvec3\n"
861e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec3\n"
862e5c31af7Sopenharmony_ci							  "#define LEFT         uvec3(1, 2, 3)\n"
863e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec3(4, 5, 6)\n"
864e5c31af7Sopenharmony_ci							  "#define BDATA        bvec3(true, false, true)\n"
865e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec3(4, 2, 6)\n",
866e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
867e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
868e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp ivec3\n"
869e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec3\n"
870e5c31af7Sopenharmony_ci							  "#define LEFT         ivec3(-1, -2, -3)\n"
871e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec3(-4, -5, -6)\n"
872e5c31af7Sopenharmony_ci							  "#define BDATA        bvec3(true, false, true)\n"
873e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec3(-4, -2, -6)\n",
874e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
875e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
876e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp uvec3\n"
877e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec3\n"
878e5c31af7Sopenharmony_ci							  "#define LEFT         uvec3(1, 2, 3)\n"
879e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec3(4, 5, 6)\n"
880e5c31af7Sopenharmony_ci							  "#define BDATA        bvec3(true, false, true)\n"
881e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec3(4, 2, 6)\n",
882e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
883e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
884e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        bvec3\n"
885e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec3\n"
886e5c31af7Sopenharmony_ci							  "#define LEFT         bvec3(true,  true, true)\n"
887e5c31af7Sopenharmony_ci							  "#define RIGHT        bvec3(false, false, false)\n"
888e5c31af7Sopenharmony_ci							  "#define BDATA        bvec3(true,  false, true)\n"
889e5c31af7Sopenharmony_ci							  "#define REFERENCE    bvec3(false, true, false)\n",
890e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
891e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
892e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp ivec4\n"
893e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec4\n"
894e5c31af7Sopenharmony_ci							  "#define LEFT         ivec4(-1, -2, -3, -4)\n"
895e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec4(-5, -6, -7, -8)\n"
896e5c31af7Sopenharmony_ci							  "#define BDATA        bvec4(true, false, true, false)\n"
897e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec4(-5, -2, -7, -4)\n",
898e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
899e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
900e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        highp uvec4\n"
901e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec4\n"
902e5c31af7Sopenharmony_ci							  "#define LEFT         uvec4(1, 2, 3, 4)\n"
903e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec4(5, 6, 7, 8)\n"
904e5c31af7Sopenharmony_ci							  "#define BDATA        bvec4(true, false, true, false)\n"
905e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec4(5, 2, 7, 4)\n",
906e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
907e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
908e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump ivec4\n"
909e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec4\n"
910e5c31af7Sopenharmony_ci							  "#define LEFT         ivec4(-1, -2, -3, -4)\n"
911e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec4(-5, -6, -7, -8)\n"
912e5c31af7Sopenharmony_ci							  "#define BDATA        bvec4(true, false, true, false)\n"
913e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec4(-5, -2, -7, -4)\n",
914e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
915e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
916e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        mediump uvec4\n"
917e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec4\n"
918e5c31af7Sopenharmony_ci							  "#define LEFT         uvec4(1, 2, 3, 4)\n"
919e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec4(5, 6, 7, 8)\n"
920e5c31af7Sopenharmony_ci							  "#define BDATA        bvec4(true, false, true, false)\n"
921e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec4(5, 2, 7, 4)\n",
922e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
923e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
924e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp ivec4\n"
925e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec4\n"
926e5c31af7Sopenharmony_ci							  "#define LEFT         ivec4(-1, -2, -3, -4)\n"
927e5c31af7Sopenharmony_ci							  "#define RIGHT        ivec4(-5, -6, -7, -8)\n"
928e5c31af7Sopenharmony_ci							  "#define BDATA        bvec4(true, false, true, false)\n"
929e5c31af7Sopenharmony_ci							  "#define REFERENCE    ivec4(-5, -2, -7, -4)\n",
930e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
931e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
932e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        lowp uvec4\n"
933e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec4\n"
934e5c31af7Sopenharmony_ci							  "#define LEFT         uvec4(1, 2, 3, 4)\n"
935e5c31af7Sopenharmony_ci							  "#define RIGHT        uvec4(5, 6, 7, 8)\n"
936e5c31af7Sopenharmony_ci							  "#define BDATA        bvec4(true, false, true, false)\n"
937e5c31af7Sopenharmony_ci							  "#define REFERENCE    uvec4(5, 2, 7, 4)\n",
938e5c31af7Sopenharmony_ci			s_fragment_shader_body } },
939e5c31af7Sopenharmony_ci		{ { s_shader_version, "", s_vertex_shader_body },
940e5c31af7Sopenharmony_ci		  { s_shader_version, "#define TTYPE        bvec4\n"
941e5c31af7Sopenharmony_ci							  "#define BTYPE        bvec4\n"
942e5c31af7Sopenharmony_ci							  "#define LEFT         bvec4(true,  true,  true,  true)\n"
943e5c31af7Sopenharmony_ci							  "#define RIGHT        bvec4(false, false, false, false)\n"
944e5c31af7Sopenharmony_ci							  "#define BDATA        bvec4(true,  false, true,  false)\n"
945e5c31af7Sopenharmony_ci							  "#define REFERENCE    bvec4(false, true,  false, true)\n",
946e5c31af7Sopenharmony_ci			s_fragment_shader_body } }
947e5c31af7Sopenharmony_ci	};
948e5c31af7Sopenharmony_ci
949e5c31af7Sopenharmony_ciconst glw::GLsizei gl4cts::es31compatibility::ShaderFunctionalCompatibilityTest::s_shaders_count =
950e5c31af7Sopenharmony_ci	sizeof(s_shaders) / sizeof(s_shaders[0]);
951