1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 Module
3 * -------------------------------------------------
5 * Copyright 2016 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Negative Shader Function Tests
22 *//*--------------------------------------------------------------------*/
24 #include "es31fNegativeShaderFunctionTests.hpp"
26 #include "gluShaderProgram.hpp"
34 namespace NegativeTestShared
41 SHADER_FUNCTION_BITFIELD_REVERSE = 0,
42 SHADER_FUNCTION_BIT_COUNT,
43 SHADER_FUNCTION_FIND_MSB,
44 SHADER_FUNCTION_FIND_LSB,
45 SHADER_FUNCTION_UADD_CARRY,
46 SHADER_FUNCTION_USUB_BORROW,
47 SHADER_FUNCTION_UMUL_EXTENDED,
48 SHADER_FUNCTION_IMUL_EXTENDED,
49 SHADER_FUNCTION_FREXP,
50 SHADER_FUNCTION_LDEXP,
51 SHADER_FUNCTION_PACK_UNORM_4X8,
52 SHADER_FUNCTION_PACK_SNORM_4X8,
53 SHADER_FUNCTION_UNPACK_SNORM_4X8,
54 SHADER_FUNCTION_UNPACK_UNORM_4X8,
55 SHADER_FUNCTION_EMIT_VERTEX,
56 SHADER_FUNCTION_END_PRIMITIVE,
57 SHADER_FUNCTION_ATOMIC_ADD,
58 SHADER_FUNCTION_ATOMIC_MIN,
59 SHADER_FUNCTION_ATOMIC_MAX,
60 SHADER_FUNCTION_ATOMIC_AND,
61 SHADER_FUNCTION_ATOMIC_OR,
62 SHADER_FUNCTION_ATOMIC_XOR,
63 SHADER_FUNCTION_ATOMIC_EXCHANGE,
64 SHADER_FUNCTION_ATOMIC_COMP_SWAP,
65 SHADER_FUNCTION_INTERPOLATED_AT_CENTROID,
66 SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE,
67 SHADER_FUNCTION_INTERPOLATED_AT_OFFSET,
72 enum FunctionTextureModes
74 FUNCTION_TEXTURE_MODE_NO_BIAS_NO_COMPARE = 0,
75 FUNCTION_TEXTURE_MODE_BIAS_OR_COMPARE,
77 FUNCTION_TEXTURE_MODE_LAST
80 enum FunctionTextureGatherOffsetModes
82 FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP = 0,
83 FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z,
85 FUNCTION_TEXTURE_GATHER_OFFSET_MODE_LAST
88 struct TextureGatherOffsetsTestSpec
90 FunctionTextureGatherOffsetModes mode;
91 glu::DataType samplerDataType;
92 glu::DataType pDataType;
93 glu::DataType offsetsDataType;
94 glu::DataType fourthArgument;
99 static const glu::DataType s_floatTypes[] =
102 glu::TYPE_FLOAT_VEC2,
103 glu::TYPE_FLOAT_VEC3,
107 static const glu::DataType s_intTypes[] =
115 static const glu::DataType s_uintTypes[] =
123 static const glu::DataType s_nonScalarIntTypes[] =
126 glu::TYPE_FLOAT_VEC2,
127 glu::TYPE_FLOAT_VEC3,
128 glu::TYPE_FLOAT_VEC4,
138 static const glu::ShaderType s_shaders[] =
140 glu::SHADERTYPE_VERTEX,
141 glu::SHADERTYPE_FRAGMENT,
142 glu::SHADERTYPE_GEOMETRY,
143 glu::SHADERTYPE_TESSELLATION_CONTROL,
144 glu::SHADERTYPE_TESSELLATION_EVALUATION,
145 glu::SHADERTYPE_COMPUTE
148 static const glu::DataType s_samplerTypes[] =
150 glu::TYPE_SAMPLER_2D,
151 glu::TYPE_INT_SAMPLER_2D,
152 glu::TYPE_UINT_SAMPLER_2D,
153 glu::TYPE_SAMPLER_3D,
154 glu::TYPE_INT_SAMPLER_3D,
155 glu::TYPE_UINT_SAMPLER_3D,
156 glu::TYPE_SAMPLER_CUBE,
157 glu::TYPE_INT_SAMPLER_CUBE,
158 glu::TYPE_UINT_SAMPLER_CUBE,
159 glu::TYPE_SAMPLER_2D_ARRAY,
160 glu::TYPE_INT_SAMPLER_2D_ARRAY,
161 glu::TYPE_UINT_SAMPLER_2D_ARRAY,
162 glu::TYPE_SAMPLER_CUBE_SHADOW,
163 glu::TYPE_SAMPLER_2D_SHADOW,
164 glu::TYPE_SAMPLER_2D_ARRAY_SHADOW,
165 glu::TYPE_SAMPLER_CUBE_ARRAY,
166 glu::TYPE_INT_SAMPLER_CUBE_ARRAY,
167 glu::TYPE_UINT_SAMPLER_CUBE_ARRAY,
168 glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW,
170 glu::TYPE_SAMPLER_2D_MULTISAMPLE,
171 glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE,
172 glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE,
174 glu::TYPE_SAMPLER_BUFFER,
175 glu::TYPE_INT_SAMPLER_BUFFER,
176 glu::TYPE_UINT_SAMPLER_BUFFER,
178 glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY,
179 glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY,
180 glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY,
183 void verifyShader (NegativeTestContext& ctx, glu::ShaderType shaderType, std::string shaderSource)
185 tcu::TestLog& log = ctx.getLog();
186 const char* source = shaderSource.c_str();
187 const int length = (int) shaderSource.size();
188 glu::Shader shader (ctx.getRenderContext(), shaderType);
190 shader.setSources(1, &source, &length);
194 if (shader.getCompileStatus())
196 log << tcu::TestLog::Message << "Expected shader to fail, but compilation passed." << tcu::TestLog::EndMessage;
197 ctx.fail("Shader was not expected to compile.\n");
201 std::string declareAndInitializeShaderVariable (glu::DataType dataType, std::string varName)
203 std::ostringstream variable;
204 variable << getDataTypeName(dataType) << " " << varName << " = " << getDataTypeName(dataType);
207 case glu::TYPE_FLOAT: variable << "(1.0);\n"; break;
208 case glu::TYPE_FLOAT_VEC2: variable << "(1.0, 1.0);\n"; break;
209 case glu::TYPE_FLOAT_VEC3: variable << "(1.0, 1.0, 1.0);\n"; break;
210 case glu::TYPE_FLOAT_VEC4: variable << "(1.0, 1.0, 1.0, 1.0);\n"; break;
211 case glu::TYPE_INT: variable << "(1);\n"; break;
212 case glu::TYPE_INT_VEC2: variable << "(1, 1);\n"; break;
213 case glu::TYPE_INT_VEC3: variable << "(1, 1, 1);\n"; break;
214 case glu::TYPE_INT_VEC4: variable << "(1, 1, 1, 1);\n"; break;
215 case glu::TYPE_UINT: variable << "(1u);\n"; break;
216 case glu::TYPE_UINT_VEC2: variable << "(1u, 1u);\n"; break;
217 case glu::TYPE_UINT_VEC3: variable << "(1u, 1u, 1u);\n"; break;
218 case glu::TYPE_UINT_VEC4: variable << "(1u, 1u, 1u, 1u);\n"; break;
220 DE_FATAL("Unsupported data type.");
222 return variable.str();
225 std::string declareShaderUniform (glu::DataType dataType, std::string varName)
227 std::ostringstream variable;
228 variable << getPrecisionName(glu::PRECISION_HIGHP) << " uniform " << getDataTypeName(dataType) << " " << varName << ";\n";
229 return variable.str();
232 std::string declareShaderInput (glu::DataType dataType, std::string varName)
234 std::ostringstream variable;
235 variable << "in " << getPrecisionName(glu::PRECISION_HIGHP) << " " << getDataTypeName(dataType) << " " << varName << ";\n";
236 return variable.str();
239 std::string declareBuffer (glu::DataType dataType, std::string varName)
241 std::ostringstream variable;
242 variable << "buffer SSBO {\n"
243 << " " << getDataTypeName(dataType) << " " << varName << ";\n"
245 return variable.str();
248 std::string declareShaderArrayVariable (glu::DataType dataType, std::string varName, const int arraySize)
250 std::ostringstream source;
251 source << getDataTypeName(dataType) << " " << varName << "[" << arraySize << "]" << " = " << getDataTypeName(dataType) << "[](";
253 for (int ndx = 0; ndx < arraySize; ++ndx)
254 source << getDataTypeName(dataType) << "(" << 0 << ", " << 0 << ")" << ((ndx < arraySize -1) ? ", " : "");
260 std::string getShaderExtensionDeclaration (std::string extension)
262 if (extension.empty())
263 return std::string("");
266 std::ostringstream source;
267 source << "#extension " << extension << " : enable\n";
272 std::string getDataTypeExtension (glu::DataType dataType)
274 std::ostringstream source;
277 case glu::TYPE_SAMPLER_CUBE_ARRAY:
278 case glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW:
279 case glu::TYPE_INT_SAMPLER_CUBE_ARRAY:
280 case glu::TYPE_UINT_SAMPLER_CUBE_ARRAY:
281 source << "GL_EXT_texture_cube_map_array";
284 case glu::TYPE_SAMPLER_BUFFER:
285 case glu::TYPE_INT_SAMPLER_BUFFER:
286 case glu::TYPE_UINT_SAMPLER_BUFFER:
287 source << "GL_EXT_texture_buffer";
290 case glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY:
291 case glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
292 case glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY:
293 source << "GL_OES_texture_storage_multisample_2d_array";
303 std::string getShaderInitialization (NegativeTestContext& ctx, glu::ShaderType shaderType)
305 std::ostringstream source;
307 if (!contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)))
311 case glu::SHADERTYPE_GEOMETRY:
312 source << "#extension GL_EXT_geometry_shader : enable\n";
315 case glu::SHADERTYPE_TESSELLATION_CONTROL:
316 source << "#extension GL_EXT_tessellation_shader : enable\n";
319 case glu::SHADERTYPE_TESSELLATION_EVALUATION:
320 source << "#extension GL_EXT_tessellation_shader : enable\n";
330 case glu::SHADERTYPE_GEOMETRY:
331 source << "layout(max_vertices = 5) out;\n";
334 case glu::SHADERTYPE_TESSELLATION_CONTROL:
335 source << "layout(vertices = 3) out;\n";
338 case glu::SHADERTYPE_TESSELLATION_EVALUATION:
339 source << "layout(triangles, equal_spacing, cw) in;\n";
349 std::string genShaderSourceBitfieldExtract (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType valueDataType, glu::DataType offsetDataType, glu::DataType bitsDataType)
351 std::ostringstream source;
352 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
353 << getShaderInitialization(ctx, shaderType)
354 << "void main(void)\n"
356 << " " << declareAndInitializeShaderVariable(valueDataType, "value")
357 << " " << declareAndInitializeShaderVariable(offsetDataType, "offset")
358 << " " << declareAndInitializeShaderVariable(bitsDataType, "bits")
359 << " bitfieldExtract(value, offset, bits);\n"
365 void bitfield_extract_invalid_value_type (NegativeTestContext& ctx)
367 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
369 ctx.beginSection("bitfieldExtract: Invalid value type.");
370 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
372 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
374 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
375 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
377 const std::string shaderSource(genShaderSourceBitfieldExtract(ctx, s_shaders[shaderNdx], s_floatTypes[dataTypeNdx], glu::TYPE_INT, glu::TYPE_INT));
378 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
386 void bitfield_extract_invalid_offset_type (NegativeTestContext& ctx)
388 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
390 ctx.beginSection("bitfieldExtract: Invalid offset type.");
391 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
393 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
395 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
396 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
398 for (int nonIntNdx = 0; nonIntNdx < DE_LENGTH_OF_ARRAY(s_nonScalarIntTypes); ++nonIntNdx)
401 const std::string shaderSource(genShaderSourceBitfieldExtract(ctx, s_shaders[shaderNdx], s_intTypes[dataTypeNdx], s_nonScalarIntTypes[nonIntNdx], glu::TYPE_INT));
402 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
405 const std::string shaderSource(genShaderSourceBitfieldExtract(ctx, s_shaders[shaderNdx], s_uintTypes[dataTypeNdx], s_nonScalarIntTypes[nonIntNdx], glu::TYPE_INT));
406 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
416 void bitfield_extract_invalid_bits_type (NegativeTestContext& ctx)
418 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
420 ctx.beginSection("bitfieldExtract: Invalid bits type.");
421 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
423 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
425 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
426 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
428 for (int nonIntNdx = 0; nonIntNdx < DE_LENGTH_OF_ARRAY(s_nonScalarIntTypes); ++nonIntNdx)
431 const std::string shaderSource(genShaderSourceBitfieldExtract(ctx, s_shaders[shaderNdx], s_intTypes[dataTypeNdx], glu::TYPE_INT, s_nonScalarIntTypes[nonIntNdx]));
432 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
435 const std::string shaderSource(genShaderSourceBitfieldExtract(ctx, s_shaders[shaderNdx], s_uintTypes[dataTypeNdx], glu::TYPE_INT, s_nonScalarIntTypes[nonIntNdx]));
436 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
446 std::string genShaderSourceBitfieldInsert (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType baseDataType, glu::DataType insertDataType, glu::DataType offsetDataType, glu::DataType bitsDataType)
448 std::ostringstream source;
449 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
450 << getShaderInitialization(ctx, shaderType)
451 << "void main(void)\n"
453 << " " << declareAndInitializeShaderVariable(baseDataType, "base")
454 << " " << declareAndInitializeShaderVariable(insertDataType, "insert")
455 << " " << declareAndInitializeShaderVariable(offsetDataType, "offset")
456 << " " << declareAndInitializeShaderVariable(bitsDataType, "bits")
457 << " bitfieldInsert(base, insert, offset, bits);\n"
463 void bitfield_insert_invalid_base_type (NegativeTestContext& ctx)
465 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
466 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_floatTypes));
468 ctx.beginSection("bitfieldInsert: Invalid base type.");
469 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
471 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
473 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
474 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
477 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_floatTypes[dataTypeNdx], s_intTypes[dataTypeNdx], glu::TYPE_INT, glu::TYPE_INT));
478 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
481 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], glu::TYPE_INT, glu::TYPE_INT));
482 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
491 void bitfield_insert_invalid_insert_type (NegativeTestContext& ctx)
493 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
494 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_floatTypes));
496 ctx.beginSection("bitfieldInsert: Invalid insert type.");
497 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
499 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
501 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
502 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
505 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_intTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], glu::TYPE_INT, glu::TYPE_INT));
506 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
509 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], glu::TYPE_INT, glu::TYPE_INT));
510 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
513 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx2)
515 if (s_intTypes[dataTypeNdx] == s_intTypes[dataTypeNdx2])
519 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx2], glu::TYPE_INT, glu::TYPE_INT));
520 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
523 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2], glu::TYPE_INT, glu::TYPE_INT));
524 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
535 void bitfield_insert_invalid_offset_type (NegativeTestContext& ctx)
537 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
539 ctx.beginSection("bitfieldInsert: Invalid offset type.");
540 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
542 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
544 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
545 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
547 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_nonScalarIntTypes); ++dataTypeNdx2)
550 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_nonScalarIntTypes[dataTypeNdx2], glu::TYPE_INT));
551 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
554 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_nonScalarIntTypes[dataTypeNdx2], glu::TYPE_INT));
555 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
565 void bitfield_insert_invalid_bits_type (NegativeTestContext& ctx)
567 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_intTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
569 ctx.beginSection("bitfieldInsert: Invalid bits type.");
570 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
572 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
574 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
575 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
577 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_nonScalarIntTypes); ++dataTypeNdx2)
580 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], glu::TYPE_INT, s_nonScalarIntTypes[dataTypeNdx2]));
581 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
584 const std::string shaderSource(genShaderSourceBitfieldInsert(ctx, s_shaders[shaderNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], glu::TYPE_INT, s_nonScalarIntTypes[dataTypeNdx2]));
585 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
595 // bitfieldReverse, bitCount, findMSB, findLSB
596 std::string genShaderSourceReverseCountFind (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType baseDataType)
598 DE_ASSERT(function == SHADER_FUNCTION_BITFIELD_REVERSE ||
599 function == SHADER_FUNCTION_BIT_COUNT ||
600 function == SHADER_FUNCTION_FIND_MSB ||
601 function == SHADER_FUNCTION_FIND_LSB);
603 std::ostringstream source;
604 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
605 << getShaderInitialization(ctx, shaderType)
606 << "void main(void)\n"
608 << " " << declareAndInitializeShaderVariable(baseDataType, "value");
612 case SHADER_FUNCTION_BITFIELD_REVERSE: source << " bitfieldReverse(value);\n"; break;
613 case SHADER_FUNCTION_BIT_COUNT: source << " bitCount(value);\n"; break;
614 case SHADER_FUNCTION_FIND_MSB: source << " findMSB(value);\n"; break;
615 case SHADER_FUNCTION_FIND_LSB: source << " findLSB(value);\n"; break;
617 DE_FATAL("Unsupported shader function.");
626 void bitfield_reverse (NegativeTestContext& ctx)
628 ctx.beginSection("bitfieldReverse: Invalid value type.");
629 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
631 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
633 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
634 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
636 const std::string shaderSource(genShaderSourceReverseCountFind(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_BITFIELD_REVERSE, s_floatTypes[dataTypeNdx]));
637 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
645 void bit_count (NegativeTestContext& ctx)
647 ctx.beginSection("bitCount: Invalid value type.");
648 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
650 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
652 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
653 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
655 const std::string shaderSource(genShaderSourceReverseCountFind(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_BIT_COUNT, s_floatTypes[dataTypeNdx]));
656 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
664 void find_msb (NegativeTestContext& ctx)
666 ctx.beginSection("findMSB: Invalid value type.");
667 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
669 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
671 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
672 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
674 const std::string shaderSource(genShaderSourceReverseCountFind(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_FIND_MSB, s_floatTypes[dataTypeNdx]));
675 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
683 void find_lsb (NegativeTestContext& ctx)
685 ctx.beginSection("findLSB: Invalid value type.");
686 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
688 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
690 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
691 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
693 const std::string shaderSource(genShaderSourceReverseCountFind(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_FIND_LSB, s_floatTypes[dataTypeNdx]));
694 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
702 // uaddCarry, usubBorrow
703 std::string genShaderSourceAddCarrySubBorrow (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType xDataType, glu::DataType yDataType, glu::DataType carryBorrowDataType)
705 DE_ASSERT(function == SHADER_FUNCTION_UADD_CARRY || function == SHADER_FUNCTION_USUB_BORROW);
707 std::ostringstream source;
708 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
709 << getShaderInitialization(ctx, shaderType)
710 << "void main(void)\n"
712 << " " << declareAndInitializeShaderVariable(xDataType, "x")
713 << " " << declareAndInitializeShaderVariable(yDataType, "y");
717 case SHADER_FUNCTION_UADD_CARRY:
718 source << " " << declareAndInitializeShaderVariable(carryBorrowDataType, "carry")
719 << " uaddCarry(x, y, carry);\n";
722 case SHADER_FUNCTION_USUB_BORROW:
723 source << " " << declareAndInitializeShaderVariable(carryBorrowDataType, "borrow")
724 << " usubBorrow(x, y, borrow);\n";
728 DE_FATAL("Unsupported shader function.");
736 void uadd_carry_invalid_x (NegativeTestContext& ctx)
738 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
739 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
741 ctx.beginSection("uaddCarry: Invalid x type.");
742 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
744 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
746 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
747 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
750 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
751 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
754 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
755 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
757 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx2)
759 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
762 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_uintTypes[dataTypeNdx2], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
763 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
772 void uadd_carry_invalid_y (NegativeTestContext& ctx)
774 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
775 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
777 ctx.beginSection("uaddCarry: Invalid y type.");
778 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
780 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
782 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
783 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
786 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
787 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
790 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
791 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
794 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx2)
796 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
799 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2], s_uintTypes[dataTypeNdx]));
800 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
809 void uadd_carry_invalid_carry (NegativeTestContext& ctx)
811 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
812 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
814 ctx.beginSection("uaddCarry: Invalid carry type.");
815 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
817 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
819 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
820 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
823 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx]));
824 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
827 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
828 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
831 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx2)
833 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
836 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UADD_CARRY, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2]));
837 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
846 void usub_borrow_invalid_x (NegativeTestContext& ctx)
848 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
849 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
851 ctx.beginSection("usubBorrow: Invalid x type.");
852 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
854 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
856 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
857 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
860 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
861 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
864 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
865 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
868 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx2)
870 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
873 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_uintTypes[dataTypeNdx2], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
874 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
883 void usub_borrow_invalid_y (NegativeTestContext& ctx)
885 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
886 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
888 ctx.beginSection("usubBorrow: Invalid y type.");
889 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
891 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
893 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
894 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
897 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
898 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
901 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
902 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
905 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx2)
907 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
910 const std::string shaderSource = genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2], s_uintTypes[dataTypeNdx]);
911 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
920 void usub_borrow_invalid_borrow (NegativeTestContext& ctx)
922 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
923 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
925 ctx.beginSection("usubBorrow: Invalid borrow type.");
926 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
928 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
930 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
931 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
934 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx]));
935 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
938 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
939 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
942 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx2)
944 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
947 const std::string shaderSource(genShaderSourceAddCarrySubBorrow(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_USUB_BORROW, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2]));
948 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
957 // umulExtended, imulExtended
958 std::string genShaderSourceMulExtended (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType xDataType, glu::DataType yDataType, glu::DataType msbDataType, glu::DataType lsbDataType)
960 DE_ASSERT(function == SHADER_FUNCTION_UMUL_EXTENDED || function == SHADER_FUNCTION_IMUL_EXTENDED);
962 std::ostringstream source;
963 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
964 << getShaderInitialization(ctx, shaderType)
965 << "void main(void)\n"
967 << " " << declareAndInitializeShaderVariable(xDataType, "x")
968 << " " << declareAndInitializeShaderVariable(yDataType, "y")
969 << " " << declareAndInitializeShaderVariable(msbDataType, "msb")
970 << " " << declareAndInitializeShaderVariable(lsbDataType, "lsb");
974 case SHADER_FUNCTION_UMUL_EXTENDED: source << " umulExtended(x, y, msb, lsb);\n"; break;
975 case SHADER_FUNCTION_IMUL_EXTENDED: source << " imulExtended(x, y, msb, lsb);\n"; break;
977 DE_FATAL("Unsupported shader function.");
985 void umul_extended_invalid_x (NegativeTestContext& ctx)
987 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
988 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
990 ctx.beginSection("umulExtended: Invalid x type.");
991 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
993 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
995 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
996 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx)
999 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1000 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1003 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1004 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1007 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx2)
1009 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
1012 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx2], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1013 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1022 void umul_extended_invalid_y (NegativeTestContext& ctx)
1024 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1025 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1027 ctx.beginSection("umulExtended: Invalid y type.");
1028 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1030 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1032 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1033 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx)
1036 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1037 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1040 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1041 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1044 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx2)
1046 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
1049 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1050 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1059 void umul_extended_invalid_msb (NegativeTestContext& ctx)
1061 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1062 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1064 ctx.beginSection("umulExtended: Invalid msb type.");
1065 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1067 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1069 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1070 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx)
1073 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1074 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1077 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1078 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1081 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx2)
1083 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
1086 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2], s_uintTypes[dataTypeNdx]));
1087 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1096 void umul_extended_invalid_lsb (NegativeTestContext& ctx)
1098 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1099 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1101 ctx.beginSection("umulExtended: Invalid lsb type.");
1102 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1104 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1106 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1107 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx)
1110 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_floatTypes[dataTypeNdx]));
1111 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1114 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1115 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1118 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx2)
1120 if (s_uintTypes[dataTypeNdx2] == s_uintTypes[dataTypeNdx])
1123 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_uintTypes[dataTypeNdx2]));
1124 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1133 void imul_extended_invalid_x (NegativeTestContext& ctx)
1135 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1136 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1138 ctx.beginSection("imulExtended: Invalid x type.");
1139 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1141 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1143 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1144 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1147 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_floatTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1148 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1151 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1152 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1155 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx2)
1157 if (s_intTypes[dataTypeNdx2] == s_intTypes[dataTypeNdx])
1160 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx2], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1161 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1170 void imul_extended_invalid_y (NegativeTestContext& ctx)
1172 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1173 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1175 ctx.beginSection("imulExtended: Invalid y type.");
1176 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1178 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1180 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1181 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1184 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1185 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1188 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1189 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1192 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx2)
1194 if (s_intTypes[dataTypeNdx2] == s_intTypes[dataTypeNdx])
1197 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx2], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1198 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1207 void imul_extended_invalid_msb (NegativeTestContext& ctx)
1209 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1210 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1212 ctx.beginSection("imulExtended: Invalid msb type.");
1213 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1215 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1217 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1218 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1221 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_floatTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1222 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1225 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1226 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1229 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx2)
1231 if (s_intTypes[dataTypeNdx2] == s_intTypes[dataTypeNdx])
1234 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx2], s_intTypes[dataTypeNdx]));
1235 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1244 void imul_extended_invalid_lsb (NegativeTestContext& ctx)
1246 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1247 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1249 ctx.beginSection("imulExtended: Invalid lsb type.");
1250 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1252 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1254 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1255 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1258 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_floatTypes[dataTypeNdx]));
1259 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1262 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1263 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1266 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx2)
1268 if (s_intTypes[dataTypeNdx2] == s_intTypes[dataTypeNdx])
1271 const std::string shaderSource(genShaderSourceMulExtended(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_IMUL_EXTENDED, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx2]));
1272 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1282 std::string genShaderSourceFrexpLdexp (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType xDataType, glu::DataType expDataType)
1284 DE_ASSERT(function == SHADER_FUNCTION_FREXP || function == SHADER_FUNCTION_LDEXP);
1286 std::ostringstream source;
1287 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
1288 << getShaderInitialization(ctx, shaderType)
1289 << "void main(void)\n"
1291 << " " << declareAndInitializeShaderVariable(xDataType, "x")
1292 << " " << declareAndInitializeShaderVariable(expDataType, "exp");
1296 case SHADER_FUNCTION_FREXP:
1297 source << " frexp(x, exp);\n";
1300 case SHADER_FUNCTION_LDEXP:
1301 source << " ldexp(x, exp);\n";
1305 DE_FATAL("Unsupported shader function.");
1310 return source.str();
1313 void frexp_invalid_x (NegativeTestContext& ctx)
1315 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1316 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1318 ctx.beginSection("frexp: Invalid x type.");
1319 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1321 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1323 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1324 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
1327 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_FREXP, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1328 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1331 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_FREXP, s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1332 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1341 void frexp_invalid_exp (NegativeTestContext& ctx)
1343 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1344 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1346 ctx.beginSection("frexp: Invalid exp type.");
1347 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1349 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1351 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1352 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
1355 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_FREXP, s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1356 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1359 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_FREXP, s_floatTypes[dataTypeNdx], s_floatTypes[dataTypeNdx]));
1360 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1369 void ldexp_invalid_x (NegativeTestContext& ctx)
1371 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1372 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1374 ctx.beginSection("ldexp: Invalid x type.");
1375 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1377 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1379 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1380 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
1383 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_LDEXP, s_intTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1384 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1387 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_LDEXP, s_uintTypes[dataTypeNdx], s_intTypes[dataTypeNdx]));
1388 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1397 void ldexp_invalid_exp (NegativeTestContext& ctx)
1399 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1400 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1402 ctx.beginSection("ldexp: Invalid exp type.");
1403 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1405 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1407 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1408 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
1411 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_LDEXP, s_floatTypes[dataTypeNdx], s_uintTypes[dataTypeNdx]));
1412 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1415 const std::string shaderSource(genShaderSourceFrexpLdexp(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_LDEXP, s_floatTypes[dataTypeNdx], s_floatTypes[dataTypeNdx]));
1416 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1425 // packUnorm4x8, packSnorm4x8, unpackSnorm4x8, unpackUnorm4x8
1426 std::string genShaderSourcePackUnpackNorm4x8 (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType dataType)
1428 DE_ASSERT(function == SHADER_FUNCTION_PACK_UNORM_4X8 ||
1429 function == SHADER_FUNCTION_PACK_SNORM_4X8 ||
1430 function == SHADER_FUNCTION_UNPACK_SNORM_4X8 ||
1431 function == SHADER_FUNCTION_UNPACK_UNORM_4X8);
1433 std::ostringstream source;
1434 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
1435 << getShaderInitialization(ctx, shaderType)
1436 << "void main(void)\n"
1441 case SHADER_FUNCTION_PACK_UNORM_4X8:
1442 source << " mediump " << declareAndInitializeShaderVariable(dataType, "v")
1443 << " packUnorm4x8(v);\n";
1446 case SHADER_FUNCTION_PACK_SNORM_4X8:
1447 source << " mediump " << declareAndInitializeShaderVariable(dataType, "v")
1448 << " packSnorm4x8(v);\n";
1451 case SHADER_FUNCTION_UNPACK_SNORM_4X8:
1452 source << " highp " << declareAndInitializeShaderVariable(dataType, "p")
1453 << " unpackSnorm4x8(p);\n";
1456 case SHADER_FUNCTION_UNPACK_UNORM_4X8:
1457 source << " highp " << declareAndInitializeShaderVariable(dataType, "p")
1458 << " unpackUnorm4x8(p);\n";
1462 DE_FATAL("Unsupported shader function.");
1467 return source.str();
1470 void pack_unorm_4x8 (NegativeTestContext& ctx)
1472 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1473 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1475 ctx.beginSection("packUnorm4x8: Invalid v type.");
1476 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1478 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1480 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1481 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
1483 if (s_floatTypes[dataTypeNdx] == glu::TYPE_FLOAT_VEC4)
1486 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_PACK_UNORM_4X8, s_floatTypes[dataTypeNdx]));
1487 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1490 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1493 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_PACK_UNORM_4X8, s_intTypes[dataTypeNdx]));
1494 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1497 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_PACK_UNORM_4X8, s_uintTypes[dataTypeNdx]));
1498 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1507 void pack_snorm_4x8 (NegativeTestContext& ctx)
1509 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1510 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1512 ctx.beginSection("packSnorm4x8: Invalid v type.");
1513 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1515 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1517 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1518 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
1520 if (s_floatTypes[dataTypeNdx] == glu::TYPE_FLOAT_VEC4)
1523 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_PACK_SNORM_4X8, s_floatTypes[dataTypeNdx]));
1524 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1526 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1529 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_PACK_SNORM_4X8, s_intTypes[dataTypeNdx]));
1530 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1533 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_PACK_SNORM_4X8, s_uintTypes[dataTypeNdx]));
1534 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1543 void unpack_snorm_4x8 (NegativeTestContext& ctx)
1545 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1546 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1548 ctx.beginSection("unpackSnorm4x8: Invalid v type.");
1549 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1551 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1553 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1554 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx)
1556 if (s_uintTypes[dataTypeNdx] == glu::TYPE_UINT)
1559 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UNPACK_SNORM_4X8, s_uintTypes[dataTypeNdx]));
1560 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1562 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1565 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UNPACK_SNORM_4X8, s_intTypes[dataTypeNdx]));
1566 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1569 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UNPACK_SNORM_4X8, s_floatTypes[dataTypeNdx]));
1570 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1579 void unpack_unorm_4x8 (NegativeTestContext& ctx)
1581 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1582 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1584 ctx.beginSection("unpackUnorm4x8: Invalid v type.");
1585 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1587 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1589 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1590 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_uintTypes); ++dataTypeNdx)
1592 if (s_uintTypes[dataTypeNdx] == glu::TYPE_UINT)
1595 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UNPACK_UNORM_4X8, s_uintTypes[dataTypeNdx]));
1596 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1598 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_intTypes); ++dataTypeNdx)
1601 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UNPACK_UNORM_4X8, s_intTypes[dataTypeNdx]));
1602 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1605 const std::string shaderSource(genShaderSourcePackUnpackNorm4x8(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_UNPACK_UNORM_4X8, s_floatTypes[dataTypeNdx]));
1606 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1616 std::string genShaderSourceTextureSize_sampler (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType lodDataType)
1618 std::ostringstream source;
1619 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
1620 << getShaderExtensionDeclaration(getDataTypeExtension(samplerDataType))
1621 << getShaderInitialization(ctx, shaderType)
1622 << declareShaderUniform(samplerDataType, "sampler")
1623 << "void main(void)\n"
1626 switch (samplerDataType)
1628 case glu::TYPE_SAMPLER_2D:
1629 case glu::TYPE_INT_SAMPLER_2D:
1630 case glu::TYPE_UINT_SAMPLER_2D:
1631 case glu::TYPE_SAMPLER_3D:
1632 case glu::TYPE_INT_SAMPLER_3D:
1633 case glu::TYPE_UINT_SAMPLER_3D:
1634 case glu::TYPE_SAMPLER_CUBE:
1635 case glu::TYPE_INT_SAMPLER_CUBE:
1636 case glu::TYPE_UINT_SAMPLER_CUBE:
1637 case glu::TYPE_SAMPLER_2D_ARRAY:
1638 case glu::TYPE_INT_SAMPLER_2D_ARRAY:
1639 case glu::TYPE_UINT_SAMPLER_2D_ARRAY:
1640 case glu::TYPE_SAMPLER_CUBE_SHADOW:
1641 case glu::TYPE_SAMPLER_2D_SHADOW:
1642 case glu::TYPE_SAMPLER_2D_ARRAY_SHADOW:
1643 case glu::TYPE_SAMPLER_CUBE_ARRAY:
1644 case glu::TYPE_INT_SAMPLER_CUBE_ARRAY:
1645 case glu::TYPE_UINT_SAMPLER_CUBE_ARRAY:
1646 case glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW:
1647 source << " textureSize(sampler);\n";
1650 case glu::TYPE_SAMPLER_2D_MULTISAMPLE:
1651 case glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE:
1652 case glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE:
1653 case glu::TYPE_SAMPLER_BUFFER:
1654 case glu::TYPE_INT_SAMPLER_BUFFER:
1655 case glu::TYPE_UINT_SAMPLER_BUFFER:
1656 case glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY:
1657 case glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
1658 case glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY:
1659 source << " " << declareAndInitializeShaderVariable(lodDataType, "lod")
1660 << " textureSize(sampler, lod);\n";
1664 DE_FATAL("Unsupported data type.");
1669 return source.str();
1672 void texture_size_invalid_sampler (NegativeTestContext& ctx)
1674 ctx.beginSection("textureSize: Invalid sampler type - some overloads take two arguments while others take only one.");
1675 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1677 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1679 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1680 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_samplerTypes); ++dataTypeNdx)
1682 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(s_samplerTypes[dataTypeNdx])))
1684 ctx.beginSection("Verify sampler data type: " + std::string(getDataTypeName(s_samplerTypes[dataTypeNdx])));
1685 const std::string shaderSource(genShaderSourceTextureSize_sampler(ctx, s_shaders[shaderNdx], s_samplerTypes[dataTypeNdx], glu::TYPE_INT));
1686 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1696 std::string genShaderSourceTextureSize_lod (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType lodDataType)
1698 std::ostringstream source;
1699 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
1700 << getShaderExtensionDeclaration(getDataTypeExtension(samplerDataType))
1701 << getShaderInitialization(ctx, shaderType)
1702 << declareShaderUniform(samplerDataType, "sampler")
1703 << "void main(void)\n"
1705 << " " << declareAndInitializeShaderVariable(lodDataType, "lod")
1706 << " textureSize(sampler, lod);\n"
1709 return source.str();
1712 void texture_size_invalid_lod (NegativeTestContext& ctx)
1714 ctx.beginSection("textureSize: Invalid lod type.");
1715 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1717 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1719 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1720 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_samplerTypes); ++dataTypeNdx)
1722 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(s_samplerTypes[dataTypeNdx])))
1724 ctx.beginSection("Verify sampler/lod data type" + std::string(getDataTypeName(s_samplerTypes[dataTypeNdx])));
1725 for (int dataTypeNdx2 = 0; dataTypeNdx2 < DE_LENGTH_OF_ARRAY(s_nonScalarIntTypes); ++dataTypeNdx2)
1727 if (s_nonScalarIntTypes[dataTypeNdx2] == glu::TYPE_INT)
1730 const std::string shaderSource(genShaderSourceTextureSize_lod(ctx, s_shaders[shaderNdx], s_samplerTypes[dataTypeNdx], s_nonScalarIntTypes[dataTypeNdx2]));
1731 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1743 std::string genShaderSourceTexture (NegativeTestContext& ctx, glu::ShaderType shaderType, FunctionTextureModes mode, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType thirdArgumentDataType)
1745 std::ostringstream source;
1746 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
1747 << getShaderExtensionDeclaration(getDataTypeExtension(samplerDataType))
1748 << getShaderInitialization(ctx, shaderType)
1749 << declareShaderUniform(samplerDataType, "sampler")
1750 << "void main(void)\n"
1752 << " highp " << declareAndInitializeShaderVariable(pDataType, "lod");
1756 case FUNCTION_TEXTURE_MODE_NO_BIAS_NO_COMPARE:
1757 source << " texture(sampler, lod);\n";
1760 case FUNCTION_TEXTURE_MODE_BIAS_OR_COMPARE:
1761 source << " highp " << declareAndInitializeShaderVariable(thirdArgumentDataType, "thirdArgument")
1762 << " texture(sampler, lod, thirdArgument);\n";
1766 DE_FATAL("Unsupported shader function overload.");
1771 return source.str();
1774 std::string genShaderSourceTexture (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType)
1776 return genShaderSourceTexture(ctx, shaderType, FUNCTION_TEXTURE_MODE_NO_BIAS_NO_COMPARE, samplerDataType, pDataType, glu::TYPE_LAST);
1779 std::string genShaderSourceTexture (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType thirdArgumentDataType)
1781 return genShaderSourceTexture(ctx, shaderType, FUNCTION_TEXTURE_MODE_BIAS_OR_COMPARE, samplerDataType, pDataType, thirdArgumentDataType);
1784 void texture_invalid_p (NegativeTestContext& ctx)
1786 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
1787 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
1789 ctx.beginSection("texture: Invalid P type.");
1790 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
1792 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
1794 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
1795 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
1798 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC2)
1801 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, s_floatTypes[dataTypeNdx]));
1802 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1805 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1806 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1809 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, s_floatTypes[dataTypeNdx]));
1810 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1813 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1814 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1817 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, s_floatTypes[dataTypeNdx]));
1818 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1821 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1822 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1826 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, s_intTypes[dataTypeNdx]));
1827 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1830 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1831 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1834 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, s_intTypes[dataTypeNdx]));
1835 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1838 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1839 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1842 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, s_intTypes[dataTypeNdx]));
1843 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1846 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1847 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1850 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, s_uintTypes[dataTypeNdx]));
1851 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1854 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
1855 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1858 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, s_uintTypes[dataTypeNdx]));
1859 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1862 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
1863 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1866 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, s_uintTypes[dataTypeNdx]));
1867 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1870 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
1871 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1875 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC3)
1878 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, s_floatTypes[dataTypeNdx]));
1879 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1882 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1883 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1886 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, s_floatTypes[dataTypeNdx]));
1887 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1890 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1891 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1894 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, s_floatTypes[dataTypeNdx]));
1895 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1898 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1899 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1903 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, s_intTypes[dataTypeNdx]));
1904 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1907 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1908 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1911 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, s_intTypes[dataTypeNdx]));
1912 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1915 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1916 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1919 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, s_intTypes[dataTypeNdx]));
1920 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1923 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1924 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1927 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, s_uintTypes[dataTypeNdx]));
1928 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1931 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
1932 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1935 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, s_uintTypes[dataTypeNdx]));
1936 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1939 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
1940 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1943 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, s_uintTypes[dataTypeNdx]));
1944 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1947 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
1948 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1952 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC3)
1955 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, s_floatTypes[dataTypeNdx]));
1956 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1959 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1960 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1963 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, s_floatTypes[dataTypeNdx]));
1964 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1967 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1968 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1971 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, s_floatTypes[dataTypeNdx]));
1972 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1975 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
1976 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1981 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, s_intTypes[dataTypeNdx]));
1982 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1985 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1986 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1989 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, s_intTypes[dataTypeNdx]));
1990 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1993 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
1994 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
1997 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, s_intTypes[dataTypeNdx]));
1998 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2001 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2002 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2007 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, s_uintTypes[dataTypeNdx]));
2008 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2011 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2012 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2015 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, s_uintTypes[dataTypeNdx]));
2016 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2019 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2020 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2023 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, s_uintTypes[dataTypeNdx]));
2024 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2027 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2028 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2033 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC3)
2036 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, s_floatTypes[dataTypeNdx]));
2037 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2040 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2041 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2044 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, s_floatTypes[dataTypeNdx]));
2045 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2048 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2049 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2052 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, s_floatTypes[dataTypeNdx]));
2053 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2056 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2057 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2061 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, s_intTypes[dataTypeNdx]));
2062 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2065 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2066 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2069 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, s_intTypes[dataTypeNdx]));
2070 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2073 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2074 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2077 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, s_intTypes[dataTypeNdx]));
2078 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2081 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2082 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2085 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, s_uintTypes[dataTypeNdx]));
2086 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2089 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2090 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2093 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, s_uintTypes[dataTypeNdx]));
2094 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2097 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2098 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2101 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, s_uintTypes[dataTypeNdx]));
2102 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2105 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2106 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2109 // SAMPLER_2D_SHADOW
2110 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC3)
2113 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, s_floatTypes[dataTypeNdx]));
2114 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2117 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2118 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2122 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, s_intTypes[dataTypeNdx]));
2123 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2126 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2127 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2130 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, s_uintTypes[dataTypeNdx]));
2131 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2134 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2135 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2138 // SAMPLER_CUBE_SHADOW
2139 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC4)
2142 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, s_floatTypes[dataTypeNdx]));
2143 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2146 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2147 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2151 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, s_intTypes[dataTypeNdx]));
2152 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2155 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2156 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2159 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, s_uintTypes[dataTypeNdx]));
2160 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2163 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2164 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2167 // SAMPLER_2D_ARRAY_SHADOW
2168 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC4)
2171 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, s_floatTypes[dataTypeNdx]));
2172 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2175 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2176 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2180 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, s_intTypes[dataTypeNdx]));
2181 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2184 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2185 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2188 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, s_uintTypes[dataTypeNdx]));
2189 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2192 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2193 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2196 // SAMPLER_CUBE_ARRAY
2197 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY)))
2199 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC4)
2202 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx]));
2203 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2206 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2207 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2210 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx]));
2211 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2214 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2215 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2218 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx]));
2219 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2222 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2223 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2227 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx]));
2228 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2231 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2232 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2235 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx]));
2236 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2239 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2240 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2243 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx]));
2244 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2247 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2248 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2251 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx]));
2252 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2255 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2256 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2259 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx]));
2260 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2263 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2264 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2267 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx]));
2268 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2271 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2272 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2276 // SAMPLER_CUBE_ARRAY_SHADOW
2277 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW)))
2279 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC4)
2281 std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2282 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2285 std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2286 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2289 std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2290 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2300 void texture_invalid_bias_or_compare (NegativeTestContext& ctx)
2302 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
2303 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
2305 ctx.beginSection("texture: Invalid bias/compare type.");
2306 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
2308 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
2310 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
2311 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
2314 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2317 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_floatTypes[dataTypeNdx]));
2318 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2321 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_floatTypes[dataTypeNdx]));
2322 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2325 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_floatTypes[dataTypeNdx]));
2326 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2330 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_intTypes[dataTypeNdx]));
2331 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2334 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_uintTypes[dataTypeNdx]));
2335 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2338 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_intTypes[dataTypeNdx]));
2339 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2342 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_uintTypes[dataTypeNdx]));
2343 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2346 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_intTypes[dataTypeNdx]));
2347 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2350 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, s_uintTypes[dataTypeNdx]));
2351 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2355 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2358 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2359 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2362 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2363 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2366 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2367 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2371 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2372 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2375 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2376 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2379 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2380 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2383 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2384 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2387 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2388 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2391 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2392 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2396 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2398 std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2399 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2400 shaderSource = genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]);
2401 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2402 shaderSource = genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]);
2403 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2406 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2407 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2410 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2411 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2414 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2415 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2418 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2419 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2422 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2423 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2426 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2427 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2431 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2434 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2435 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2438 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2439 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2442 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2443 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2447 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2448 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2451 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2452 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2455 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2456 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2459 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2460 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2463 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2464 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2467 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2468 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2471 // SAMPLER_2D_SHADOW
2472 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2474 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC3, s_floatTypes[dataTypeNdx]));
2475 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2478 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC3, s_intTypes[dataTypeNdx]));
2479 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2482 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC3, s_uintTypes[dataTypeNdx]));
2483 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2486 // SAMPLER_CUBE_SHADOW
2487 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2489 std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, glu::TYPE_FLOAT_VEC4, s_floatTypes[dataTypeNdx]));
2490 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2493 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2494 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2497 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2498 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2501 // SAMPLER_CUBE_ARRAY
2502 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY)))
2504 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2507 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_floatTypes[dataTypeNdx]));
2508 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2511 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_floatTypes[dataTypeNdx]));
2512 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2515 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_floatTypes[dataTypeNdx]));
2516 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2520 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2521 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2524 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2525 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2528 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2529 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2532 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2533 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2536 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2537 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2540 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2541 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2545 // SAMPLER_CUBE_ARRAY_SHADOW
2546 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW)))
2548 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2551 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC4, s_floatTypes[dataTypeNdx]));
2552 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2556 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2557 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2560 const std::string shaderSource(genShaderSourceTexture(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2561 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2572 std::string genShaderSourceTextureLod (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType lodDataType)
2574 std::ostringstream source;
2575 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
2576 << getShaderExtensionDeclaration(getDataTypeExtension(samplerDataType))
2577 << getShaderInitialization(ctx, shaderType)
2578 << declareShaderUniform(samplerDataType, "sampler")
2579 << "void main(void)\n"
2581 << " " << declareAndInitializeShaderVariable(pDataType, "P")
2582 << " " << declareAndInitializeShaderVariable(lodDataType, "lod")
2583 << " textureLod(sampler, P, lod);\n"
2586 return source.str();
2589 void texture_lod_invalid_p (NegativeTestContext& ctx)
2591 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
2592 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
2594 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY)))
2596 ctx.beginSection("textureLod: Invalid P type.");
2597 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
2599 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
2601 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
2602 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
2604 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT_VEC4)
2607 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2608 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2611 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2612 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2615 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_FLOAT));
2616 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2620 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2621 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2624 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2625 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2628 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_FLOAT));
2629 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2632 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2633 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2636 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2637 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2640 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_FLOAT));
2641 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2651 void texture_lod_invalid_lod (NegativeTestContext& ctx)
2653 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
2654 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
2656 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY)))
2658 ctx.beginSection("textureLod: Invalid lod type.");
2659 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
2661 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
2663 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
2664 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
2666 if (s_floatTypes[dataTypeNdx] != glu::TYPE_FLOAT)
2669 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, s_floatTypes[dataTypeNdx]));
2670 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2673 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, s_floatTypes[dataTypeNdx]));
2674 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2677 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, s_floatTypes[dataTypeNdx]));
2678 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2682 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2683 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2686 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2687 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2690 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_intTypes[dataTypeNdx]));
2691 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2694 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2695 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2698 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2699 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2702 const std::string shaderSource(genShaderSourceTextureLod(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, s_uintTypes[dataTypeNdx]));
2703 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2714 std::string genShaderSourceTexelFetch (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType sampleDataType)
2716 std::ostringstream source;
2717 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
2718 << getShaderExtensionDeclaration(getDataTypeExtension(samplerDataType))
2719 << getShaderInitialization(ctx, shaderType)
2720 << declareShaderUniform(samplerDataType, "sampler")
2721 << "void main(void)\n"
2723 << " " << declareAndInitializeShaderVariable(pDataType, "P");
2725 switch (samplerDataType)
2727 case glu::TYPE_SAMPLER_2D_MULTISAMPLE:
2728 case glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE:
2729 case glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE:
2730 case glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY:
2731 case glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
2732 case glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY:
2733 source << " " << declareAndInitializeShaderVariable(sampleDataType, "varSample")
2734 << " texelFetch(sampler, P, varSample);\n";
2737 case glu::TYPE_SAMPLER_BUFFER:
2738 case glu::TYPE_INT_SAMPLER_BUFFER:
2739 case glu::TYPE_UINT_SAMPLER_BUFFER:
2740 source << " texelFetch(sampler, P);\n";
2744 DE_FATAL("Unsupported data type.");
2749 return source.str();
2752 std::string genShaderSourceTexelFetch (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType)
2754 return genShaderSourceTexelFetch(ctx, shaderType, samplerDataType, pDataType, glu::TYPE_LAST);
2757 void texel_fetch_invalid_p (NegativeTestContext& ctx)
2759 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
2760 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
2762 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY)))
2764 ctx.beginSection("texelFetch: Invalid P type.");
2765 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
2767 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
2769 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
2770 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
2772 // SAMPLER_2D_MULTISAMPLE
2774 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE, s_floatTypes[dataTypeNdx], glu::TYPE_INT));
2775 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2778 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE, s_floatTypes[dataTypeNdx], glu::TYPE_INT));
2779 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2782 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE, s_floatTypes[dataTypeNdx], glu::TYPE_INT));
2783 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2786 if (s_intTypes[dataTypeNdx] != glu::TYPE_INT_VEC2)
2789 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE, s_intTypes[dataTypeNdx], glu::TYPE_INT));
2790 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2793 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE, s_intTypes[dataTypeNdx], glu::TYPE_INT));
2794 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2797 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE, s_intTypes[dataTypeNdx], glu::TYPE_INT));
2798 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2802 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE, s_uintTypes[dataTypeNdx], glu::TYPE_INT));
2803 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2806 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE, s_uintTypes[dataTypeNdx], glu::TYPE_INT));
2807 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2810 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE, s_uintTypes[dataTypeNdx], glu::TYPE_INT));
2811 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2816 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_BUFFER, s_floatTypes[dataTypeNdx]));
2817 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2820 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_BUFFER, s_floatTypes[dataTypeNdx]));
2821 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2824 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_BUFFER, s_floatTypes[dataTypeNdx]));
2825 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2828 if (s_intTypes[dataTypeNdx] != glu::TYPE_INT)
2831 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_BUFFER, s_intTypes[dataTypeNdx]));
2832 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2835 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_BUFFER, s_intTypes[dataTypeNdx]));
2836 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2839 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_BUFFER, s_intTypes[dataTypeNdx]));
2840 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2845 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_BUFFER, s_uintTypes[dataTypeNdx]));
2846 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2849 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_BUFFER, s_uintTypes[dataTypeNdx]));
2850 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2853 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_BUFFER, s_uintTypes[dataTypeNdx]));
2854 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2857 // SAMPLER_2D_MULTISAMPLE_ARRAY
2859 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_INT));
2860 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2863 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_INT));
2864 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2867 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY, s_floatTypes[dataTypeNdx], glu::TYPE_INT));
2868 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2871 if (s_intTypes[dataTypeNdx] != glu::TYPE_INT_VEC3)
2874 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_INT));
2875 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2878 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_INT));
2879 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2882 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY, s_intTypes[dataTypeNdx], glu::TYPE_INT));
2883 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2887 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_INT));
2888 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2891 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_INT));
2892 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2895 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY, s_uintTypes[dataTypeNdx], glu::TYPE_INT));
2896 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2906 void texel_fetch_invalid_sample (NegativeTestContext& ctx)
2908 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_intTypes));
2909 DE_ASSERT(DE_LENGTH_OF_ARRAY(s_floatTypes) == DE_LENGTH_OF_ARRAY(s_uintTypes));
2911 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported(getDataTypeExtension(glu::TYPE_SAMPLER_CUBE_ARRAY)))
2913 ctx.beginSection("texelFetch: Invalid sample type.");
2914 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
2916 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
2918 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
2919 for (int dataTypeNdx = 0; dataTypeNdx < DE_LENGTH_OF_ARRAY(s_floatTypes); ++dataTypeNdx)
2921 // SAMPLER_2D_MULTISAMPLE
2923 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_floatTypes[dataTypeNdx]));
2924 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2927 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_floatTypes[dataTypeNdx]));
2928 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2931 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_floatTypes[dataTypeNdx]));
2932 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2935 // SAMPLER_2D_MULTISAMPLE_ARRAY
2937 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_floatTypes[dataTypeNdx]));
2938 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2941 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_floatTypes[dataTypeNdx]));
2942 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2945 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_floatTypes[dataTypeNdx]));
2946 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2949 if (s_intTypes[dataTypeNdx] != glu::TYPE_INT)
2951 // SAMPLER_2D_MULTISAMPLE
2953 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_intTypes[dataTypeNdx]));
2954 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2957 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_intTypes[dataTypeNdx]));
2958 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2961 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_intTypes[dataTypeNdx]));
2962 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2965 // SAMPLER_2D_MULTISAMPLE_ARRAY
2967 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_intTypes[dataTypeNdx]));
2968 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2971 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_intTypes[dataTypeNdx]));
2972 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2975 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_intTypes[dataTypeNdx]));
2976 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2980 // SAMPLER_2D_MULTISAMPLE
2982 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_uintTypes[dataTypeNdx]));
2983 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2986 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_uintTypes[dataTypeNdx]));
2987 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2990 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE, glu::TYPE_INT_VEC2, s_uintTypes[dataTypeNdx]));
2991 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
2994 // SAMPLER_2D_MULTISAMPLE_ARRAY
2996 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_uintTypes[dataTypeNdx]));
2997 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3000 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_uintTypes[dataTypeNdx]));
3001 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3004 const std::string shaderSource(genShaderSourceTexelFetch(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_MULTISAMPLE_ARRAY, glu::TYPE_INT_VEC3, s_uintTypes[dataTypeNdx]));
3005 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3015 // EmitVertex, EndPrimitive
3016 std::string genShaderSourceGeometry (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function)
3018 DE_ASSERT(function == SHADER_FUNCTION_EMIT_VERTEX || function == SHADER_FUNCTION_END_PRIMITIVE);
3020 std::ostringstream source;
3021 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
3022 << getShaderInitialization(ctx, shaderType)
3023 << "void main(void)\n"
3028 case SHADER_FUNCTION_EMIT_VERTEX:
3029 source << " EmitVertex();\n";
3032 case SHADER_FUNCTION_END_PRIMITIVE:
3033 source << " EndPrimitive();\n";
3037 DE_FATAL("Unsupported shader function.");
3042 return source.str();
3045 void emit_vertex (NegativeTestContext& ctx)
3047 ctx.beginSection("EmitVertex.");
3048 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3050 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3052 if (s_shaders[shaderNdx] == glu::SHADERTYPE_GEOMETRY)
3055 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3056 const std::string shaderSource = genShaderSourceGeometry(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_EMIT_VERTEX);
3057 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3064 void end_primitive (NegativeTestContext& ctx)
3066 ctx.beginSection("EndPrimitieve.");
3067 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3069 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3071 if (s_shaders[shaderNdx] == glu::SHADERTYPE_GEOMETRY)
3074 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3075 const std::string shaderSource = genShaderSourceGeometry(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_END_PRIMITIVE);
3076 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3084 std::string genShaderSourceTextureGrad (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType dpdxDataType, glu::DataType dpdyDataType)
3086 std::ostringstream source;
3088 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
3089 << getShaderExtensionDeclaration(getDataTypeExtension(samplerDataType))
3090 << getShaderInitialization(ctx, shaderType)
3091 << declareShaderUniform(samplerDataType, "sampler")
3092 << "void main(void)\n"
3094 << " mediump " << declareAndInitializeShaderVariable(pDataType, "P")
3095 << " mediump " << declareAndInitializeShaderVariable(dpdxDataType, "dPdx")
3096 << " mediump " << declareAndInitializeShaderVariable(dpdyDataType, "dPdy")
3097 << " textureGrad(sampler, P, dPdx, dPdy);\n"
3100 return source.str();
3103 void texture_grad (NegativeTestContext& ctx)
3105 TCU_CHECK_AND_THROW(NotSupportedError, ctx.isExtensionSupported("GL_EXT_texture_cube_map_array") || contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "Test requires support for GL_EXT_texture_cube_map_array or version 3.2.");
3107 ctx.beginSection("textureGrad.");
3108 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3110 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3112 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3114 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT_VEC3));
3115 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3118 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT, glu::TYPE_FLOAT_VEC3));
3119 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3122 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3123 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3126 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT_VEC3));
3127 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3130 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT, glu::TYPE_FLOAT_VEC3));
3131 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3134 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3135 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3138 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT_VEC3));
3139 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3142 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT, glu::TYPE_FLOAT_VEC3));
3143 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3146 const std::string shaderSource(genShaderSourceTextureGrad(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3147 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3156 std::string genShaderSourceTextureGather (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType thirdArgument)
3158 std::ostringstream source;
3160 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
3161 << getShaderExtensionDeclaration(getDataTypeExtension(samplerDataType))
3162 << getShaderInitialization(ctx, shaderType)
3163 << declareShaderUniform(samplerDataType, "sampler")
3164 << "void main(void)\n"
3166 << " mediump " << declareAndInitializeShaderVariable(pDataType, "P");
3168 if (thirdArgument != glu::TYPE_LAST)
3169 source << " mediump " << declareAndInitializeShaderVariable(thirdArgument, "arg3")
3170 << " textureGather(sampler, P, arg3);\n";
3172 source << " textureGather(sampler, P);\n";
3176 return source.str();
3179 std::string genShaderSourceTextureGather (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType samplerDataType, glu::DataType pDataType)
3181 return genShaderSourceTextureGather(ctx, shaderType, samplerDataType, pDataType, glu::TYPE_LAST);
3184 void texture_gather_sampler_2d (NegativeTestContext& ctx)
3186 ctx.beginSection("textureGrad - sampler2D");
3187 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3189 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3191 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3193 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT));
3194 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3197 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_FLOAT));
3198 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3201 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT));
3202 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3205 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT));
3206 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3209 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_FLOAT));
3210 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3213 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT));
3214 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3217 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT));
3218 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3221 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_FLOAT));
3222 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3225 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT));
3226 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3229 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC2));
3230 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3233 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT));
3234 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3242 void texture_gather_sampler_2d_array (NegativeTestContext& ctx)
3244 ctx.beginSection("textureGrad - sampler2DArray");
3245 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3247 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3249 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3251 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT));
3252 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3255 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3256 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3259 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT));
3260 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3263 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT));
3264 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3267 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3268 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3271 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT));
3272 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3275 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT));
3276 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3279 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3280 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3283 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT));
3284 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3287 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3));
3288 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3291 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
3292 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3300 void texture_gather_sampler_cube (NegativeTestContext& ctx)
3302 ctx.beginSection("textureGrad - samplerCube");
3303 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3305 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3307 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3309 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, glu::TYPE_FLOAT));
3310 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3313 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3314 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3317 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE, glu::TYPE_FLOAT, glu::TYPE_INT));
3318 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3321 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, glu::TYPE_FLOAT));
3322 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3325 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3326 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3329 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE, glu::TYPE_FLOAT, glu::TYPE_INT));
3330 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3333 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, glu::TYPE_FLOAT));
3334 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3337 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3338 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3341 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE, glu::TYPE_FLOAT, glu::TYPE_INT));
3342 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3345 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3));
3346 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3349 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
3350 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3358 void texture_gather_sampler_2d_shadow (NegativeTestContext& ctx)
3360 ctx.beginSection("textureGrad - sampler2DShadow");
3361 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3363 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3365 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3367 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT));
3368 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3371 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT));
3372 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3375 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT, glu::TYPE_FLOAT));
3376 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3379 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC2, glu::TYPE_FLOAT));
3380 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3388 void texture_gather_sampler_2d_array_shadow (NegativeTestContext& ctx)
3390 ctx.beginSection("textureGrad - sampler2DArrayShadow");
3391 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3393 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3395 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3397 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT));
3398 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3401 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
3402 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3405 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT, glu::TYPE_FLOAT));
3406 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3409 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3410 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3418 void texture_gather_sampler_cube_shadow (NegativeTestContext& ctx)
3420 ctx.beginSection("textureGrad - samplerCubeShadow");
3421 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3423 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3425 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3427 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, glu::TYPE_FLOAT));
3428 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3431 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
3432 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3435 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_SHADOW, glu::TYPE_FLOAT, glu::TYPE_FLOAT));
3436 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3439 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
3440 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3448 void texture_gather_sampler_cube_array (NegativeTestContext& ctx)
3450 TCU_CHECK_AND_THROW(
3452 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported("GL_EXT_texture_cube_map_array"),
3453 "Test requires extension GL_EXT_texture_cube_map_array or context version 3.2 or higher.");
3455 ctx.beginSection("textureGrad - samplerCubeArray");
3456 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3458 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3460 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3462 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT));
3463 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3466 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT));
3467 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3470 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT));
3471 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3474 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT));
3475 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3478 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT));
3479 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3482 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_INT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT));
3483 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3486 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT));
3487 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3490 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT));
3491 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3494 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_UINT_SAMPLER_CUBE_ARRAY, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT));
3495 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3498 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC4, glu::TYPE_INT));
3499 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3507 void texture_gather_sampler_cube_array_shadow (NegativeTestContext& ctx)
3509 TCU_CHECK_AND_THROW(
3511 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported("GL_EXT_texture_cube_map_array"),
3512 "Test requires extension GL_EXT_texture_cube_map_array or context version 3.2 or higher.");
3514 ctx.beginSection("textureGrad - samplerCubeArrayShadow");
3515 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3517 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3519 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3521 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, glu::TYPE_FLOAT));
3522 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3525 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, glu::TYPE_FLOAT, glu::TYPE_FLOAT));
3526 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3529 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC4, glu::TYPE_INT));
3530 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3533 const std::string shaderSource(genShaderSourceTextureGather(ctx, s_shaders[shaderNdx], glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT));
3534 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3542 // textureGatherOffset
3543 std::string genShaderSourceTextureGatherOffset (NegativeTestContext& ctx, glu::ShaderType shaderType, FunctionTextureGatherOffsetModes mode, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType offsetDataType, glu::DataType fourthArgument)
3545 DE_ASSERT(mode < FUNCTION_TEXTURE_GATHER_OFFSET_MODE_LAST);
3547 std::ostringstream source;
3549 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
3550 << getShaderInitialization(ctx, shaderType)
3551 << declareShaderUniform(samplerDataType, "sampler")
3552 << "void main(void)\n"
3554 << " mediump " << declareAndInitializeShaderVariable(pDataType, "P")
3555 << " mediump " << declareAndInitializeShaderVariable(offsetDataType, "offset");
3559 case FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP:
3561 if (fourthArgument != glu::TYPE_LAST)
3562 source << " mediump " << declareAndInitializeShaderVariable(fourthArgument, "comp")
3563 << " textureGatherOffset(sampler, P, offset, comp);\n";
3565 source << " textureGatherOffset(sampler, P, offset);\n";
3569 case FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z:
3571 source << " mediump " << declareAndInitializeShaderVariable(fourthArgument, "refZ")
3572 << " textureGatherOffset(sampler, P, refZ, offset);\n";
3577 DE_FATAL("Unsupported shader function overload.");
3582 return source.str();
3585 std::string genShaderSourceTextureGatherOffset (NegativeTestContext& ctx, glu::ShaderType shaderType, FunctionTextureGatherOffsetModes mode, glu::DataType samplerDataType, glu::DataType pDataType, glu::DataType offsetDataType)
3587 DE_ASSERT(mode == FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP);
3589 return genShaderSourceTextureGatherOffset(ctx, shaderType, mode, samplerDataType, pDataType, offsetDataType, glu::TYPE_LAST);
3592 void texture_gather_offset_sampler_2d (NegativeTestContext& ctx)
3594 ctx.beginSection("textureGatherOffset - sampler2D");
3595 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3597 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3599 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3601 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2));
3602 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3605 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT));
3606 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3609 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3610 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3613 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT, glu::TYPE_INT));
3614 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3617 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT));
3618 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3621 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2));
3622 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3625 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT));
3626 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3629 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3630 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3633 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT, glu::TYPE_INT));
3634 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3637 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT));
3638 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3641 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2));
3642 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3645 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT));
3646 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3649 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3650 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3653 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT, glu::TYPE_INT));
3654 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3657 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT));
3658 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3661 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2));
3662 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3665 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3666 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3674 void texture_gather_offset_sampler_2d_array (NegativeTestContext& ctx)
3676 ctx.beginSection("textureGatherOffset - sampler2DArray");
3677 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3679 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3681 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3683 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2));
3684 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3687 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
3688 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3691 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3692 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3695 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_INT));
3696 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3699 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_FLOAT));
3700 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3703 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2));
3704 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3707 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
3708 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3711 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3712 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3715 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_INT));
3716 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3719 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_INT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_FLOAT));
3720 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3723 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2));
3724 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3727 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
3728 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3731 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3732 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3735 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_INT));
3736 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3739 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_FLOAT));
3740 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3743 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_UINT_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3744 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3752 void texture_gather_offset_sampler_2d_shadow (NegativeTestContext& ctx)
3754 ctx.beginSection("textureGatherOffset - sampler2DShadow");
3755 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3757 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3759 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3761 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT));
3762 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3765 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3766 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3769 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT, glu::TYPE_FLOAT));
3770 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3773 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT));
3774 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3782 void texture_gather_offset_sampler_2d_array_shadow (NegativeTestContext& ctx)
3784 ctx.beginSection("textureGatherOffset - sampler2DShadow");
3785 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3787 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3789 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3791 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT));
3792 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3795 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_INT));
3796 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3799 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_FLOAT));
3800 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3803 const std::string shaderSource(genShaderSourceTextureGatherOffset(ctx, s_shaders[shaderNdx], FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_3D, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT));
3804 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3812 // atomicAdd, atomicMin, atomicMax, atomicAnd, atomicOr, atomixXor, atomixExchange, atomicCompSwap
3813 std::string genShaderSourceAtomicOperations (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType memDataType, glu::DataType dataDataType, glu::DataType compareDataType)
3815 DE_ASSERT(SHADER_FUNCTION_ATOMIC_ADD <= function && function <= SHADER_FUNCTION_ATOMIC_COMP_SWAP);
3817 std::ostringstream source;
3819 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
3820 << getShaderInitialization(ctx, shaderType)
3821 << declareBuffer(memDataType, "mem")
3824 << " mediump " << declareAndInitializeShaderVariable(dataDataType, "data");
3828 case SHADER_FUNCTION_ATOMIC_ADD: source << " atomicAdd(mem, data);\n"; break;
3829 case SHADER_FUNCTION_ATOMIC_MIN: source << " atomicMin(mem, data);\n"; break;
3830 case SHADER_FUNCTION_ATOMIC_MAX: source << " atomicMax(mem, data);\n"; break;
3831 case SHADER_FUNCTION_ATOMIC_AND: source << " atomicAnd(mem, data);\n"; break;
3832 case SHADER_FUNCTION_ATOMIC_OR: source << " atomicOr(mem, data);\n"; break;
3833 case SHADER_FUNCTION_ATOMIC_XOR: source << " atomicXor(mem, data);\n"; break;
3834 case SHADER_FUNCTION_ATOMIC_EXCHANGE: source << " atomicExchange(mem, data);\n"; break;
3835 case SHADER_FUNCTION_ATOMIC_COMP_SWAP:
3836 source << " mediump " << declareAndInitializeShaderVariable(compareDataType, "compare")
3837 << " atomicCompSwap(mem, compare, data);\n";
3841 DE_FATAL("Unsupported shader function.");
3846 return source.str();
3849 std::string genShaderSourceAtomicOperations (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType memDataType, glu::DataType dataDataType)
3851 DE_ASSERT(function != SHADER_FUNCTION_ATOMIC_COMP_SWAP);
3853 return genShaderSourceAtomicOperations(ctx, shaderType, function, memDataType, dataDataType, glu::TYPE_LAST);
3856 void atomic_add (NegativeTestContext& ctx)
3858 ctx.beginSection("atomicAdd");
3859 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3861 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3863 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3865 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_ADD, glu::TYPE_UINT, glu::TYPE_INT));
3866 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3869 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_ADD, glu::TYPE_INT, glu::TYPE_UINT));
3870 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3878 void atomic_min (NegativeTestContext& ctx)
3880 ctx.beginSection("atomicMin");
3881 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3883 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3885 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3887 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_MIN, glu::TYPE_UINT, glu::TYPE_INT));
3888 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3891 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_MIN, glu::TYPE_INT, glu::TYPE_UINT));
3892 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3900 void atomic_max (NegativeTestContext& ctx)
3902 ctx.beginSection("atomicMax");
3903 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3905 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3907 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3909 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_MAX, glu::TYPE_UINT, glu::TYPE_INT));
3910 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3913 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_MAX, glu::TYPE_INT, glu::TYPE_UINT));
3914 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3922 void atomic_and (NegativeTestContext& ctx)
3924 ctx.beginSection("atomicAnd");
3925 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3927 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3929 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3931 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_AND, glu::TYPE_UINT, glu::TYPE_INT));
3932 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3935 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_AND, glu::TYPE_INT, glu::TYPE_UINT));
3936 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3944 void atomic_or (NegativeTestContext& ctx)
3946 ctx.beginSection("atomicOr");
3947 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3949 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3951 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3953 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_OR, glu::TYPE_UINT, glu::TYPE_INT));
3954 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3957 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_OR, glu::TYPE_INT, glu::TYPE_UINT));
3958 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3966 void atomic_xor (NegativeTestContext& ctx)
3968 ctx.beginSection("atomicXor");
3969 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3971 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3973 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3975 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_XOR, glu::TYPE_UINT, glu::TYPE_INT));
3976 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3979 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_XOR, glu::TYPE_INT, glu::TYPE_UINT));
3980 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
3988 void atomic_exchange (NegativeTestContext& ctx)
3990 ctx.beginSection("atomicExchange");
3991 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
3993 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
3995 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
3997 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_EXCHANGE, glu::TYPE_UINT, glu::TYPE_INT));
3998 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4001 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_EXCHANGE, glu::TYPE_INT, glu::TYPE_UINT));
4002 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4010 void atomic_comp_swap (NegativeTestContext& ctx)
4012 ctx.beginSection("atomicCompSwap");
4013 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
4015 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
4017 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
4019 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_COMP_SWAP, glu::TYPE_UINT, glu::TYPE_INT, glu::TYPE_INT));
4020 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4023 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_COMP_SWAP, glu::TYPE_INT, glu::TYPE_UINT, glu::TYPE_INT));
4024 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4027 const std::string shaderSource(genShaderSourceAtomicOperations(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_ATOMIC_COMP_SWAP, glu::TYPE_INT, glu::TYPE_INT, glu::TYPE_UINT));
4028 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4036 // interpolatedAtCentroid, interpolatedAtSample, interpolateAtOffset,
4037 std::string genShaderSourceInterpolateAt (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType interpolantDataType, glu::DataType secondArgumentDataType)
4039 DE_ASSERT(function >= SHADER_FUNCTION_INTERPOLATED_AT_CENTROID && function <= SHADER_FUNCTION_INTERPOLATED_AT_OFFSET);
4041 const bool supportsES32 = contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
4042 std::ostringstream source;
4044 source << (supportsES32 ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
4045 << getShaderInitialization(ctx, shaderType)
4046 << (supportsES32 ? "" : getShaderExtensionDeclaration("GL_OES_shader_multisample_interpolation"))
4047 << declareShaderInput(interpolantDataType, "interpolant")
4053 case SHADER_FUNCTION_INTERPOLATED_AT_CENTROID:
4054 source << " interpolateAtCentroid(interpolant);\n";
4057 case SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE:
4058 source << " mediump " << declareAndInitializeShaderVariable(secondArgumentDataType, "sample")
4059 << " interpolateAtSample(interpolant, sample);\n";
4062 case SHADER_FUNCTION_INTERPOLATED_AT_OFFSET:
4063 source << " mediump " << declareAndInitializeShaderVariable(secondArgumentDataType, "offset")
4064 << " interpolateAtOffset(interpolant, offset);\n";
4068 DE_FATAL("Unsupported shader function.");
4073 return source.str();
4076 std::string genShaderSourceInterpolateAt (NegativeTestContext& ctx, glu::ShaderType shaderType, ShaderFunction function, glu::DataType interpolantDataType)
4078 DE_ASSERT(function == SHADER_FUNCTION_INTERPOLATED_AT_CENTROID);
4080 return genShaderSourceInterpolateAt(ctx, shaderType, function, interpolantDataType, glu::TYPE_LAST);
4083 void interpolate_at_centroid (NegativeTestContext& ctx)
4085 TCU_CHECK_AND_THROW(NotSupportedError,
4086 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported("GL_OES_shader_multisample_interpolation"),
4087 "This test requires a context version 3.2 or higher.");
4089 ctx.beginSection("interpolateAtCentroid");
4090 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
4092 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
4094 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
4095 if (s_shaders[shaderNdx] == glu::SHADERTYPE_FRAGMENT)
4097 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_CENTROID, glu::TYPE_INT));
4098 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4103 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_CENTROID, glu::TYPE_FLOAT));
4104 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4107 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_CENTROID, glu::TYPE_FLOAT_VEC2));
4108 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4111 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_CENTROID, glu::TYPE_FLOAT_VEC3));
4112 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4115 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_CENTROID, glu::TYPE_FLOAT_VEC4));
4116 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4125 void interpolate_at_sample (NegativeTestContext& ctx)
4127 TCU_CHECK_AND_THROW(NotSupportedError,
4128 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported("GL_OES_shader_multisample_interpolation"),
4129 "This test requires a context version 3.2 or higher.");
4131 ctx.beginSection("interpolateAtSample");
4132 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
4134 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
4136 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
4137 if (s_shaders[shaderNdx] == glu::SHADERTYPE_FRAGMENT)
4140 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_INT, glu::TYPE_INT));
4141 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4144 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT, glu::TYPE_FLOAT));
4145 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4148 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT_VEC2, glu::TYPE_FLOAT));
4149 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4152 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
4153 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4156 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT));
4157 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4163 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT, glu::TYPE_INT));
4164 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4167 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT));
4168 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4171 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT));
4172 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4175 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_SAMPLE, glu::TYPE_FLOAT_VEC4, glu::TYPE_INT));
4176 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4185 void interpolate_at_offset (NegativeTestContext& ctx)
4187 TCU_CHECK_AND_THROW(NotSupportedError,
4188 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported("GL_OES_shader_multisample_interpolation"),
4189 "This test requires a context version 3.2 or higher.");
4191 ctx.beginSection("interpolateAtOffset");
4192 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
4194 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
4196 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
4197 if (s_shaders[shaderNdx] == glu::SHADERTYPE_FRAGMENT)
4200 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_INT, glu::TYPE_FLOAT_VEC2));
4201 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4204 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT, glu::TYPE_FLOAT));
4205 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4208 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT_VEC2, glu::TYPE_FLOAT));
4209 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4212 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT));
4213 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4216 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT));
4217 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4223 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT, glu::TYPE_FLOAT_VEC2));
4224 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4227 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT_VEC2, glu::TYPE_FLOAT_VEC2));
4228 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4231 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT_VEC3, glu::TYPE_FLOAT_VEC2));
4232 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4235 const std::string shaderSource(genShaderSourceInterpolateAt(ctx, s_shaders[shaderNdx], SHADER_FUNCTION_INTERPOLATED_AT_OFFSET, glu::TYPE_FLOAT_VEC4, glu::TYPE_FLOAT_VEC2));
4236 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4246 // textureGatherOffsets
4247 std::string genShaderSourceTextureGatherOffsets (NegativeTestContext& ctx, glu::ShaderType shaderType, const TextureGatherOffsetsTestSpec& spec)
4249 std::ostringstream source;
4251 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
4252 << getShaderInitialization(ctx, shaderType)
4253 << declareShaderUniform(spec.samplerDataType, "sampler")
4254 << "void main(void)\n"
4256 << " mediump " << declareAndInitializeShaderVariable(spec.pDataType, "P")
4257 << " mediump " << (spec.offsetIsConst ? "const " : "") << declareShaderArrayVariable(spec.offsetsDataType, "offsets", spec.offsetArraySize) << "\n";
4261 case FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP:
4263 if (spec.fourthArgument != glu::TYPE_LAST)
4264 source << " mediump " << declareAndInitializeShaderVariable(spec.fourthArgument, "comp")
4265 << " textureGatherOffsets(sampler, P, offsets, comp);\n";
4267 source << " textureGatherOffsets(sampler, P, offsets);\n";
4271 case FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z:
4273 source << " mediump " << declareAndInitializeShaderVariable(spec.fourthArgument, "refZ")
4274 << " textureGatherOffsets(sampler, P, refZ, offsets);\n";
4279 DE_FATAL("Unsupported shader function overload.");
4284 return source.str();
4287 void texture_gather_offsets (NegativeTestContext& ctx)
4289 TCU_CHECK_AND_THROW(NotSupportedError,
4290 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported("GL_EXT_gpu_shader5"),
4291 "This test requires a context version 3.2 or higher.");
4293 const struct TextureGatherOffsetsTestSpec testSpecs[] =
4295 //mode samplerDataType pDataType offsetsDataType fourthArgument offsetIsConst offsetArraySize
4296 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_LAST, false, 4, },
4297 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_LAST, true, 3, },
4298 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_LAST, true, 4, },
4299 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT, glu::TYPE_LAST, true, 4, },
4300 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_INT, false, 4, },
4301 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, true, 4, },
4302 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_INT, true, 3, },
4303 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT, true, 4, },
4304 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT, glu::TYPE_INT, true, 4, },
4306 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_LAST, false, 4, },
4307 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_LAST, true, 3, },
4308 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_LAST, true, 4, },
4309 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_LAST, true, 4, },
4310 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_INT, false, 4, },
4311 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, true, 4, },
4312 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_INT, true, 3, },
4313 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_INT, true, 4, },
4314 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_COMP, glu::TYPE_SAMPLER_2D_ARRAY, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_INT, true, 4, },
4316 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, false, 4, },
4317 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, true, 3, },
4318 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, true, 4, },
4319 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT, glu::TYPE_FLOAT, true, 4, },
4320 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_SHADOW, glu::TYPE_FLOAT_VEC2, glu::TYPE_INT_VEC2, glu::TYPE_INT, true, 4, },
4322 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, false, 4, },
4323 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, true, 3, },
4324 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT, glu::TYPE_INT_VEC2, glu::TYPE_FLOAT, true, 4, },
4325 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT, glu::TYPE_FLOAT, true, 4, },
4326 { FUNCTION_TEXTURE_GATHER_OFFSET_MODE_REF_Z, glu::TYPE_SAMPLER_2D_ARRAY_SHADOW, glu::TYPE_FLOAT_VEC3, glu::TYPE_INT_VEC2, glu::TYPE_INT, true, 4, },
4329 ctx.beginSection("textureGatherOffsets");
4330 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
4332 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
4334 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
4335 for (int specNdx = 0; specNdx < DE_LENGTH_OF_ARRAY(testSpecs); ++specNdx)
4337 const std::string shaderSource(genShaderSourceTextureGatherOffsets(ctx, s_shaders[shaderNdx], testSpecs[specNdx]));
4338 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4347 std::string genShaderSourceFma (NegativeTestContext& ctx, glu::ShaderType shaderType, glu::DataType aDataType, glu::DataType bDataType, glu::DataType cDataType)
4349 std::ostringstream source;
4351 source << (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ? glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES)) << "\n"
4352 << getShaderInitialization(ctx, shaderType)
4353 << "void main(void)\n"
4355 << " mediump " << declareAndInitializeShaderVariable(aDataType, "a")
4356 << " mediump " << declareAndInitializeShaderVariable(bDataType, "b")
4357 << " mediump " << declareAndInitializeShaderVariable(cDataType, "c")
4360 return source.str();
4363 void fma (NegativeTestContext& ctx)
4365 TCU_CHECK_AND_THROW(NotSupportedError,
4366 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.isExtensionSupported("GL_EXT_gpu_shader5"),
4367 "This test requires a context version 3.2 or higher.");
4369 ctx.beginSection("fma");
4370 for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(s_shaders); ++shaderNdx)
4372 if (ctx.isShaderSupported(s_shaders[shaderNdx]))
4374 ctx.beginSection("Verify shader: " + std::string(getShaderTypeName(s_shaders[shaderNdx])));
4376 const std::string shaderSource(genShaderSourceFma(ctx, s_shaders[shaderNdx], glu::TYPE_FLOAT, glu::TYPE_FLOAT, glu::TYPE_INT));
4377 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4380 const std::string shaderSource(genShaderSourceFma(ctx, s_shaders[shaderNdx], glu::TYPE_FLOAT, glu::TYPE_INT, glu::TYPE_FLOAT));
4381 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4384 const std::string shaderSource(genShaderSourceFma(ctx, s_shaders[shaderNdx], glu::TYPE_INT, glu::TYPE_FLOAT, glu::TYPE_FLOAT));
4385 verifyShader(ctx, s_shaders[shaderNdx], shaderSource);
4395 std::vector<FunctionContainer> getNegativeShaderFunctionTestFunctions ()
4397 const FunctionContainer funcs[] =
4399 {bitfield_extract_invalid_value_type, "bitfield_extract_invalid_value_type", "Invalid usage of bitfieldExtract." },
4400 {bitfield_extract_invalid_offset_type, "bitfield_extract_invalid_offset_type", "Invalid usage of bitfieldExtract." },
4401 {bitfield_extract_invalid_bits_type, "bitfield_extract_invalid_bits_type", "Invalid usage of bitfieldExtract." },
4402 {bitfield_insert_invalid_base_type, "bitfield_insert_invalid_base_type", "Invalid usage of bitfieldInsert." },
4403 {bitfield_insert_invalid_insert_type, "bitfield_insert_invalid_insert_type", "Invalid usage of bitfieldInsert." },
4404 {bitfield_insert_invalid_offset_type, "bitfield_insert_invalid_offset_type", "Invalid usage of bitfieldInsert." },
4405 {bitfield_insert_invalid_bits_type, "bitfield_insert_invalid_bits_type", "Invalid usage of bitfieldInsert." },
4406 {bitfield_reverse, "bitfield_reverse", "Invalid usage of bitfieldReverse." },
4407 {bit_count, "bit_count", "Invalid usage of bitCount." },
4408 {find_msb, "find_msb", "Invalid usage of findMSB." },
4409 {find_lsb, "find_lsb", "Invalid usage of findLSB." },
4410 {uadd_carry_invalid_x, "uadd_carry_invalid_x", "Invalid usage of uaddCarry." },
4411 {uadd_carry_invalid_y, "uadd_carry_invalid_y", "Invalid usage of uaddCarry." },
4412 {uadd_carry_invalid_carry, "uadd_carry_invalid_carry", "Invalid usage of uaddCarry." },
4413 {usub_borrow_invalid_x, "usub_borrow_invalid_x", "Invalid usage of usubBorrow." },
4414 {usub_borrow_invalid_y, "usub_borrow_invalid_y", "Invalid usage of usubBorrow." },
4415 {usub_borrow_invalid_borrow, "usub_borrow_invalid_borrow", "Invalid usage of usubBorrow." },
4416 {umul_extended_invalid_x, "umul_extended_invalid_x", "Invalid usage of umulExtended." },
4417 {umul_extended_invalid_y, "umul_extended_invalid_y", "Invalid usage of umulExtended." },
4418 {umul_extended_invalid_msb, "umul_extended_invalid_msb", "Invalid usage of umulExtended." },
4419 {umul_extended_invalid_lsb, "umul_extended_invalid_lsb", "Invalid usage of umulExtended." },
4420 {imul_extended_invalid_x, "imul_extended_invalid_x", "Invalid usage of imulExtended." },
4421 {imul_extended_invalid_y, "imul_extended_invalid_y", "Invalid usage of imulExtended." },
4422 {imul_extended_invalid_msb, "imul_extended_invalid_msb", "Invalid usage of imulExtended." },
4423 {imul_extended_invalid_lsb, "imul_extended_invalid_lsb", "Invalid usage of imulExtended." },
4424 {frexp_invalid_x, "frexp_invalid_x", "Invalid usage of frexp." },
4425 {frexp_invalid_exp, "frexp_invalid_exp", "Invalid usage of frexp." },
4426 {ldexp_invalid_x, "ldexp_invalid_x", "Invalid usage of ldexp." },
4427 {ldexp_invalid_exp, "ldexp_invalid_exp", "Invalid usage of ldexp." },
4428 {pack_unorm_4x8, "pack_unorm_4x8", "Invalid usage of packUnorm4x8." },
4429 {pack_snorm_4x8, "pack_snorm_4x8", "Invalid usage of packSnorm4x8." },
4430 {unpack_snorm_4x8, "unpack_snorm_4x8", "Invalid usage of unpackSnorm4x8." },
4431 {unpack_unorm_4x8, "unpack_unorm_4x8", "Invalid usage of unpackUnorm4x8." },
4432 {texture_size_invalid_sampler, "texture_size_invalid_sampler", "Invalid usage of textureSize." },
4433 {texture_size_invalid_lod, "texture_size_invalid_lod", "Invalid usage of textureSize." },
4434 {texture_invalid_p, "texture_invalid_p", "Invalid usage of texture." },
4435 {texture_invalid_bias_or_compare, "texture_invalid_bias_or_compare", "Invalid usage of texture." },
4436 {texture_lod_invalid_p, "texture_lod_invalid_p", "Invalid usage of textureLod." },
4437 {texture_lod_invalid_lod, "texture_lod_invalid_lod", "Invalid usage of textureLod." },
4438 {texel_fetch_invalid_p, "texel_fetch_invalid_p", "Invalid usage of texelFetch." },
4439 {texel_fetch_invalid_sample, "texel_fetch_invalid_sample", "Invalid usage of texelFetch." },
4440 {emit_vertex, "emit_vertex", "Invalid usage of EmitVertex." },
4441 {end_primitive, "end_primitive", "Invalid usage of EndPrimitive." },
4442 {texture_grad, "texture_grad", "Invalid usage of textureGrad." },
4443 {texture_gather_sampler_2d, "texture_gather_sampler_2d", "Invalid usage of textureGather." },
4444 {texture_gather_sampler_2d_array, "texture_gather_sampler_2d_array", "Invalid usage of textureGather." },
4445 {texture_gather_sampler_cube, "texture_gather_sampler_cube", "Invalid usage of textureGather." },
4446 {texture_gather_sampler_2d_shadow, "texture_gather_sampler_2d_shadow", "Invalid usage of textureGather." },
4447 {texture_gather_sampler_2d_array_shadow, "texture_gather_sampler_2d_array_shadow", "Invalid usage of textureGather." },
4448 {texture_gather_sampler_cube_shadow, "texture_gather_sampler_cube_shadow", "Invalid usage of textureGather." },
4449 {texture_gather_sampler_cube_array, "texture_gather_sampler_cube_array", "Invalid usage of textureGather." },
4450 {texture_gather_sampler_cube_array_shadow, "texture_gather_sampler_cube_array_shadow", "Invalid usage of textureGather." },
4451 {texture_gather_offset_sampler_2d, "texture_gather_offset_sampler_2d", "Invalid usage of textureGatherOffset." },
4452 {texture_gather_offset_sampler_2d_array, "texture_gather_offset_sampler_2d_array", "Invalid usage of textureGatherOffset." },
4453 {texture_gather_offset_sampler_2d_shadow, "texture_gather_offset_sampler_2d_shadow", "Invalid usage of textureGatherOffset." },
4454 {texture_gather_offset_sampler_2d_array_shadow, "texture_gather_offset_sampler_2d_array_shadow", "Invalid usage of textureGatherOffset." },
4455 {texture_gather_offsets, "texture_gather_offsets", "Invalid usage of textureGatherOffsets." },
4456 {atomic_add, "atomic_add", "Invalid usage of atomicAdd." },
4457 {atomic_min, "atomic_min", "Invalid usage of atomicMin." },
4458 {atomic_max, "atomic_max", "Invalid usage of atomicMax." },
4459 {atomic_and, "atomic_and", "Invalid usage of atomicAnd." },
4460 {atomic_or, "atomic_or", "Invalid usage of atomicOr." },
4461 {atomic_xor, "atomic_xor", "Invalid usage of atomicXor." },
4462 {atomic_exchange, "atomic_exchange", "Invalid usage of atomicExchange." },
4463 {atomic_comp_swap, "atomic_comp_swap", "Invalid usage of atomicCompSwap." },
4464 {interpolate_at_centroid, "interpolate_at_centroid", "Invalid usage of interpolateAtCentroid." },
4465 {interpolate_at_sample, "interpolate_at_sample", "Invalid usage of interpolateAtSample." },
4466 {interpolate_at_offset, "interpolate_at_offset", "Invalid usage of interpolateAtOffset." },
4467 {fma, "fma", "Invalid usage of fma." },
4470 return std::vector<FunctionContainer>(DE_ARRAY_BEGIN(funcs), DE_ARRAY_END(funcs));
4473 } // NegativeTestShared