1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
5 * Copyright (c) 2016 The Khronos Group Inc.
6 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * Copyright (c) 2016 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief Texture access and query function tests.
24 *//*--------------------------------------------------------------------*/
26 #include "vktShaderRenderTextureFunctionTests.hpp"
27 #include "vktShaderRender.hpp"
28 #include "gluTextureUtil.hpp"
29 #include "tcuTexture.hpp"
30 #include "tcuTextureUtil.hpp"
31 #include "tcuTestLog.hpp"
32 #include "glwEnums.hpp"
34 #include "vkImageUtil.hpp"
35 #include "vkQueryUtil.hpp"
55 FUNCTION_TEXTURE = 0, //!< texture(), textureOffset()
56 FUNCTION_TEXTUREPROJ, //!< textureProj(), textureProjOffset()
57 FUNCTION_TEXTUREPROJ2, //!< textureProj(sampler1D, vec2)
58 FUNCTION_TEXTUREPROJ3, //!< textureProj(sampler2D, vec3)
59 FUNCTION_TEXTURELOD, // ...
60 FUNCTION_TEXTUREPROJLOD,
61 FUNCTION_TEXTUREPROJLOD2, //!< textureProjLod(sampler1D, vec2)
62 FUNCTION_TEXTUREPROJLOD3, //!< textureProjLod(sampler2D, vec3)
64 FUNCTION_TEXTUREPROJGRAD,
65 FUNCTION_TEXTUREPROJGRAD2, //!< textureProjGrad(sampler1D, vec2)
66 FUNCTION_TEXTUREPROJGRAD3, //!< textureProjGrad(sampler2D, vec3)
72 inline bool functionHasAutoLod (glu::ShaderType shaderType, Function function)
74 return shaderType == glu::SHADERTYPE_FRAGMENT &&
75 (function == FUNCTION_TEXTURE ||
76 function == FUNCTION_TEXTUREPROJ ||
77 function == FUNCTION_TEXTUREPROJ2 ||
78 function == FUNCTION_TEXTUREPROJ3);
81 inline bool functionHasProj (Function function)
83 return function == FUNCTION_TEXTUREPROJ ||
84 function == FUNCTION_TEXTUREPROJ2 ||
85 function == FUNCTION_TEXTUREPROJ3 ||
86 function == FUNCTION_TEXTUREPROJLOD ||
87 function == FUNCTION_TEXTUREPROJLOD2 ||
88 function == FUNCTION_TEXTUREPROJLOD3 ||
89 function == FUNCTION_TEXTUREPROJGRAD ||
90 function == FUNCTION_TEXTUREPROJGRAD2||
91 function == FUNCTION_TEXTUREPROJGRAD3;
94 inline bool functionHasGrad (Function function)
96 return function == FUNCTION_TEXTUREGRAD ||
97 function == FUNCTION_TEXTUREPROJGRAD ||
98 function == FUNCTION_TEXTUREPROJGRAD2||
99 function == FUNCTION_TEXTUREPROJGRAD3;
102 inline bool functionHasLod (Function function)
104 return function == FUNCTION_TEXTURELOD ||
105 function == FUNCTION_TEXTUREPROJLOD ||
106 function == FUNCTION_TEXTUREPROJLOD2 ||
107 function == FUNCTION_TEXTUREPROJLOD3 ||
108 function == FUNCTION_TEXELFETCH;
111 struct TextureLookupSpec
121 // Bias or Lod for *Lod* functions
125 // For *Grad* functions
134 TextureLookupSpec (void)
135 : function (FUNCTION_LAST)
150 TextureLookupSpec (Function function_,
151 const tcu::Vec4& minCoord_,
152 const tcu::Vec4& maxCoord_,
156 const tcu::Vec3& minDX_,
157 const tcu::Vec3& maxDX_,
158 const tcu::Vec3& minDY_,
159 const tcu::Vec3& maxDY_,
161 const tcu::IVec3& offset_)
162 : function (function_)
163 , minCoord (minCoord_)
164 , maxCoord (maxCoord_)
166 , minLodBias (minLodBias_)
167 , maxLodBias (maxLodBias_)
172 , useOffset (useOffset_)
183 TEXTURETYPE_CUBE_MAP,
184 TEXTURETYPE_1D_ARRAY,
185 TEXTURETYPE_2D_ARRAY,
186 TEXTURETYPE_CUBE_ARRAY,
193 TextureType type; //!< Texture type (2D, cubemap, ...)
194 deUint32 format; //!< Internal format.
199 tcu::Sampler sampler;
202 : type (TEXTURETYPE_LAST)
211 TextureSpec (TextureType type_,
217 const tcu::Sampler& sampler_)
223 , numLevels (numLevels_)
229 struct TexLookupParams
236 TexLookupParams (void)
245 // \note LodMode and computeLodFromDerivates functions are copied from glsTextureTestUtil
246 namespace TextureTestUtil
251 LODMODE_EXACT = 0, //!< Ideal lod computation.
252 LODMODE_MIN_BOUND, //!< Use estimation range minimum bound.
253 LODMODE_MAX_BOUND, //!< Use estimation range maximum bound.
258 // 1D lookup LOD computation.
260 float computeLodFromDerivates (LodMode mode, float dudx, float dudy)
265 // \note [mika] Min and max bounds equal to exact with 1D textures
267 case LODMODE_MIN_BOUND:
268 case LODMODE_MAX_BOUND:
269 p = de::max(deFloatAbs(dudx), deFloatAbs(dudy));
276 return deFloatLog2(p);
279 // 2D lookup LOD computation.
281 float computeLodFromDerivates (LodMode mode, float dudx, float dvdx, float dudy, float dvdy)
287 p = de::max(deFloatSqrt(dudx*dudx + dvdx*dvdx), deFloatSqrt(dudy*dudy + dvdy*dvdy));
290 case LODMODE_MIN_BOUND:
291 case LODMODE_MAX_BOUND:
293 float mu = de::max(deFloatAbs(dudx), deFloatAbs(dudy));
294 float mv = de::max(deFloatAbs(dvdx), deFloatAbs(dvdy));
296 p = mode == LODMODE_MIN_BOUND ? de::max(mu, mv) : mu + mv;
304 return deFloatLog2(p);
307 // 3D lookup LOD computation.
309 float computeLodFromDerivates (LodMode mode, float dudx, float dvdx, float dwdx, float dudy, float dvdy, float dwdy)
315 p = de::max(deFloatSqrt(dudx*dudx + dvdx*dvdx + dwdx*dwdx), deFloatSqrt(dudy*dudy + dvdy*dvdy + dwdy*dwdy));
318 case LODMODE_MIN_BOUND:
319 case LODMODE_MAX_BOUND:
321 float mu = de::max(deFloatAbs(dudx), deFloatAbs(dudy));
322 float mv = de::max(deFloatAbs(dvdx), deFloatAbs(dvdy));
323 float mw = de::max(deFloatAbs(dwdx), deFloatAbs(dwdy));
325 p = mode == LODMODE_MIN_BOUND ? de::max(de::max(mu, mv), mw) : (mu + mv + mw);
333 return deFloatLog2(p);
338 using namespace TextureTestUtil;
340 static const LodMode DEFAULT_LOD_MODE = LODMODE_EXACT;
342 inline float computeLodFromGrad2D (const ShaderEvalContext& c)
344 float w = (float)c.textures[0].tex2D->getWidth();
345 float h = (float)c.textures[0].tex2D->getHeight();
346 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*w, c.in[1].y()*h, c.in[2].x()*w, c.in[2].y()*h);
349 inline float computeLodFromGrad2DArray (const ShaderEvalContext& c)
351 float w = (float)c.textures[0].tex2DArray->getWidth();
352 float h = (float)c.textures[0].tex2DArray->getHeight();
353 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*w, c.in[1].y()*h, c.in[2].x()*w, c.in[2].y()*h);
356 inline float computeLodFromGrad3D (const ShaderEvalContext& c)
358 float w = (float)c.textures[0].tex3D->getWidth();
359 float h = (float)c.textures[0].tex3D->getHeight();
360 float d = (float)c.textures[0].tex3D->getDepth();
361 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*w, c.in[1].y()*h, c.in[1].z()*d, c.in[2].x()*w, c.in[2].y()*h, c.in[2].z()*d);
364 inline float computeLodFromGradCube (const ShaderEvalContext& c)
366 // \note Major axis is always -Z or +Z
367 float m = de::abs(c.in[0].z());
368 float d = (float)c.textures[0].texCube->getSize();
369 float s = d/(2.0f*m);
370 float t = d/(2.0f*m);
371 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*s, c.in[1].y()*t, c.in[2].x()*s, c.in[2].y()*t);
374 inline float computeLodFromGrad1D (const ShaderEvalContext& c)
376 float w = (float)c.textures[0].tex1D->getWidth();
377 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*w, c.in[2].x()*w);
380 inline float computeLodFromGrad1DArray (const ShaderEvalContext& c)
382 float w = (float)c.textures[0].tex1DArray->getWidth();
383 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*w, c.in[2].x()*w);
386 inline float computeLodFromGradCubeArray (const ShaderEvalContext& c)
388 // \note Major axis is always -Z or +Z
389 float m = de::abs(c.in[0].z());
390 float d = (float)c.textures[0].texCubeArray->getSize();
391 float s = d/(2.0f*m);
392 float t = d/(2.0f*m);
393 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*s, c.in[1].y()*t, c.in[2].x()*s, c.in[2].y()*t);
396 typedef void (*TexEvalFunc) (ShaderEvalContext& c, const TexLookupParams& lookupParams);
398 inline Vec4 texture2D (const ShaderEvalContext& c, float s, float t, float lod) { return c.textures[0].tex2D->sample(c.textures[0].sampler, s, t, lod); }
399 inline Vec4 textureCube (const ShaderEvalContext& c, float s, float t, float r, float lod) { return c.textures[0].texCube->sample(c.textures[0].sampler, s, t, r, lod); }
400 inline Vec4 texture2DArray (const ShaderEvalContext& c, float s, float t, float r, float lod) { return c.textures[0].tex2DArray->sample(c.textures[0].sampler, s, t, r, lod); }
401 inline Vec4 texture3D (const ShaderEvalContext& c, float s, float t, float r, float lod) { return c.textures[0].tex3D->sample(c.textures[0].sampler, s, t, r, lod); }
402 inline Vec4 texture1D (const ShaderEvalContext& c, float s, float lod) { return c.textures[0].tex1D->sample(c.textures[0].sampler, s, lod); }
403 inline Vec4 texture1DArray (const ShaderEvalContext& c, float s, float t, float lod) { return c.textures[0].tex1DArray->sample(c.textures[0].sampler, s, t, lod); }
404 inline Vec4 textureCubeArray (const ShaderEvalContext& c, float s, float t, float r, float q, float lod) { return c.textures[0].texCubeArray->sample(c.textures[0].sampler, s, t, r, q, lod); }
406 inline float texture2DShadow (const ShaderEvalContext& c, float ref, float s, float t, float lod) { return c.textures[0].tex2D->sampleCompare(c.textures[0].sampler, ref, s, t, lod); }
407 inline float textureCubeShadow (const ShaderEvalContext& c, float ref, float s, float t, float r, float lod) { return c.textures[0].texCube->sampleCompare(c.textures[0].sampler, ref, s, t, r, lod); }
408 inline float texture2DArrayShadow (const ShaderEvalContext& c, float ref, float s, float t, float r, float lod) { return c.textures[0].tex2DArray->sampleCompare(c.textures[0].sampler, ref, s, t, r, lod); }
409 inline float texture1DShadow (const ShaderEvalContext& c, float ref, float s, float lod) { return c.textures[0].tex1D->sampleCompare(c.textures[0].sampler, ref, s, lod); }
410 inline float texture1DArrayShadow (const ShaderEvalContext& c, float ref, float s, float t, float lod) { return c.textures[0].tex1DArray->sampleCompare(c.textures[0].sampler, ref, s, t, lod); }
411 inline float textureCubeArrayShadow (const ShaderEvalContext& c, float ref, float s, float t, float r, float q, float lod) { return c.textures[0].texCubeArray->sampleCompare(c.textures[0].sampler, ref, s, t, r, q, lod); }
413 inline Vec4 texture2DOffset (const ShaderEvalContext& c, float s, float t, float lod, IVec2 offset) { return c.textures[0].tex2D->sampleOffset(c.textures[0].sampler, s, t, lod, offset); }
414 inline Vec4 texture2DArrayOffset (const ShaderEvalContext& c, float s, float t, float r, float lod, IVec2 offset) { return c.textures[0].tex2DArray->sampleOffset(c.textures[0].sampler, s, t, r, lod, offset); }
415 inline Vec4 texture3DOffset (const ShaderEvalContext& c, float s, float t, float r, float lod, IVec3 offset) { return c.textures[0].tex3D->sampleOffset(c.textures[0].sampler, s, t, r, lod, offset); }
416 inline Vec4 texture1DOffset (const ShaderEvalContext& c, float s, float lod, deInt32 offset) { return c.textures[0].tex1D->sampleOffset(c.textures[0].sampler, s, lod, offset); }
417 inline Vec4 texture1DArrayOffset (const ShaderEvalContext& c, float s, float t, float lod, deInt32 offset) { return c.textures[0].tex1DArray->sampleOffset(c.textures[0].sampler, s, t, lod, offset); }
419 inline float texture2DShadowOffset (const ShaderEvalContext& c, float ref, float s, float t, float lod, IVec2 offset) { return c.textures[0].tex2D->sampleCompareOffset(c.textures[0].sampler, ref, s, t, lod, offset); }
420 inline float texture2DArrayShadowOffset (const ShaderEvalContext& c, float ref, float s, float t, float r, float lod, IVec2 offset) { return c.textures[0].tex2DArray->sampleCompareOffset(c.textures[0].sampler, ref, s, t, r, lod, offset); }
421 inline float texture1DShadowOffset (const ShaderEvalContext& c, float ref, float s, float lod, deInt32 offset) { return c.textures[0].tex1D->sampleCompareOffset(c.textures[0].sampler, ref, s, lod, offset); }
422 inline float texture1DArrayShadowOffset (const ShaderEvalContext& c, float ref, float s, float t, float lod, deInt32 offset) { return c.textures[0].tex1DArray->sampleCompareOffset(c.textures[0].sampler, ref, s, t, lod, offset); }
425 static void evalTexture2D (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x(), c.in[0].y(), p.lod)*p.scale + p.bias; }
426 static void evalTextureCube (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCube(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod)*p.scale + p.bias; }
427 static void evalTexture2DArray (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod)*p.scale + p.bias; }
428 static void evalTexture3D (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod)*p.scale + p.bias; }
429 static void evalTexture1D (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), p.lod)*p.scale + p.bias; }
430 static void evalTexture1DArray (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArray(c, c.in[0].x(), c.in[0].y(), p.lod)*p.scale + p.bias; }
431 static void evalTextureCubeArray (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCubeArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[0].w(), p.lod)*p.scale + p.bias; }
433 static void evalTexture2DBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x())*p.scale + p.bias; }
434 static void evalTextureCubeBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCube(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod+c.in[1].x())*p.scale + p.bias; }
435 static void evalTexture2DArrayBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod+c.in[1].x())*p.scale + p.bias; }
436 static void evalTexture3DBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod+c.in[1].x())*p.scale + p.bias; }
437 static void evalTexture1DBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), p.lod+c.in[1].x())*p.scale + p.bias; }
438 static void evalTexture1DArrayBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArray(c, c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x())*p.scale + p.bias; }
439 static void evalTextureCubeArrayBias(ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCubeArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[0].w(), p.lod+c.in[1].x())*p.scale + p.bias; }
441 static void evalTexture2DProj3 (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), p.lod)*p.scale + p.bias; }
442 static void evalTexture2DProj3Bias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), p.lod+c.in[1].x())*p.scale + p.bias; }
443 static void evalTexture2DProj (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod)*p.scale + p.bias; }
444 static void evalTexture2DProjBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod+c.in[1].x())*p.scale + p.bias; }
445 static void evalTexture3DProj (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), p.lod)*p.scale + p.bias; }
446 static void evalTexture3DProjBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), p.lod+c.in[1].x())*p.scale + p.bias; }
447 static void evalTexture1DProj2 (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].y(), p.lod)*p.scale + p.bias; }
448 static void evalTexture1DProj2Bias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].y(), p.lod+c.in[1].x())*p.scale + p.bias; }
449 static void evalTexture1DProj (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].w(), p.lod)*p.scale + p.bias; }
450 static void evalTexture1DProjBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].w(), p.lod+c.in[1].x())*p.scale + p.bias; }
452 static void evalTexture2DLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x(), c.in[0].y(), c.in[1].x())*p.scale + p.bias; }
453 static void evalTextureCubeLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCube(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[1].x())*p.scale + p.bias; }
454 static void evalTexture2DArrayLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[1].x())*p.scale + p.bias; }
455 static void evalTexture3DLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[1].x())*p.scale + p.bias; }
456 static void evalTexture1DLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), c.in[1].x())*p.scale + p.bias; }
457 static void evalTexture1DArrayLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArray(c, c.in[0].x(), c.in[0].y(), c.in[1].x())*p.scale + p.bias; }
458 static void evalTextureCubeArrayLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCubeArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[0].w(), c.in[1].x())*p.scale + p.bias; }
460 static void evalTexture2DProjLod3 (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), c.in[1].x())*p.scale + p.bias; }
461 static void evalTexture2DProjLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[1].x())*p.scale + p.bias; }
462 static void evalTexture3DProjLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), c.in[1].x())*p.scale + p.bias; }
463 static void evalTexture1DProjLod2 (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].y(), c.in[1].x())*p.scale + p.bias; }
464 static void evalTexture1DProjLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].w(), c.in[1].x())*p.scale + p.bias; }
468 static void evalTexture2DOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x(), c.in[0].y(), p.lod, p.offset.swizzle(0,1))*p.scale + p.bias; }
469 static void evalTexture2DArrayOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArrayOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod, p.offset.swizzle(0,1))*p.scale + p.bias; }
470 static void evalTexture3DOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod, p.offset)*p.scale + p.bias; }
471 static void evalTexture1DOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x(), p.lod, p.offset.x())*p.scale + p.bias; }
472 static void evalTexture1DArrayOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArrayOffset(c, c.in[0].x(), c.in[0].y(), p.lod, p.offset.x())*p.scale + p.bias; }
474 static void evalTexture2DOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
475 static void evalTexture2DArrayOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArrayOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod+c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
476 static void evalTexture3DOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod+c.in[1].x(), p.offset)*p.scale + p.bias; }
477 static void evalTexture1DOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x(), p.lod+c.in[1].x(), p.offset.x())*p.scale + p.bias; }
478 static void evalTexture1DArrayOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArrayOffset(c, c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x(), p.offset.x())*p.scale + p.bias; }
480 static void evalTexture2DLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x(), c.in[0].y(), c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
481 static void evalTexture2DArrayLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArrayOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
482 static void evalTexture3DLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[1].x(), p.offset)*p.scale + p.bias; }
483 static void evalTexture1DLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x(), c.in[1].x(), p.offset.x())*p.scale + p.bias; }
484 static void evalTexture1DArrayLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArrayOffset(c, c.in[0].x(), c.in[0].y(), c.in[1].x(), p.offset.x())*p.scale + p.bias; }
486 static void evalTexture2DProj3Offset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), p.lod, p.offset.swizzle(0,1))*p.scale + p.bias; }
487 static void evalTexture2DProj3OffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), p.lod+c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
488 static void evalTexture2DProjOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod, p.offset.swizzle(0,1))*p.scale + p.bias; }
489 static void evalTexture2DProjOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod+c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
490 static void evalTexture3DProjOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), p.lod, p.offset)*p.scale + p.bias; }
491 static void evalTexture3DProjOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), p.lod+c.in[1].x(), p.offset)*p.scale + p.bias; }
492 static void evalTexture1DProj2Offset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].y(), p.lod, p.offset.x())*p.scale + p.bias; }
493 static void evalTexture1DProj2OffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].y(), p.lod+c.in[1].x(), p.offset.x())*p.scale + p.bias; }
494 static void evalTexture1DProjOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].w(), p.lod, p.offset.x())*p.scale + p.bias; }
495 static void evalTexture1DProjOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].w(), p.lod+c.in[1].x(), p.offset.x())*p.scale + p.bias; }
497 static void evalTexture2DProjLod3Offset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
498 static void evalTexture2DProjLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[1].x(), p.offset.swizzle(0,1))*p.scale + p.bias; }
499 static void evalTexture3DProjLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), c.in[1].x(), p.offset)*p.scale + p.bias; }
500 static void evalTexture1DProjLod2Offset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].y(), c.in[1].x(), p.offset.x())*p.scale + p.bias; }
501 static void evalTexture1DProjLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].w(), c.in[1].x(), p.offset.x())*p.scale + p.bias; }
505 static void evalTexture2DShadow (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod); }
506 static void evalTexture2DShadowBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x()); }
508 static void evalTextureCubeShadow (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = textureCubeShadow(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod); }
509 static void evalTextureCubeShadowBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = textureCubeShadow(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod+c.in[1].x()); }
511 static void evalTexture2DArrayShadow (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DArrayShadow(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod); }
512 static void evalTexture1DShadow (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), p.lod); }
513 static void evalTexture1DShadowBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), p.lod+c.in[1].x()); }
514 static void evalTexture1DArrayShadow (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod); }
515 static void evalTexture1DArrayShadowBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x()); }
516 static void evalTextureCubeArrayShadow (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = textureCubeArrayShadow(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[0].w(), p.lod); }
518 static void evalTexture2DShadowLod (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture2DShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), c.in[1].x()); }
519 static void evalTexture2DShadowLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), c.in[1].x(), p.offset.swizzle(0,1)); }
520 static void evalTexture1DShadowLod (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), c.in[1].x()); }
521 static void evalTexture1DShadowLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[1].x(), p.offset.x()); }
522 static void evalTexture1DArrayShadowLod (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DArrayShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), c.in[1].x()); }
523 static void evalTexture1DArrayShadowLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), c.in[1].x(), p.offset.x()); }
525 static void evalTexture2DShadowProj (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod); }
526 static void evalTexture2DShadowProjBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod+c.in[1].x()); }
527 static void evalTexture1DShadowProj (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), p.lod); }
528 static void evalTexture1DShadowProjBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), p.lod+c.in[1].x()); }
530 static void evalTexture2DShadowProjLod (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture2DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[1].x()); }
531 static void evalTexture2DShadowProjLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[1].x(), p.offset.swizzle(0,1)); }
532 static void evalTexture1DShadowProjLod (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[1].x()); }
533 static void evalTexture1DShadowProjLodOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[1].x(), p.offset.x()); }
535 static void evalTexture2DShadowOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod, p.offset.swizzle(0,1)); }
536 static void evalTexture2DShadowOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x(), p.offset.swizzle(0,1)); }
537 static void evalTexture2DArrayShadowOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DArrayShadowOffset(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), p.lod, p.offset.swizzle(0,1)); }
538 static void evalTexture1DShadowOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z(), c.in[0].x(), p.lod, p.offset.x()); }
539 static void evalTexture1DShadowOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z(), c.in[0].x(), p.lod+c.in[1].x(), p.offset.x()); }
540 static void evalTexture1DArrayShadowOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod, p.offset.x()); }
541 static void evalTexture1DArrayShadowOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), p.lod+c.in[1].x(), p.offset.x()); }
543 static void evalTexture2DShadowProjOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod, p.offset.swizzle(0,1)); }
544 static void evalTexture2DShadowProjOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), p.lod+c.in[1].x(), p.offset.swizzle(0,1)); }
545 static void evalTexture1DShadowProjOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), p.lod, p.offset.x()); }
546 static void evalTexture1DShadowProjOffsetBias (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), p.lod+c.in[1].x(), p.offset.x()); }
550 static void evalTexture2DGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x(), c.in[0].y(), computeLodFromGrad2D(c))*p.scale + p.bias; }
551 static void evalTextureCubeGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCube(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGradCube(c))*p.scale + p.bias; }
552 static void evalTexture2DArrayGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGrad2DArray(c))*p.scale + p.bias; }
553 static void evalTexture3DGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGrad3D(c))*p.scale + p.bias; }
554 static void evalTexture1DGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), computeLodFromGrad1D(c))*p.scale + p.bias; }
555 static void evalTexture1DArrayGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArray(c, c.in[0].x(), c.in[0].y(), computeLodFromGrad1DArray(c))*p.scale + p.bias; }
556 static void evalTextureCubeArrayGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCubeArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), c.in[0].w(), computeLodFromGradCubeArray(c))*p.scale + p.bias; }
558 static void evalTexture2DShadowGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture2DShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), computeLodFromGrad2D(c)); }
559 static void evalTextureCubeShadowGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = textureCubeShadow(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGradCube(c)); }
560 static void evalTexture2DArrayShadowGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture2DArrayShadow(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGrad2DArray(c)); }
561 static void evalTexture1DShadowGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), computeLodFromGrad1D(c)); }
562 static void evalTexture1DArrayShadowGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DArrayShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), computeLodFromGrad1DArray(c)); }
564 static void evalTexture2DGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x(), c.in[0].y(), computeLodFromGrad2D(c), p.offset.swizzle(0,1))*p.scale + p.bias; }
565 static void evalTexture2DArrayGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArrayOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGrad2DArray(c), p.offset.swizzle(0,1))*p.scale + p.bias; }
566 static void evalTexture3DGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGrad3D(c), p.offset)*p.scale + p.bias; }
567 static void evalTexture1DGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x(), computeLodFromGrad1D(c), p.offset.x())*p.scale + p.bias; }
568 static void evalTexture1DArrayGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArrayOffset(c, c.in[0].x(), c.in[0].y(), computeLodFromGrad1DArray(c), p.offset.x())*p.scale + p.bias; }
570 static void evalTexture2DShadowGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), computeLodFromGrad2D(c), p.offset.swizzle(0,1)); }
571 static void evalTexture2DArrayShadowGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DArrayShadowOffset(c, c.in[0].w(), c.in[0].x(), c.in[0].y(), c.in[0].z(), computeLodFromGrad2DArray(c), p.offset.swizzle(0,1)); }
572 static void evalTexture1DShadowGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z(), c.in[0].x(), computeLodFromGrad1D(c), p.offset.x()); }
573 static void evalTexture1DArrayShadowGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), computeLodFromGrad1DArray(c), p.offset.x()); }
575 static void evalTexture2DShadowProjGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture2DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), computeLodFromGrad2D(c)); }
576 static void evalTexture2DShadowProjGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), computeLodFromGrad2D(c), p.offset.swizzle(0,1)); }
577 static void evalTexture1DShadowProjGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DShadow(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), computeLodFromGrad1D(c)); }
578 static void evalTexture1DShadowProjGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z()/c.in[0].w(), c.in[0].x()/c.in[0].w(), computeLodFromGrad1D(c), p.offset.x()); }
580 static void evalTexture2DProjGrad3 (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), computeLodFromGrad2D(c))*p.scale + p.bias; }
581 static void evalTexture2DProjGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), computeLodFromGrad2D(c))*p.scale + p.bias; }
582 static void evalTexture3DProjGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), computeLodFromGrad3D(c))*p.scale + p.bias; }
583 static void evalTexture1DProjGrad2 (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].y(), computeLodFromGrad1D(c))*p.scale + p.bias; }
584 static void evalTexture1DProjGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x()/c.in[0].w(), computeLodFromGrad1D(c))*p.scale + p.bias; }
586 static void evalTexture2DProjGrad3Offset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].z(), c.in[0].y()/c.in[0].z(), computeLodFromGrad2D(c), p.offset.swizzle(0,1))*p.scale + p.bias; }
587 static void evalTexture2DProjGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), computeLodFromGrad2D(c), p.offset.swizzle(0,1))*p.scale + p.bias; }
588 static void evalTexture3DProjGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x()/c.in[0].w(), c.in[0].y()/c.in[0].w(), c.in[0].z()/c.in[0].w(), computeLodFromGrad3D(c), p.offset)*p.scale + p.bias; }
589 static void evalTexture1DProjGrad2Offset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].y(), computeLodFromGrad1D(c), p.offset.x())*p.scale + p.bias; }
590 static void evalTexture1DProjGradOffset (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x()/c.in[0].w(), computeLodFromGrad1D(c), p.offset.x())*p.scale + p.bias; }
592 // Texel fetch variants
594 static void evalTexelFetch2D (ShaderEvalContext& c, const TexLookupParams& p)
596 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
597 int y = deChopFloatToInt32(c.in[0].y())+p.offset.y();
598 int lod = deChopFloatToInt32(c.in[1].x());
599 c.color = c.textures[0].tex2D->getLevel(lod).getPixel(x, y)*p.scale + p.bias;
602 static void evalTexelFetch2DArray (ShaderEvalContext& c, const TexLookupParams& p)
604 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
605 int y = deChopFloatToInt32(c.in[0].y())+p.offset.y();
606 int l = deChopFloatToInt32(c.in[0].z());
607 int lod = deChopFloatToInt32(c.in[1].x());
608 c.color = c.textures[0].tex2DArray->getLevel(lod).getPixel(x, y, l)*p.scale + p.bias;
611 static void evalTexelFetch3D (ShaderEvalContext& c, const TexLookupParams& p)
613 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
614 int y = deChopFloatToInt32(c.in[0].y())+p.offset.y();
615 int z = deChopFloatToInt32(c.in[0].z())+p.offset.z();
616 int lod = deChopFloatToInt32(c.in[1].x());
617 c.color = c.textures[0].tex3D->getLevel(lod).getPixel(x, y, z)*p.scale + p.bias;
620 static void evalTexelFetch1D (ShaderEvalContext& c, const TexLookupParams& p)
622 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
623 int lod = deChopFloatToInt32(c.in[1].x());
624 c.color = c.textures[0].tex1D->getLevel(lod).getPixel(x, 0)*p.scale + p.bias;
627 static void evalTexelFetch1DArray (ShaderEvalContext& c, const TexLookupParams& p)
629 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
630 int l = deChopFloatToInt32(c.in[0].y());
631 int lod = deChopFloatToInt32(c.in[1].x());
632 c.color = c.textures[0].tex1DArray->getLevel(lod).getPixel(x, l)*p.scale + p.bias;
635 class TexLookupEvaluator : public ShaderEvaluator
638 TexLookupEvaluator (TexEvalFunc evalFunc, const TexLookupParams& lookupParams) : m_evalFunc(evalFunc), m_lookupParams(lookupParams) {}
639 virtual ~TexLookupEvaluator (void) {}
641 virtual void evaluate (ShaderEvalContext& ctx) const { m_evalFunc(ctx, m_lookupParams); }
644 TexEvalFunc m_evalFunc;
645 const TexLookupParams& m_lookupParams;
648 static void checkDeviceFeatures (Context& context, TextureType textureType)
650 if (textureType == TEXTURETYPE_CUBE_ARRAY)
652 const vk::VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
654 if (!deviceFeatures.imageCubeArray)
655 TCU_THROW(NotSupportedError, "Cube array is not supported");
659 class ShaderTextureFunctionInstance : public ShaderRenderCaseInstance
662 ShaderTextureFunctionInstance (Context& context,
663 const bool isVertexCase,
664 const ShaderEvaluator& evaluator,
665 const UniformSetup& uniformSetup,
666 const TextureLookupSpec& lookupSpec,
667 const TextureSpec& textureSpec,
668 const TexLookupParams& lookupParams,
669 const ImageBackingMode imageBackingMode = IMAGE_BACKING_MODE_REGULAR);
670 virtual ~ShaderTextureFunctionInstance (void);
673 virtual void setupUniforms (const tcu::Vec4&);
674 void initTexture (void);
676 const TextureLookupSpec& m_lookupSpec;
677 const TextureSpec& m_textureSpec;
678 const TexLookupParams& m_lookupParams;
681 ShaderTextureFunctionInstance::ShaderTextureFunctionInstance (Context& context,
682 const bool isVertexCase,
683 const ShaderEvaluator& evaluator,
684 const UniformSetup& uniformSetup,
685 const TextureLookupSpec& lookupSpec,
686 const TextureSpec& textureSpec,
687 const TexLookupParams& lookupParams,
688 const ImageBackingMode imageBackingMode)
689 : ShaderRenderCaseInstance (context, isVertexCase, evaluator, uniformSetup, DE_NULL, imageBackingMode)
690 , m_lookupSpec (lookupSpec)
691 , m_textureSpec (textureSpec)
692 , m_lookupParams (lookupParams)
694 checkDeviceFeatures(m_context, m_textureSpec.type);
697 // Base coord scale & bias
698 Vec4 s = m_lookupSpec.maxCoord-m_lookupSpec.minCoord;
699 Vec4 b = m_lookupSpec.minCoord;
701 float baseCoordTrans[] =
703 s.x(), 0.0f, 0.f, b.x(),
704 0.f, s.y(), 0.f, b.y(),
705 s.z()/2.f, -s.z()/2.f, 0.f, s.z()/2.f + b.z(),
706 -s.w()/2.f, s.w()/2.f, 0.f, s.w()/2.f + b.w()
709 m_userAttribTransforms.push_back(tcu::Mat4(baseCoordTrans));
711 useAttribute(4u, A_IN0);
714 bool hasLodBias = functionHasLod(m_lookupSpec.function) || m_lookupSpec.useBias;
715 bool isGrad = functionHasGrad(m_lookupSpec.function);
716 DE_ASSERT(!isGrad || !hasLodBias);
720 float s = m_lookupSpec.maxLodBias-m_lookupSpec.minLodBias;
721 float b = m_lookupSpec.minLodBias;
722 float lodCoordTrans[] =
724 s/2.0f, s/2.0f, 0.f, b,
725 0.0f, 0.0f, 0.0f, 0.0f,
726 0.0f, 0.0f, 0.0f, 0.0f,
727 0.0f, 0.0f, 0.0f, 0.0f
730 m_userAttribTransforms.push_back(tcu::Mat4(lodCoordTrans));
732 useAttribute(5u, A_IN1);
736 Vec3 sx = m_lookupSpec.maxDX-m_lookupSpec.minDX;
737 Vec3 sy = m_lookupSpec.maxDY-m_lookupSpec.minDY;
738 float gradDxTrans[] =
740 sx.x()/2.0f, sx.x()/2.0f, 0.f, m_lookupSpec.minDX.x(),
741 sx.y()/2.0f, sx.y()/2.0f, 0.0f, m_lookupSpec.minDX.y(),
742 sx.z()/2.0f, sx.z()/2.0f, 0.0f, m_lookupSpec.minDX.z(),
743 0.0f, 0.0f, 0.0f, 0.0f
745 float gradDyTrans[] =
747 -sy.x()/2.0f, -sy.x()/2.0f, 0.f, m_lookupSpec.maxDY.x(),
748 -sy.y()/2.0f, -sy.y()/2.0f, 0.0f, m_lookupSpec.maxDY.y(),
749 -sy.z()/2.0f, -sy.z()/2.0f, 0.0f, m_lookupSpec.maxDY.z(),
750 0.0f, 0.0f, 0.0f, 0.0f
753 m_userAttribTransforms.push_back(tcu::Mat4(gradDxTrans));
754 m_userAttribTransforms.push_back(tcu::Mat4(gradDyTrans));
756 useAttribute(5u, A_IN1);
757 useAttribute(6u, A_IN2);
763 ShaderTextureFunctionInstance::~ShaderTextureFunctionInstance (void)
767 void ShaderTextureFunctionInstance::setupUniforms (const tcu::Vec4&)
770 addUniform(1u, vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, sizeof(tcu::Vec4), m_lookupParams.scale.getPtr());
771 addUniform(2u, vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, sizeof(tcu::Vec4), m_lookupParams.bias.getPtr());
774 void ShaderTextureFunctionInstance::initTexture (void)
776 static const IVec4 texCubeSwz[] =
785 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(texCubeSwz) == tcu::CUBEFACE_LAST);
787 tcu::TextureFormat texFmt = glu::mapGLInternalFormat(m_textureSpec.format);
788 tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFmt);
789 tcu::UVec2 viewportSize = getViewportSize();
790 bool isProj = functionHasProj(m_lookupSpec.function);
791 bool isAutoLod = functionHasAutoLod(m_isVertexCase ? glu::SHADERTYPE_VERTEX : glu::SHADERTYPE_FRAGMENT,
792 m_lookupSpec.function); // LOD can vary significantly
793 float proj = isProj ? 1.0f/m_lookupSpec.minCoord[m_lookupSpec.function == FUNCTION_TEXTUREPROJ2 ? 1 : m_lookupSpec.function == FUNCTION_TEXTUREPROJ3 ? 2 : 3] : 1.0f;
794 TexLookupParams lookupParams;
796 switch (m_textureSpec.type)
800 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
801 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
802 Vec4 cBias = fmtInfo.valueMin;
803 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
804 de::MovePtr<tcu::Texture2D> texture2D;
806 texture2D = de::MovePtr<tcu::Texture2D>(new tcu::Texture2D(texFmt, m_textureSpec.width, m_textureSpec.height));
808 for (int level = 0; level < m_textureSpec.numLevels; level++)
810 float fA = float(level)*levelStep;
812 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
813 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
815 texture2D->allocLevel(level);
816 tcu::fillWithGrid(texture2D->getLevel(level), de::max(1, baseCellSize>>level), colorA, colorB);
820 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
821 float dvdy = (m_lookupSpec.maxCoord[1]-m_lookupSpec.minCoord[1])*proj*(float)m_textureSpec.height / (float)viewportSize[1];
822 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
824 // Append to texture list.
825 m_textures.push_back(TextureBindingSp(new TextureBinding(texture2D.release(), m_textureSpec.sampler)));
829 case TEXTURETYPE_CUBE_MAP:
831 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
832 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
833 Vec4 cBias = fmtInfo.valueMin;
834 Vec4 cCorner = cBias + cScale*0.5f;
835 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
836 de::MovePtr<tcu::TextureCube> textureCube;
838 DE_ASSERT(m_textureSpec.width == m_textureSpec.height);
839 textureCube = de::MovePtr<tcu::TextureCube>(new tcu::TextureCube(texFmt, m_textureSpec.width));
841 for (int level = 0; level < m_textureSpec.numLevels; level++)
843 float fA = float(level)*levelStep;
847 for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
849 const IVec4& swzA = texCubeSwz[face];
851 Vec4 colorA = cBias + cScale*f.swizzle(swzA[0], swzA[1], swzA[2], swzA[3]);
852 Vec4 colorB = cBias + cScale*f.swizzle(swzB[0], swzB[1], swzB[2], swzB[3]);
854 textureCube->allocLevel((tcu::CubeFace)face, level);
857 const tcu::PixelBufferAccess access = textureCube->getLevelFace(level, (tcu::CubeFace)face);
858 const int lastPix = access.getWidth()-1;
860 tcu::fillWithGrid(access, de::max(1, baseCellSize>>level), colorA, colorB);
862 // Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering
863 access.setPixel(cCorner, 0, 0);
864 access.setPixel(cCorner, 0, lastPix);
865 access.setPixel(cCorner, lastPix, 0);
866 access.setPixel(cCorner, lastPix, lastPix);
871 // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
872 DE_ASSERT(de::abs(m_lookupSpec.minCoord[2] - m_lookupSpec.maxCoord[2]) < 0.005);
873 DE_ASSERT(de::abs(m_lookupSpec.minCoord[0]) < de::abs(m_lookupSpec.minCoord[2]) && de::abs(m_lookupSpec.maxCoord[0]) < de::abs(m_lookupSpec.minCoord[2]));
874 DE_ASSERT(de::abs(m_lookupSpec.minCoord[1]) < de::abs(m_lookupSpec.minCoord[2]) && de::abs(m_lookupSpec.maxCoord[1]) < de::abs(m_lookupSpec.minCoord[2]));
876 tcu::CubeFaceFloatCoords c00 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
877 tcu::CubeFaceFloatCoords c10 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.maxCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
878 tcu::CubeFaceFloatCoords c01 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.maxCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
879 float dudx = (c10.s - c00.s)*(float)m_textureSpec.width / (float)viewportSize[0];
880 float dvdy = (c01.t - c00.t)*(float)m_textureSpec.height / (float)viewportSize[1];
881 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
883 // Append to texture list.
884 m_textures.push_back(TextureBindingSp(new TextureBinding(textureCube.release(), m_textureSpec.sampler)));
888 case TEXTURETYPE_2D_ARRAY:
890 float layerStep = 1.0f / (float)m_textureSpec.depth;
891 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)(de::max(1, m_textureSpec.numLevels-1)*m_textureSpec.depth);
892 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
893 Vec4 cBias = fmtInfo.valueMin;
894 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
895 de::MovePtr<tcu::Texture2DArray> texture2DArray;
897 texture2DArray = de::MovePtr<tcu::Texture2DArray>(new tcu::Texture2DArray(texFmt, m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth));
899 for (int level = 0; level < m_textureSpec.numLevels; level++)
901 texture2DArray->allocLevel(level);
902 tcu::PixelBufferAccess levelAccess = texture2DArray->getLevel(level);
904 for (int layer = 0; layer < levelAccess.getDepth(); layer++)
906 float fA = (float)layer*layerStep + (float)level*levelStep;
908 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
909 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
911 tcu::fillWithGrid(tcu::getSubregion(levelAccess, 0, 0, layer, levelAccess.getWidth(), levelAccess.getHeight(), 1), de::max(1, baseCellSize>>level), colorA, colorB);
916 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
917 float dvdy = (m_lookupSpec.maxCoord[1]-m_lookupSpec.minCoord[1])*proj*(float)m_textureSpec.height / (float)viewportSize[1];
918 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
920 // Append to texture list.
921 m_textures.push_back(TextureBindingSp(new TextureBinding(texture2DArray.release(), m_textureSpec.sampler)));
927 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
928 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
929 Vec4 cBias = fmtInfo.valueMin;
930 int baseCellSize = de::min(de::min(m_textureSpec.width/2, m_textureSpec.height/2), m_textureSpec.depth/2);
931 de::MovePtr<tcu::Texture3D> texture3D;
933 texture3D = de::MovePtr<tcu::Texture3D>(new tcu::Texture3D(texFmt, m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth));
935 for (int level = 0; level < m_textureSpec.numLevels; level++)
937 float fA = (float)level*levelStep;
939 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
940 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
942 texture3D->allocLevel(level);
943 tcu::fillWithGrid(texture3D->getLevel(level), de::max(1, baseCellSize>>level), colorA, colorB);
947 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
948 float dvdy = (m_lookupSpec.maxCoord[1]-m_lookupSpec.minCoord[1])*proj*(float)m_textureSpec.height / (float)viewportSize[1];
949 float dwdx = (m_lookupSpec.maxCoord[2]-m_lookupSpec.minCoord[2])*0.5f*proj*(float)m_textureSpec.depth / (float)viewportSize[0];
950 float dwdy = (m_lookupSpec.maxCoord[2]-m_lookupSpec.minCoord[2])*0.5f*proj*(float)m_textureSpec.depth / (float)viewportSize[1];
951 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, dwdx, 0.0f, dvdy, dwdy);
953 // Append to texture list.
954 m_textures.push_back(TextureBindingSp(new TextureBinding(texture3D.release(), m_textureSpec.sampler)));
960 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
961 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
962 Vec4 cBias = fmtInfo.valueMin;
963 int baseCellSize = m_textureSpec.width/4;
964 de::MovePtr<tcu::Texture1D> texture1D;
966 texture1D = de::MovePtr<tcu::Texture1D>(new tcu::Texture1D(texFmt, m_textureSpec.width));
968 for (int level = 0; level < m_textureSpec.numLevels; level++)
970 float fA = float(level)*levelStep;
972 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
973 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
975 texture1D->allocLevel(level);
976 tcu::fillWithGrid(texture1D->getLevel(level), de::max(1, baseCellSize>>level), colorA, colorB);
980 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
981 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f);
983 // Append to texture list.
984 m_textures.push_back(TextureBindingSp(new TextureBinding(texture1D.release(), m_textureSpec.sampler)));
988 case TEXTURETYPE_1D_ARRAY:
990 float layerStep = 1.0f / (float)m_textureSpec.depth;
991 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)(de::max(1, m_textureSpec.numLevels-1)*m_textureSpec.depth);
992 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
993 Vec4 cBias = fmtInfo.valueMin;
994 int baseCellSize = m_textureSpec.width/4;
995 de::MovePtr<tcu::Texture1DArray> texture1DArray;
997 texture1DArray = de::MovePtr<tcu::Texture1DArray>(new tcu::Texture1DArray(texFmt, m_textureSpec.width, m_textureSpec.depth));
999 for (int level = 0; level < m_textureSpec.numLevels; level++)
1001 texture1DArray->allocLevel(level);
1002 tcu::PixelBufferAccess levelAccess = texture1DArray->getLevel(level);
1004 for (int layer = 0; layer < levelAccess.getHeight(); layer++)
1006 float fA = (float)layer*layerStep + (float)level*levelStep;
1008 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
1009 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
1011 tcu::fillWithGrid(tcu::getSubregion(levelAccess, 0, layer, 0, levelAccess.getWidth(), 1, 1), de::max(1, baseCellSize>>level), colorA, colorB);
1016 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
1017 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f);
1019 // Append to texture list.
1020 m_textures.push_back(TextureBindingSp(new TextureBinding(texture1DArray.release(), m_textureSpec.sampler)));
1024 case TEXTURETYPE_CUBE_ARRAY:
1026 float layerStep = 1.0f / (float)(m_textureSpec.depth/6);
1027 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)(de::max(1, m_textureSpec.numLevels-1)*(m_textureSpec.depth/6));
1028 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
1029 Vec4 cBias = fmtInfo.valueMin;
1030 Vec4 cCorner = cBias + cScale*0.5f;
1031 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
1032 de::MovePtr<tcu::TextureCubeArray> textureCubeArray;
1034 DE_ASSERT(m_textureSpec.width == m_textureSpec.height);
1035 DE_ASSERT(m_textureSpec.depth % 6 == 0);
1037 textureCubeArray = de::MovePtr<tcu::TextureCubeArray>(new tcu::TextureCubeArray(texFmt, m_textureSpec.width, m_textureSpec.depth));
1039 for (int level = 0; level < m_textureSpec.numLevels; level++)
1041 float fA = float(level)*levelStep;
1045 textureCubeArray->allocLevel(level);
1046 tcu::PixelBufferAccess levelAccess = textureCubeArray->getLevel(level);
1048 for (int layer = 0; layer < m_textureSpec.depth/6; layer++)
1050 float layerCorr = 1.0f-(float)layer*layerStep;
1052 for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
1054 const IVec4& swzA = texCubeSwz[face];
1055 IVec4 swzB = 1-swzA;
1056 Vec4 colorA = cBias + cScale*f.swizzle(swzA[0], swzA[1], swzA[2], swzA[3])*layerCorr;
1057 Vec4 colorB = cBias + cScale*f.swizzle(swzB[0], swzB[1], swzB[2], swzB[3])*layerCorr;
1060 const tcu::PixelBufferAccess access = tcu::getSubregion(levelAccess, 0, 0, (layer*6)+face, levelAccess.getWidth(), levelAccess.getHeight(), 1);
1061 const int lastPix = access.getWidth()-1;
1063 tcu::fillWithGrid(access, de::max(1, baseCellSize>>level), colorA, colorB);
1065 // Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering
1066 access.setPixel(cCorner, 0, 0);
1067 access.setPixel(cCorner, 0, lastPix);
1068 access.setPixel(cCorner, lastPix, 0);
1069 access.setPixel(cCorner, lastPix, lastPix);
1075 // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
1076 DE_ASSERT(de::abs(m_lookupSpec.minCoord[2] - m_lookupSpec.maxCoord[2]) < 0.005);
1077 DE_ASSERT(de::abs(m_lookupSpec.minCoord[0]) < de::abs(m_lookupSpec.minCoord[2]) && de::abs(m_lookupSpec.maxCoord[0]) < de::abs(m_lookupSpec.minCoord[2]));
1078 DE_ASSERT(de::abs(m_lookupSpec.minCoord[1]) < de::abs(m_lookupSpec.minCoord[2]) && de::abs(m_lookupSpec.maxCoord[1]) < de::abs(m_lookupSpec.minCoord[2]));
1080 tcu::CubeFaceFloatCoords c00 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
1081 tcu::CubeFaceFloatCoords c10 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.maxCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
1082 tcu::CubeFaceFloatCoords c01 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.maxCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
1083 float dudx = (c10.s - c00.s)*(float)m_textureSpec.width / (float)viewportSize[0];
1084 float dvdy = (c01.t - c00.t)*(float)m_textureSpec.height / (float)viewportSize[1];
1085 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
1087 // Append to texture list.
1088 m_textures.push_back(TextureBindingSp(new TextureBinding(textureCubeArray.release(), m_textureSpec.sampler)));
1093 DE_ASSERT(DE_FALSE);
1096 // Set lookup scale & bias
1097 lookupParams.scale = fmtInfo.lookupScale;
1098 lookupParams.bias = fmtInfo.lookupBias;
1099 lookupParams.offset = m_lookupSpec.offset;
1101 // \todo [dirnerakos] Avoid const cast somehow
1102 const_cast<TexLookupParams&>(m_lookupParams) = lookupParams;
1105 class ShaderTextureFunctionCase : public ShaderRenderCase
1108 ShaderTextureFunctionCase (tcu::TestContext& testCtx,
1109 const std::string& name,
1110 const std::string& desc,
1111 const TextureLookupSpec& lookup,
1112 const TextureSpec& texture,
1113 TexEvalFunc evalFunc,
1115 virtual ~ShaderTextureFunctionCase (void);
1117 virtual TestInstance* createInstance (Context& context) const;
1120 const TextureLookupSpec m_lookupSpec;
1121 const TextureSpec m_textureSpec;
1122 const TexLookupParams m_lookupParams;
1124 void initShaderSources (void);
1127 ShaderTextureFunctionCase::ShaderTextureFunctionCase (tcu::TestContext& testCtx,
1128 const std::string& name,
1129 const std::string& desc,
1130 const TextureLookupSpec& lookup,
1131 const TextureSpec& texture,
1132 TexEvalFunc evalFunc,
1134 : ShaderRenderCase (testCtx, name, desc, isVertexCase, new TexLookupEvaluator(evalFunc, m_lookupParams), NULL, NULL)
1135 , m_lookupSpec (lookup)
1136 , m_textureSpec (texture)
1138 initShaderSources();
1141 ShaderTextureFunctionCase::~ShaderTextureFunctionCase (void)
1145 TestInstance* ShaderTextureFunctionCase::createInstance (Context& context) const
1147 DE_ASSERT(m_evaluator != DE_NULL);
1148 DE_ASSERT(m_uniformSetup != DE_NULL);
1149 return new ShaderTextureFunctionInstance(context, m_isVertexCase, *m_evaluator, *m_uniformSetup, m_lookupSpec, m_textureSpec, m_lookupParams);
1152 void ShaderTextureFunctionCase::initShaderSources (void)
1154 Function function = m_lookupSpec.function;
1155 bool isVtxCase = m_isVertexCase;
1156 bool isProj = functionHasProj(function);
1157 bool isGrad = functionHasGrad(function);
1158 bool isShadow = m_textureSpec.sampler.compare != tcu::Sampler::COMPAREMODE_NONE;
1159 bool is2DProj4 = !isShadow && m_textureSpec.type == TEXTURETYPE_2D && (function == FUNCTION_TEXTUREPROJ || function == FUNCTION_TEXTUREPROJLOD || function == FUNCTION_TEXTUREPROJGRAD);
1160 bool is1DProj4 = !isShadow && m_textureSpec.type == TEXTURETYPE_1D && (function == FUNCTION_TEXTUREPROJ || function == FUNCTION_TEXTUREPROJLOD || function == FUNCTION_TEXTUREPROJGRAD);
1161 bool isIntCoord = function == FUNCTION_TEXELFETCH;
1162 bool hasLodBias = functionHasLod(m_lookupSpec.function) || m_lookupSpec.useBias;
1163 int texCoordComps = m_textureSpec.type == TEXTURETYPE_1D ? 1 :
1164 m_textureSpec.type == TEXTURETYPE_1D_ARRAY || m_textureSpec.type == TEXTURETYPE_2D ? 2 :
1165 m_textureSpec.type == TEXTURETYPE_CUBE_ARRAY ? 4 :
1167 int extraCoordComps = (isProj ? (is2DProj4 ? 2 : (is1DProj4 ? 3 : 1)) : 0) + (isShadow ? (m_textureSpec.type == TEXTURETYPE_1D ? 2 : 1) : 0);
1168 const bool isCubeArrayShadow = isShadow && m_textureSpec.type == TEXTURETYPE_CUBE_ARRAY;
1169 glu::DataType coordType = glu::getDataTypeFloatVec(isCubeArrayShadow ? 4 : texCoordComps+extraCoordComps);
1170 glu::Precision coordPrec = glu::PRECISION_HIGHP;
1171 const char* coordTypeName = glu::getDataTypeName(coordType);
1172 const char* coordPrecName = glu::getPrecisionName(coordPrec);
1173 tcu::TextureFormat texFmt = glu::mapGLInternalFormat(m_textureSpec.format);
1174 glu::DataType samplerType = glu::TYPE_LAST;
1175 glu::DataType gradType = m_textureSpec.type == TEXTURETYPE_1D || m_textureSpec.type == TEXTURETYPE_1D_ARRAY ? glu::TYPE_FLOAT :
1176 m_textureSpec.type == TEXTURETYPE_3D || m_textureSpec.type == TEXTURETYPE_CUBE_MAP || m_textureSpec.type == TEXTURETYPE_CUBE_ARRAY ? glu::TYPE_FLOAT_VEC3 :
1177 glu::TYPE_FLOAT_VEC2;
1178 const char* gradTypeName = glu::getDataTypeName(gradType);
1179 const char* baseFuncName = DE_NULL;
1181 DE_ASSERT(!isGrad || !hasLodBias);
1183 switch (m_textureSpec.type)
1185 case TEXTURETYPE_2D: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_SHADOW : glu::getSampler2DType(texFmt); break;
1186 case TEXTURETYPE_CUBE_MAP: samplerType = isShadow ? glu::TYPE_SAMPLER_CUBE_SHADOW : glu::getSamplerCubeType(texFmt); break;
1187 case TEXTURETYPE_2D_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_ARRAY_SHADOW : glu::getSampler2DArrayType(texFmt); break;
1188 case TEXTURETYPE_3D: DE_ASSERT(!isShadow); samplerType = glu::getSampler3DType(texFmt); break;
1189 case TEXTURETYPE_1D: samplerType = isShadow ? glu::TYPE_SAMPLER_1D_SHADOW : glu::getSampler1DType(texFmt); break;
1190 case TEXTURETYPE_1D_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_1D_ARRAY_SHADOW : glu::getSampler1DArrayType(texFmt); break;
1191 case TEXTURETYPE_CUBE_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW : glu::getSamplerCubeArrayType(texFmt); break;
1193 DE_ASSERT(DE_FALSE);
1196 switch (m_lookupSpec.function)
1198 case FUNCTION_TEXTURE: baseFuncName = "texture"; break;
1199 case FUNCTION_TEXTUREPROJ: baseFuncName = "textureProj"; break;
1200 case FUNCTION_TEXTUREPROJ2: baseFuncName = "textureProj"; break;
1201 case FUNCTION_TEXTUREPROJ3: baseFuncName = "textureProj"; break;
1202 case FUNCTION_TEXTURELOD: baseFuncName = "textureLod"; break;
1203 case FUNCTION_TEXTUREPROJLOD: baseFuncName = "textureProjLod"; break;
1204 case FUNCTION_TEXTUREPROJLOD2: baseFuncName = "textureProjLod"; break;
1205 case FUNCTION_TEXTUREPROJLOD3: baseFuncName = "textureProjLod"; break;
1206 case FUNCTION_TEXTUREGRAD: baseFuncName = "textureGrad"; break;
1207 case FUNCTION_TEXTUREPROJGRAD: baseFuncName = "textureProjGrad"; break;
1208 case FUNCTION_TEXTUREPROJGRAD2: baseFuncName = "textureProjGrad"; break;
1209 case FUNCTION_TEXTUREPROJGRAD3: baseFuncName = "textureProjGrad"; break;
1210 case FUNCTION_TEXELFETCH: baseFuncName = "texelFetch"; break;
1212 DE_ASSERT(DE_FALSE);
1215 std::ostringstream vert;
1216 std::ostringstream frag;
1217 std::ostringstream& op = isVtxCase ? vert : frag;
1218 glu::GLSLVersion version = glu::GLSL_VERSION_LAST;
1220 switch (m_textureSpec.type)
1222 case TEXTURETYPE_2D:
1223 case TEXTURETYPE_3D:
1224 case TEXTURETYPE_CUBE_MAP:
1225 case TEXTURETYPE_2D_ARRAY:
1226 version = glu::GLSL_VERSION_310_ES;
1229 case TEXTURETYPE_1D:
1230 case TEXTURETYPE_1D_ARRAY:
1231 case TEXTURETYPE_CUBE_ARRAY:
1232 version = glu::GLSL_VERSION_420;
1236 DE_ASSERT(DE_FALSE);
1240 vert << glu::getGLSLVersionDeclaration(version) << "\n"
1241 << "layout(location = 0) in highp vec4 a_position;\n"
1242 << "layout(location = 4) in " << coordPrecName << " " << coordTypeName << " a_in0;\n";
1246 vert << "layout(location = 5) in " << coordPrecName << " " << gradTypeName << " a_in1;\n";
1247 vert << "layout(location = 6) in " << coordPrecName << " " << gradTypeName << " a_in2;\n";
1249 else if (hasLodBias)
1250 vert << "layout(location = 5) in " << coordPrecName << " float a_in1;\n";
1252 frag << glu::getGLSLVersionDeclaration(version) << "\n"
1253 << "layout(location = 0) out mediump vec4 o_color;\n";
1257 vert << "layout(location = 0) out mediump vec4 v_color;\n";
1258 frag << "layout(location = 0) in mediump vec4 v_color;\n";
1262 vert << "layout(location = 0) out " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
1263 frag << "layout(location = 0) in " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
1267 vert << "layout(location = 1) out " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
1268 vert << "layout(location = 2) out " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
1269 frag << "layout(location = 1) in " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
1270 frag << "layout(location = 2) in " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
1272 else if (hasLodBias)
1274 vert << "layout(location = 1) out " << coordPrecName << " float v_lodBias;\n";
1275 frag << "layout(location = 1) in " << coordPrecName << " float v_lodBias;\n";
1280 op << "layout(set = 0, binding = 0) uniform highp " << glu::getDataTypeName(samplerType) << " u_sampler;\n"
1281 << "layout(set = 0, binding = 1) uniform buf0 { highp vec4 u_scale; };\n"
1282 << "layout(set = 0, binding = 2) uniform buf1 { highp vec4 u_bias; };\n";
1284 if (version != glu::GLSL_VERSION_310_ES)
1285 vert << "out gl_PerVertex {\n"
1286 << "\tvec4 gl_Position;\n"
1289 vert << "\nvoid main()\n{\n"
1290 << "\tgl_Position = a_position;\n";
1291 frag << "\nvoid main()\n{\n";
1294 vert << "\tv_color = ";
1296 frag << "\to_color = ";
1300 const char* texCoord = isVtxCase ? "a_in0" : "v_texCoord";
1301 const char* gradX = isVtxCase ? "a_in1" : "v_gradX";
1302 const char* gradY = isVtxCase ? "a_in2" : "v_gradY";
1303 const char* lodBias = isVtxCase ? "a_in1" : "v_lodBias";
1305 op << "vec4(" << baseFuncName;
1306 if (m_lookupSpec.useOffset)
1308 op << "(u_sampler, ";
1311 op << glu::getDataTypeName(glu::getDataTypeIntVec(texCoordComps+extraCoordComps)) << "(";
1319 op << ", " << gradX << ", " << gradY;
1321 if (functionHasLod(function))
1324 op << ", int(" << lodBias << ")";
1326 op << ", " << lodBias;
1329 if (m_lookupSpec.useOffset)
1331 int offsetComps = m_textureSpec.type == TEXTURETYPE_1D || m_textureSpec.type == TEXTURETYPE_1D_ARRAY ? 1 :
1332 m_textureSpec.type == TEXTURETYPE_3D ? 3 : 2;
1334 op << ", " << glu::getDataTypeName(glu::getDataTypeIntVec(offsetComps)) << "(";
1335 for (int ndx = 0; ndx < offsetComps; ndx++)
1339 op << m_lookupSpec.offset[ndx];
1344 if (isCubeArrayShadow && m_lookupSpec.function == FUNCTION_TEXTURE)
1345 op << ", " << texCoord << ".w";
1347 if (m_lookupSpec.useBias)
1348 op << ", " << lodBias;
1353 op << ", 0.0, 0.0, 1.0)";
1355 op << ")*u_scale + u_bias";
1361 frag << "\to_color = v_color;\n";
1364 vert << "\tv_texCoord = a_in0;\n";
1368 vert << "\tv_gradX = a_in1;\n";
1369 vert << "\tv_gradY = a_in2;\n";
1371 else if (hasLodBias)
1372 vert << "\tv_lodBias = a_in1;\n";
1378 m_vertShaderSource = vert.str();
1379 m_fragShaderSource = frag.str();
1384 QUERYFUNCTION_TEXTURESIZE = 0,
1385 QUERYFUNCTION_TEXTUREQUERYLOD,
1386 QUERYFUNCTION_TEXTUREQUERYLEVELS,
1387 QUERYFUNCTION_TEXTURESAMPLES,
1392 class TextureQueryInstance : public ShaderRenderCaseInstance
1395 TextureQueryInstance (Context& context,
1396 const bool isVertexCase,
1397 const TextureSpec& textureSpec);
1398 virtual ~TextureQueryInstance (void);
1401 virtual void setupDefaultInputs (void);
1402 virtual void setupUniforms (const tcu::Vec4&);
1407 const TextureSpec& m_textureSpec;
1410 TextureQueryInstance::TextureQueryInstance (Context& context,
1411 const bool isVertexCase,
1412 const TextureSpec& textureSpec)
1413 : ShaderRenderCaseInstance (context, isVertexCase, DE_NULL, DE_NULL, DE_NULL)
1414 , m_textureSpec (textureSpec)
1416 m_colorFormat = vk::VK_FORMAT_R32G32B32A32_SFLOAT;
1418 checkDeviceFeatures(m_context, m_textureSpec.type);
1421 TextureQueryInstance::~TextureQueryInstance (void)
1425 void TextureQueryInstance::setupDefaultInputs (void)
1427 const deUint32 numVertices = 4;
1428 const float positions[] =
1430 -1.0f, -1.0f, 0.0f, 1.0f,
1431 -1.0f, 1.0f, 0.0f, 1.0f,
1432 1.0f, -1.0f, 0.0f, 1.0f,
1433 1.0f, 1.0f, 0.0f, 1.0f
1436 addAttribute(0u, vk::VK_FORMAT_R32G32B32A32_SFLOAT, 4 * (deUint32)sizeof(float), numVertices, positions);
1439 void TextureQueryInstance::setupUniforms (const tcu::Vec4&)
1444 void TextureQueryInstance::render (void)
1446 const deUint32 numVertices = 4;
1447 const deUint32 numTriangles = 2;
1448 const deUint16 indices[6] = { 0, 1, 2, 2, 1, 3 };
1450 ShaderRenderCaseInstance::setup();
1452 ShaderRenderCaseInstance::render(numVertices, numTriangles, indices);
1455 static int getMaxTextureSize (TextureType type, const tcu::IVec3& textureSize)
1461 case TEXTURETYPE_1D:
1462 case TEXTURETYPE_1D_ARRAY:
1463 maxSize = textureSize.x();
1466 case TEXTURETYPE_2D:
1467 case TEXTURETYPE_2D_ARRAY:
1468 case TEXTURETYPE_CUBE_MAP:
1469 case TEXTURETYPE_CUBE_ARRAY:
1470 maxSize = de::max(textureSize.x(), textureSize.y());
1473 case TEXTURETYPE_3D:
1474 maxSize = de::max(textureSize.x(), de::max(textureSize.y(), textureSize.z()));
1484 static std::string getTextureSizeString (TextureType type, const tcu::IVec3& textureSize)
1486 std::ostringstream str;
1490 case TEXTURETYPE_1D:
1491 str << textureSize.x() << "x1";
1494 case TEXTURETYPE_2D:
1495 case TEXTURETYPE_CUBE_MAP:
1496 str << textureSize.x() << "x" << textureSize.y();
1499 case TEXTURETYPE_3D:
1500 str << textureSize.x() << "x" << textureSize.y() << "x" << textureSize.z();
1503 case TEXTURETYPE_1D_ARRAY:
1504 str << textureSize.x() << "x1 with " << textureSize.z() << " layer(s)";
1507 case TEXTURETYPE_2D_ARRAY:
1508 case TEXTURETYPE_CUBE_ARRAY:
1509 str << textureSize.x() << "x" << textureSize.y() << " with " << textureSize.z() << " layers(s)";
1520 static bool isValidCase (TextureType type, const tcu::IVec3& textureSize, int lod, int lodBase)
1522 const bool isSquare = textureSize.x() == textureSize.y();
1523 const bool isCubeArray = isSquare && (textureSize.z() % 6) == 0;
1524 const int maxSize = getMaxTextureSize(type, textureSize);
1525 const bool isLodValid = (maxSize >> (lod + lodBase)) != 0;
1529 if (type == TEXTURETYPE_CUBE_MAP && !isSquare)
1531 if (type == TEXTURETYPE_CUBE_ARRAY && !isCubeArray)
1537 static TextureBindingSp createEmptyTexture (deUint32 format,
1539 const tcu::IVec3& textureSize,
1542 const tcu::Sampler& sampler)
1544 const tcu::TextureFormat texFmt = glu::mapGLInternalFormat(format);
1545 const TextureBinding::Parameters params (lodBase);
1546 TextureBindingSp textureBinding;
1551 case TEXTURETYPE_1D:
1553 de::MovePtr<tcu::Texture1D> texture (new tcu::Texture1D(texFmt, textureSize.x()));
1555 for (int level = 0; level < numLevels; level++)
1556 texture->allocLevel(level);
1558 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1562 case TEXTURETYPE_2D:
1564 de::MovePtr<tcu::Texture2D> texture (new tcu::Texture2D(texFmt, textureSize.x(), textureSize.y()));
1566 for (int level = 0; level < numLevels; level++)
1567 texture->allocLevel(level);
1569 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1573 case TEXTURETYPE_3D:
1575 de::MovePtr<tcu::Texture3D> texture (new tcu::Texture3D(texFmt, textureSize.x(), textureSize.y(), textureSize.z()));
1577 for (int level = 0; level < numLevels; level++)
1578 texture->allocLevel(level);
1580 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1584 case TEXTURETYPE_CUBE_MAP:
1586 de::MovePtr<tcu::TextureCube> texture (new tcu::TextureCube(texFmt, textureSize.x()));
1588 for (int level = 0; level < numLevels; level++)
1589 for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
1590 texture->allocLevel((tcu::CubeFace)face, level);
1592 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1596 case TEXTURETYPE_1D_ARRAY:
1598 de::MovePtr<tcu::Texture1DArray> texture (new tcu::Texture1DArray(texFmt, textureSize.x(), textureSize.z()));
1600 for (int level = 0; level < numLevels; level++)
1601 texture->allocLevel(level);
1603 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1607 case TEXTURETYPE_2D_ARRAY:
1609 de::MovePtr<tcu::Texture2DArray> texture (new tcu::Texture2DArray(texFmt, textureSize.x(), textureSize.y(), textureSize.z()));
1611 for (int level = 0; level < numLevels; level++)
1612 texture->allocLevel(level);
1614 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1618 case TEXTURETYPE_CUBE_ARRAY:
1620 de::MovePtr<tcu::TextureCubeArray> texture (new tcu::TextureCubeArray(texFmt, textureSize.x(), textureSize.z()));
1622 for (int level = 0; level < numLevels; level++)
1623 texture->allocLevel(level);
1625 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1634 textureBinding->setParameters(params);
1635 return textureBinding;
1638 static inline glu::DataType getTextureSizeFuncResultType (TextureType textureType)
1640 switch (textureType)
1642 case TEXTURETYPE_1D:
1643 return glu::TYPE_INT;
1645 case TEXTURETYPE_2D:
1646 case TEXTURETYPE_CUBE_MAP:
1647 case TEXTURETYPE_1D_ARRAY:
1648 return glu::TYPE_INT_VEC2;
1650 case TEXTURETYPE_3D:
1651 case TEXTURETYPE_2D_ARRAY:
1652 case TEXTURETYPE_CUBE_ARRAY:
1653 return glu::TYPE_INT_VEC3;
1657 return glu::TYPE_LAST;
1661 class TextureSizeInstance : public TextureQueryInstance
1664 TextureSizeInstance (Context& context,
1665 const bool isVertexCase,
1666 const TextureSpec& textureSpec);
1667 virtual ~TextureSizeInstance (void);
1669 virtual tcu::TestStatus iterate (void);
1672 virtual void setupUniforms (const tcu::Vec4& constCoords);
1677 tcu::IVec3 textureSize;
1680 tcu::IVec3 expectedSize;
1683 void initTexture (void);
1684 bool testTextureSize (void);
1686 TestSize m_testSize;
1687 tcu::IVec3 m_expectedSize;
1688 int m_iterationCounter;
1691 TextureSizeInstance::TextureSizeInstance (Context& context,
1692 const bool isVertexCase,
1693 const TextureSpec& textureSpec)
1694 : TextureQueryInstance (context, isVertexCase, textureSpec)
1697 , m_iterationCounter (0)
1699 deMemset(&m_testSize, 0, sizeof(TestSize));
1701 m_renderSize = tcu::UVec2(1, 1);
1704 TextureSizeInstance::~TextureSizeInstance (void)
1708 void TextureSizeInstance::setupUniforms (const tcu::Vec4& constCoords)
1710 TextureQueryInstance::setupUniforms(constCoords);
1711 addUniform(1u, vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, sizeof(int), &m_testSize.lod);
1714 void TextureSizeInstance::initTexture (void)
1716 tcu::TestLog& log = m_context.getTestContext().getLog();
1717 const int numLevels = m_testSize.lod + m_testSize.lodBase + 1;
1718 TextureBindingSp textureBinding;
1720 log << tcu::TestLog::Message << "Testing image size " << getTextureSizeString(m_textureSpec.type, m_testSize.textureSize) << tcu::TestLog::EndMessage;
1721 log << tcu::TestLog::Message << "Lod: " << m_testSize.lod << ", base level: " << m_testSize.lodBase << tcu::TestLog::EndMessage;
1723 switch (m_textureSpec.type)
1725 case TEXTURETYPE_3D:
1726 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << "x" << m_testSize.expectedSize.z() << tcu::TestLog::EndMessage;
1729 case TEXTURETYPE_2D:
1730 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << tcu::TestLog::EndMessage;
1733 case TEXTURETYPE_CUBE_MAP:
1734 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << tcu::TestLog::EndMessage;
1737 case TEXTURETYPE_2D_ARRAY:
1738 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << " and " << m_testSize.textureSize.z() << " layer(s)" << tcu::TestLog::EndMessage;
1741 case TEXTURETYPE_CUBE_ARRAY:
1742 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << " and " << (m_testSize.textureSize.z() / 6) << " cube(s)" << tcu::TestLog::EndMessage;
1745 case TEXTURETYPE_1D:
1746 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << tcu::TestLog::EndMessage;
1749 case TEXTURETYPE_1D_ARRAY:
1750 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << " and " << m_testSize.textureSize.z() << " layer(s)" << tcu::TestLog::EndMessage;
1758 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, m_testSize.textureSize, numLevels, m_testSize.lodBase, m_textureSpec.sampler);
1761 m_textures.push_back(textureBinding);
1764 tcu::TestStatus TextureSizeInstance::iterate (void)
1766 const TestSize testSizes[] =
1768 { tcu::IVec3(1, 2, 1), 0, 0, tcu::IVec3(1, 2, 1) },
1769 { tcu::IVec3(1, 2, 1), 1, 0, tcu::IVec3(1, 1, 1) },
1771 { tcu::IVec3(1, 3, 2), 0, 0, tcu::IVec3(1, 3, 2) },
1772 { tcu::IVec3(1, 3, 2), 1, 0, tcu::IVec3(1, 1, 1) },
1774 { tcu::IVec3(100, 31, 18), 0, 0, tcu::IVec3(100, 31, 18) },
1775 { tcu::IVec3(100, 31, 18), 1, 0, tcu::IVec3(50, 15, 9) },
1776 { tcu::IVec3(100, 31, 18), 2, 0, tcu::IVec3(25, 7, 4) },
1777 { tcu::IVec3(100, 31, 18), 3, 0, tcu::IVec3(12, 3, 2) },
1778 { tcu::IVec3(100, 31, 18), 4, 0, tcu::IVec3(6, 1, 1) },
1779 { tcu::IVec3(100, 31, 18), 5, 0, tcu::IVec3(3, 1, 1) },
1780 { tcu::IVec3(100, 31, 18), 6, 0, tcu::IVec3(1, 1, 1) },
1782 { tcu::IVec3(100, 128, 32), 0, 0, tcu::IVec3(100, 128, 32) },
1783 { tcu::IVec3(100, 128, 32), 1, 0, tcu::IVec3(50, 64, 16) },
1784 { tcu::IVec3(100, 128, 32), 2, 0, tcu::IVec3(25, 32, 8) },
1785 { tcu::IVec3(100, 128, 32), 3, 0, tcu::IVec3(12, 16, 4) },
1786 { tcu::IVec3(100, 128, 32), 4, 0, tcu::IVec3(6, 8, 2) },
1787 { tcu::IVec3(100, 128, 32), 5, 0, tcu::IVec3(3, 4, 1) },
1788 { tcu::IVec3(100, 128, 32), 6, 0, tcu::IVec3(1, 2, 1) },
1789 { tcu::IVec3(100, 128, 32), 7, 0, tcu::IVec3(1, 1, 1) },
1792 { tcu::IVec3(128, 64, 32), 0, 0, tcu::IVec3(128, 64, 32) },
1793 { tcu::IVec3(128, 64, 32), 1, 0, tcu::IVec3(64, 32, 16) },
1794 { tcu::IVec3(128, 64, 32), 2, 0, tcu::IVec3(32, 16, 8) },
1795 { tcu::IVec3(128, 64, 32), 3, 0, tcu::IVec3(16, 8, 4) },
1796 { tcu::IVec3(128, 64, 32), 4, 0, tcu::IVec3(8, 4, 2) },
1797 { tcu::IVec3(128, 64, 32), 5, 0, tcu::IVec3(4, 2, 1) },
1798 { tcu::IVec3(128, 64, 32), 6, 0, tcu::IVec3(2, 1, 1) },
1799 { tcu::IVec3(128, 64, 32), 7, 0, tcu::IVec3(1, 1, 1) },
1802 { tcu::IVec3(1, 1, 1), 0, 0, tcu::IVec3(1, 1, 1) },
1803 { tcu::IVec3(64, 64, 64), 0, 0, tcu::IVec3(64, 64, 64) },
1804 { tcu::IVec3(64, 64, 64), 1, 0, tcu::IVec3(32, 32, 32) },
1805 { tcu::IVec3(64, 64, 64), 2, 0, tcu::IVec3(16, 16, 16) },
1806 { tcu::IVec3(64, 64, 64), 3, 0, tcu::IVec3(8, 8, 8) },
1807 { tcu::IVec3(64, 64, 64), 4, 0, tcu::IVec3(4, 4, 4) },
1810 { tcu::IVec3(100, 31, 18), 3, 1, tcu::IVec3(6, 1, 1) },
1811 { tcu::IVec3(128, 64, 32), 3, 1, tcu::IVec3(8, 4, 2) },
1812 { tcu::IVec3(64, 64, 64), 1, 1, tcu::IVec3(16, 16, 16) },
1814 // w == h and d % 6 == 0 (for cube array)
1815 { tcu::IVec3(1, 1, 6), 0, 0, tcu::IVec3(1, 1, 6) },
1816 { tcu::IVec3(32, 32, 12), 0, 0, tcu::IVec3(32, 32, 12) },
1817 { tcu::IVec3(32, 32, 12), 0, 1, tcu::IVec3(16, 16, 6) },
1818 { tcu::IVec3(32, 32, 12), 1, 0, tcu::IVec3(16, 16, 6) },
1819 { tcu::IVec3(32, 32, 12), 2, 0, tcu::IVec3(8, 8, 3) },
1820 { tcu::IVec3(32, 32, 12), 3, 0, tcu::IVec3(4, 4, 1) },
1821 { tcu::IVec3(32, 32, 12), 4, 0, tcu::IVec3(2, 2, 1) },
1822 { tcu::IVec3(32, 32, 12), 5, 0, tcu::IVec3(1, 1, 1) },
1824 const int lastIterationIndex = DE_LENGTH_OF_ARRAY(testSizes) + 1;
1826 m_iterationCounter++;
1828 if (m_iterationCounter == lastIterationIndex)
1829 return tcu::TestStatus::pass("Pass");
1832 // set current test size
1833 m_testSize = testSizes[m_iterationCounter - 1];
1835 if (!testTextureSize())
1836 return tcu::TestStatus::fail("Got unexpected result");
1838 return tcu::TestStatus::incomplete();
1842 bool TextureSizeInstance::testTextureSize (void)
1844 tcu::TestLog& log = m_context.getTestContext().getLog();
1845 bool success = true;
1847 // skip incompatible cases
1848 if (!isValidCase(m_textureSpec.type, m_testSize.textureSize, m_testSize.lod, m_testSize.lodBase))
1854 // determine expected texture size
1855 switch (m_textureSpec.type)
1857 case TEXTURETYPE_1D:
1858 case TEXTURETYPE_2D:
1859 case TEXTURETYPE_3D:
1860 case TEXTURETYPE_CUBE_MAP:
1861 m_expectedSize = m_testSize.expectedSize;
1864 case TEXTURETYPE_1D_ARRAY:
1865 m_expectedSize = tcu::IVec3(m_testSize.expectedSize.x(), m_testSize.textureSize.z(), 0);
1868 case TEXTURETYPE_2D_ARRAY:
1869 m_expectedSize = tcu::IVec3(m_testSize.expectedSize.x(), m_testSize.expectedSize.y(), m_testSize.textureSize.z());
1872 case TEXTURETYPE_CUBE_ARRAY:
1873 m_expectedSize = tcu::IVec3(m_testSize.expectedSize.x(), m_testSize.expectedSize.y(), m_testSize.textureSize.z() / 6);
1882 TextureQueryInstance::render();
1886 const tcu::TextureLevel& result = getResultImage();
1887 tcu::IVec4 output = result.getAccess().getPixelInt(0, 0);
1888 const int resultComponents = glu::getDataTypeScalarSize(getTextureSizeFuncResultType(m_textureSpec.type));
1890 for (int ndx = 0; ndx < resultComponents; ndx++)
1892 if (output[ndx] != m_expectedSize[ndx])
1902 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
1907 std::stringstream resultSizeStr;
1908 switch (resultComponents)
1911 resultSizeStr << output[0];
1914 resultSizeStr << output.toWidth<2>();
1917 resultSizeStr << output.toWidth<3>();
1923 log << tcu::TestLog::Message << "Result: " << resultSizeStr.str() << tcu::TestLog::EndMessage;
1924 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
1928 log << tcu::TestLog::Message << tcu::TestLog::EndMessage;
1933 static vk::VkImageType getVkImageType (TextureType type)
1937 case TEXTURETYPE_1D:
1938 case TEXTURETYPE_1D_ARRAY:
1939 return vk::VK_IMAGE_TYPE_1D;
1941 case TEXTURETYPE_2D:
1942 case TEXTURETYPE_2D_ARRAY:
1943 case TEXTURETYPE_CUBE_MAP:
1944 case TEXTURETYPE_CUBE_ARRAY:
1945 return vk::VK_IMAGE_TYPE_2D;
1947 case TEXTURETYPE_3D:
1948 return vk::VK_IMAGE_TYPE_3D;
1952 return (vk::VkImageType)0;
1956 class TextureSamplesInstance : public TextureQueryInstance
1959 TextureSamplesInstance (Context& context,
1960 const bool isVertexCase,
1961 const TextureSpec& textureSpec);
1962 virtual ~TextureSamplesInstance (void);
1964 virtual tcu::TestStatus iterate (void);
1967 void initTexture (void);
1969 int m_iterationCounter;
1970 vector<vk::VkSampleCountFlagBits> m_iterations;
1973 TextureSamplesInstance::TextureSamplesInstance (Context& context,
1974 const bool isVertexCase,
1975 const TextureSpec& textureSpec)
1976 : TextureQueryInstance (context, isVertexCase, textureSpec)
1977 , m_iterationCounter (0)
1979 m_renderSize = tcu::UVec2(1, 1);
1981 // determine available sample counts
1983 const vk::VkFormat format = vk::mapTextureFormat(glu::mapGLInternalFormat(m_textureSpec.format));
1984 const vk::VkImageType imageType = getVkImageType(m_textureSpec.type);
1985 vk::VkImageFormatProperties properties;
1987 if (m_context.getInstanceInterface().getPhysicalDeviceImageFormatProperties(m_context.getPhysicalDevice(),
1990 vk::VK_IMAGE_TILING_OPTIMAL,
1991 vk::VK_IMAGE_USAGE_SAMPLED_BIT | vk::VK_IMAGE_USAGE_TRANSFER_DST_BIT,
1992 (vk::VkImageCreateFlags)0,
1993 &properties) == vk::VK_ERROR_FORMAT_NOT_SUPPORTED)
1994 TCU_THROW(NotSupportedError, "Format not supported");
1996 // NOTE: The test case initializes MS images (for all supported N of samples), runs a program
1997 // which invokes OpImageQuerySamples against the image and checks the result.
1999 // Now, in the SPIR-V spec for the very operation we have the following language:
2001 // OpImageQuerySamples
2002 // Query the number of samples available per texel fetch in a multisample image.
2003 // Result Type must be a scalar integer type.
2004 // The result is the number of samples.
2005 // Image must be an object whose type is OpTypeImage.
2006 // Its Dim operand must be one of 2D and **MS of 1(multisampled).
2008 // "MS of 1" implies the image must not be single-sample, meaning we must exclude
2009 // VK_SAMPLE_COUNT_1_BIT in the sampleFlags array below, and may have to skip further testing.
2010 static const vk::VkSampleCountFlagBits sampleFlags[] =
2012 vk::VK_SAMPLE_COUNT_2_BIT,
2013 vk::VK_SAMPLE_COUNT_4_BIT,
2014 vk::VK_SAMPLE_COUNT_8_BIT,
2015 vk::VK_SAMPLE_COUNT_16_BIT,
2016 vk::VK_SAMPLE_COUNT_32_BIT,
2017 vk::VK_SAMPLE_COUNT_64_BIT
2020 for (int samplesNdx = 0; samplesNdx < DE_LENGTH_OF_ARRAY(sampleFlags); samplesNdx++)
2022 const vk::VkSampleCountFlagBits& flag = sampleFlags[samplesNdx];
2024 if ((properties.sampleCounts & flag) != 0)
2025 m_iterations.push_back(flag);
2028 if (m_iterations.empty())
2030 // Sampled images of integer formats may support only 1 sample. Exit the test with "Not supported" in these cases.
2031 if (tcu::getTextureChannelClass(mapVkFormat(format).type) == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER ||
2032 tcu::getTextureChannelClass(mapVkFormat(format).type) == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER)
2034 TCU_THROW(NotSupportedError, "Skipping validation of integer formats as only VK_SAMPLE_COUNT_1_BIT is supported.");
2045 TextureSamplesInstance::~TextureSamplesInstance (void)
2049 tcu::TestStatus TextureSamplesInstance::iterate (void)
2051 tcu::TestLog& log = m_context.getTestContext().getLog();
2053 // update samples count
2055 DE_ASSERT(m_textures.size() == 1);
2057 TextureBinding::Parameters params = m_textures[0]->getParameters();
2059 params.initialization = TextureBinding::INIT_CLEAR;
2060 params.samples = m_iterations[m_iterationCounter];
2061 log << tcu::TestLog::Message << "Expected samples: " << m_iterations[m_iterationCounter] << tcu::TestLog::EndMessage;
2063 m_textures[0]->setParameters(params);
2067 TextureQueryInstance::render();
2071 const tcu::TextureLevel& result = getResultImage();
2072 tcu::IVec4 output = result.getAccess().getPixelInt(0, 0);
2074 if (output.x() == (int)m_iterations[m_iterationCounter])
2077 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2082 log << tcu::TestLog::Message << "Result: " << output.x() << tcu::TestLog::EndMessage;
2083 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2084 return tcu::TestStatus::fail("Got unexpected result");
2087 m_iterationCounter++;
2088 if (m_iterationCounter == (int)m_iterations.size())
2089 return tcu::TestStatus::pass("Pass");
2091 return tcu::TestStatus::incomplete();
2095 void TextureSamplesInstance::initTexture (void)
2097 tcu::TestLog& log = m_context.getTestContext().getLog();
2098 tcu::IVec3 textureSize (m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth);
2099 TextureBindingSp textureBinding;
2101 DE_ASSERT(m_textures.empty());
2102 DE_ASSERT(m_textureSpec.type == TEXTURETYPE_2D || m_textureSpec.type == TEXTURETYPE_2D_ARRAY);
2104 log << tcu::TestLog::Message << "Image size: " << getTextureSizeString(m_textureSpec.type, textureSize) << tcu::TestLog::EndMessage;
2106 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, textureSize, m_textureSpec.numLevels, 0 /* lodBase */, m_textureSpec.sampler);
2108 m_textures.push_back(textureBinding);
2111 class TextureQueryLevelsInstance : public TextureQueryInstance
2114 TextureQueryLevelsInstance (Context& context,
2115 const bool isVertexCase,
2116 const TextureSpec& textureSpec);
2117 virtual ~TextureQueryLevelsInstance (void);
2119 virtual tcu::TestStatus iterate (void);
2124 tcu::IVec3 textureSize;
2128 void initTexture (void);
2129 bool testTextureLevels (void);
2131 TestSize m_testSize;
2133 int m_iterationCounter;
2136 TextureQueryLevelsInstance::TextureQueryLevelsInstance (Context& context,
2137 const bool isVertexCase,
2138 const TextureSpec& textureSpec)
2139 : TextureQueryInstance (context, isVertexCase, textureSpec)
2142 , m_iterationCounter (0)
2144 deMemset(&m_testSize, 0, sizeof(TestSize));
2146 m_renderSize = tcu::UVec2(1, 1);
2149 TextureQueryLevelsInstance::~TextureQueryLevelsInstance (void)
2153 tcu::TestStatus TextureQueryLevelsInstance::iterate (void)
2155 const TestSize testSizes[] =
2157 { tcu::IVec3(1, 2, 1), 0 },
2158 { tcu::IVec3(1, 2, 1), 1 },
2160 { tcu::IVec3(1, 3, 2), 0 },
2161 { tcu::IVec3(1, 3, 2), 1 },
2163 { tcu::IVec3(100, 31, 18), 0 },
2164 { tcu::IVec3(100, 31, 18), 1 },
2165 { tcu::IVec3(100, 31, 18), 2 },
2166 { tcu::IVec3(100, 31, 18), 3 },
2167 { tcu::IVec3(100, 31, 18), 4 },
2168 { tcu::IVec3(100, 31, 18), 5 },
2169 { tcu::IVec3(100, 31, 18), 6 },
2171 { tcu::IVec3(100, 128, 32), 0 },
2172 { tcu::IVec3(100, 128, 32), 1 },
2173 { tcu::IVec3(100, 128, 32), 2 },
2174 { tcu::IVec3(100, 128, 32), 3 },
2175 { tcu::IVec3(100, 128, 32), 4 },
2176 { tcu::IVec3(100, 128, 32), 5 },
2177 { tcu::IVec3(100, 128, 32), 6 },
2178 { tcu::IVec3(100, 128, 32), 7 },
2181 { tcu::IVec3(128, 64, 32), 0 },
2182 { tcu::IVec3(128, 64, 32), 1 },
2183 { tcu::IVec3(128, 64, 32), 2 },
2184 { tcu::IVec3(128, 64, 32), 3 },
2185 { tcu::IVec3(128, 64, 32), 4 },
2186 { tcu::IVec3(128, 64, 32), 5 },
2187 { tcu::IVec3(128, 64, 32), 6 },
2188 { tcu::IVec3(128, 64, 32), 7 },
2191 { tcu::IVec3(1, 1, 1), 0 },
2192 { tcu::IVec3(64, 64, 64), 0 },
2193 { tcu::IVec3(64, 64, 64), 1 },
2194 { tcu::IVec3(64, 64, 64), 2 },
2195 { tcu::IVec3(64, 64, 64), 3 },
2196 { tcu::IVec3(64, 64, 64), 4 },
2197 { tcu::IVec3(64, 64, 64), 5 },
2198 { tcu::IVec3(64, 64, 64), 6 },
2200 // w == h and d % 6 == 0 (for cube array)
2201 { tcu::IVec3(1, 1, 6), 0 },
2202 { tcu::IVec3(32, 32, 12), 0 },
2203 { tcu::IVec3(32, 32, 12), 1 },
2204 { tcu::IVec3(32, 32, 12), 2 },
2205 { tcu::IVec3(32, 32, 12), 3 },
2206 { tcu::IVec3(32, 32, 12), 4 },
2207 { tcu::IVec3(32, 32, 12), 5 },
2209 const int lastIterationIndex = DE_LENGTH_OF_ARRAY(testSizes) + 1;
2211 m_iterationCounter++;
2213 if (m_iterationCounter == lastIterationIndex)
2214 return tcu::TestStatus::pass("Pass");
2217 // set current test size
2218 m_testSize = testSizes[m_iterationCounter - 1];
2220 if (!testTextureLevels())
2221 return tcu::TestStatus::fail("Got unexpected result");
2223 return tcu::TestStatus::incomplete();
2227 bool TextureQueryLevelsInstance::testTextureLevels (void)
2229 tcu::TestLog& log = m_context.getTestContext().getLog();
2230 bool success = true;
2232 // skip incompatible cases
2233 if (!isValidCase(m_textureSpec.type, m_testSize.textureSize, 0, m_testSize.lodBase))
2239 // calculate accessible levels
2241 const int mipLevels = deLog2Floor32(getMaxTextureSize(m_textureSpec.type, m_testSize.textureSize)) + 1;
2243 m_levels = mipLevels - m_testSize.lodBase;
2244 DE_ASSERT(m_levels > 0);
2246 log << tcu::TestLog::Message << "Expected levels: " << m_levels << tcu::TestLog::EndMessage;
2250 TextureQueryInstance::render();
2254 const tcu::TextureLevel& result = getResultImage();
2255 tcu::IVec4 output = result.getAccess().getPixelInt(0, 0);
2257 if (output.x() == m_levels)
2260 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2265 log << tcu::TestLog::Message << "Result: " << output.x() << tcu::TestLog::EndMessage;
2266 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2271 log << tcu::TestLog::Message << tcu::TestLog::EndMessage;
2276 void TextureQueryLevelsInstance::initTexture (void)
2278 tcu::TestLog& log = m_context.getTestContext().getLog();
2279 int numLevels = m_testSize.lodBase + 1;
2280 TextureBindingSp textureBinding;
2282 log << tcu::TestLog::Message << "Image size: " << getTextureSizeString(m_textureSpec.type, m_testSize.textureSize) << tcu::TestLog::EndMessage;
2283 log << tcu::TestLog::Message << "Base level: " << m_testSize.lodBase << tcu::TestLog::EndMessage;
2285 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, m_testSize.textureSize, numLevels, m_testSize.lodBase, m_textureSpec.sampler);
2288 m_textures.push_back(textureBinding);
2291 static int getQueryLodFuncTextCoordComps (TextureType type)
2295 case TEXTURETYPE_1D:
2296 case TEXTURETYPE_1D_ARRAY:
2299 case TEXTURETYPE_2D:
2300 case TEXTURETYPE_2D_ARRAY:
2303 case TEXTURETYPE_3D:
2304 case TEXTURETYPE_CUBE_MAP:
2305 case TEXTURETYPE_CUBE_ARRAY:
2314 class TextureQueryLodInstance : public TextureQueryInstance
2317 TextureQueryLodInstance (Context& context,
2318 const bool isVertexCase,
2319 const TextureSpec& textureSpec);
2320 virtual ~TextureQueryLodInstance (void);
2322 virtual tcu::TestStatus iterate (void);
2325 virtual void setupDefaultInputs (void);
2328 void initTexture (void);
2329 float computeLevelFromLod (float computedLod) const;
2330 vector<float> computeQuadTexCoord (void) const;
2332 tcu::Vec4 m_minCoord;
2333 tcu::Vec4 m_maxCoord;
2334 tcu::Vec2 m_lodBounds;
2335 tcu::Vec2 m_levelBounds;
2338 TextureQueryLodInstance::TextureQueryLodInstance (Context& context,
2339 const bool isVertexCase,
2340 const TextureSpec& textureSpec)
2341 : TextureQueryInstance (context, isVertexCase, textureSpec)
2350 // init min/max coords
2351 switch (m_textureSpec.type)
2353 case TEXTURETYPE_1D:
2354 case TEXTURETYPE_1D_ARRAY:
2355 m_minCoord = Vec4(-0.2f, 0.0f, 0.0f, 0.0f);
2356 m_maxCoord = Vec4( 1.5f, 0.0f, 0.0f, 0.0f);
2359 case TEXTURETYPE_2D:
2360 case TEXTURETYPE_2D_ARRAY:
2361 m_minCoord = Vec4(-0.2f, -0.4f, 0.0f, 0.0f);
2362 m_maxCoord = Vec4( 1.5f, 2.3f, 0.0f, 0.0f);
2365 case TEXTURETYPE_3D:
2366 m_minCoord = Vec4(-1.2f, -1.4f, 0.1f, 0.0f);
2367 m_maxCoord = Vec4( 1.5f, 2.3f, 2.3f, 0.0f);
2370 case TEXTURETYPE_CUBE_MAP:
2371 case TEXTURETYPE_CUBE_ARRAY:
2372 m_minCoord = Vec4(-1.0f, -1.0f, 1.01f, 0.0f);
2373 m_maxCoord = Vec4( 1.0f, 1.0f, 1.01f, 0.0f);
2381 // calculate lod and accessed level
2383 const tcu::UVec2& viewportSize = getViewportSize();
2384 const float lodEps = (1.0f / float(1u << m_context.getDeviceProperties().limits.mipmapPrecisionBits)) + 0.008f;
2386 switch (m_textureSpec.type)
2388 case TEXTURETYPE_1D:
2389 case TEXTURETYPE_1D_ARRAY:
2391 const float dudx = (m_maxCoord[0]-m_minCoord[0])*(float)m_textureSpec.width / (float)viewportSize[0];
2393 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f)-lodEps;
2394 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f)+lodEps;
2398 case TEXTURETYPE_2D:
2399 case TEXTURETYPE_2D_ARRAY:
2401 const float dudx = (m_maxCoord[0]-m_minCoord[0])*(float)m_textureSpec.width / (float)viewportSize[0];
2402 const float dvdy = (m_maxCoord[1]-m_minCoord[1])*(float)m_textureSpec.height / (float)viewportSize[1];
2404 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f, 0.0f, dvdy)-lodEps;
2405 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f, 0.0f, dvdy)+lodEps;
2409 case TEXTURETYPE_CUBE_MAP:
2410 case TEXTURETYPE_CUBE_ARRAY:
2412 // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
2413 DE_ASSERT(de::abs(m_minCoord[2] - m_maxCoord[2]) < 0.005);
2414 DE_ASSERT(de::abs(m_minCoord[0]) < de::abs(m_minCoord[2]) && de::abs(m_maxCoord[0]) < de::abs(m_minCoord[2]));
2415 DE_ASSERT(de::abs(m_minCoord[1]) < de::abs(m_minCoord[2]) && de::abs(m_maxCoord[1]) < de::abs(m_minCoord[2]));
2417 tcu::CubeFaceFloatCoords c00 = tcu::getCubeFaceCoords(Vec3(m_minCoord[0], m_minCoord[1], m_minCoord[2]));
2418 tcu::CubeFaceFloatCoords c10 = tcu::getCubeFaceCoords(Vec3(m_maxCoord[0], m_minCoord[1], m_minCoord[2]));
2419 tcu::CubeFaceFloatCoords c01 = tcu::getCubeFaceCoords(Vec3(m_minCoord[0], m_maxCoord[1], m_minCoord[2]));
2420 float dudx = (c10.s - c00.s)*(float)m_textureSpec.width / (float)viewportSize[0];
2421 float dvdy = (c01.t - c00.t)*(float)m_textureSpec.height / (float)viewportSize[1];
2423 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f, 0.0f, dvdy)-lodEps;
2424 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f, 0.0f, dvdy)+lodEps;
2428 case TEXTURETYPE_3D:
2430 const float dudx = (m_maxCoord[0]-m_minCoord[0])*(float)m_textureSpec.width / (float)viewportSize[0];
2431 const float dvdy = (m_maxCoord[1]-m_minCoord[1])*(float)m_textureSpec.height / (float)viewportSize[1];
2432 const float dwdx = (m_maxCoord[2]-m_minCoord[2])*0.5f*(float)m_textureSpec.depth / (float)viewportSize[0];
2433 const float dwdy = (m_maxCoord[2]-m_minCoord[2])*0.5f*(float)m_textureSpec.depth / (float)viewportSize[1];
2435 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f, dwdx, 0.0f, dvdy, dwdy)-lodEps;
2436 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f, dwdx, 0.0f, dvdy, dwdy)+lodEps;
2445 m_levelBounds[0] = computeLevelFromLod(m_lodBounds[0]);
2446 m_levelBounds[1] = computeLevelFromLod(m_lodBounds[1]);
2450 TextureQueryLodInstance::~TextureQueryLodInstance (void)
2454 tcu::TestStatus TextureQueryLodInstance::iterate (void)
2456 tcu::TestLog& log = m_context.getTestContext().getLog();
2458 log << tcu::TestLog::Message << "Expected: level in range " << m_levelBounds << ", lod in range " << m_lodBounds << tcu::TestLog::EndMessage;
2461 TextureQueryInstance::render();
2465 const tcu::TextureLevel& result = getResultImage();
2466 const tcu::Vec4 output = result.getAccess().getPixel(0, 0);
2467 const float resLevel = output.x();
2468 const float resLod = output.y();
2470 if (de::inRange(resLevel, m_levelBounds[0], m_levelBounds[1]) && de::inRange(resLod, m_lodBounds[0], m_lodBounds[1]))
2473 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2474 return tcu::TestStatus::pass("Pass");
2479 log << tcu::TestLog::Message << "Result: level: " << resLevel << ", lod: " << resLod << tcu::TestLog::EndMessage;
2480 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2481 return tcu::TestStatus::fail("Got unexpected result");
2486 void TextureQueryLodInstance::setupDefaultInputs (void)
2488 TextureQueryInstance::setupDefaultInputs();
2490 const deUint32 numVertices = 4;
2491 const vector<float> texCoord = computeQuadTexCoord();
2492 const int texCoordComps = getQueryLodFuncTextCoordComps(m_textureSpec.type);
2493 const vk::VkFormat coordFormats[] =
2495 vk::VK_FORMAT_R32_SFLOAT,
2496 vk::VK_FORMAT_R32G32_SFLOAT,
2497 vk::VK_FORMAT_R32G32B32_SFLOAT
2500 DE_ASSERT(de::inRange(texCoordComps, 1, 3));
2501 DE_ASSERT((int)texCoord.size() == texCoordComps * 4);
2503 addAttribute(1u, coordFormats[texCoordComps - 1], (deUint32)(texCoordComps * sizeof(float)), numVertices, texCoord.data());
2506 void TextureQueryLodInstance::initTexture (void)
2508 tcu::TestLog& log = m_context.getTestContext().getLog();
2509 tcu::IVec3 textureSize (m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth);
2510 TextureBindingSp textureBinding;
2512 DE_ASSERT(m_textures.empty());
2514 log << tcu::TestLog::Message << "Image size: " << getTextureSizeString(m_textureSpec.type, textureSize) << tcu::TestLog::EndMessage;
2516 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, textureSize, m_textureSpec.numLevels, 0 /* lodBase */, m_textureSpec.sampler);
2518 m_textures.push_back(textureBinding);
2521 float TextureQueryLodInstance::computeLevelFromLod (float computedLod) const
2523 const int maxAccessibleLevel = m_textureSpec.numLevels - 1;
2525 // Clamp the computed LOD to the range of accessible levels.
2526 computedLod = deFloatClamp(computedLod, 0.0f, (float)maxAccessibleLevel);
2528 // Return a value according to the min filter.
2529 switch (m_textureSpec.sampler.minFilter)
2531 case tcu::Sampler::LINEAR:
2532 case tcu::Sampler::NEAREST:
2535 case tcu::Sampler::NEAREST_MIPMAP_NEAREST:
2536 case tcu::Sampler::LINEAR_MIPMAP_NEAREST:
2537 return deFloatClamp(deFloatCeil(computedLod + 0.5f) - 1.0f, 0.0f, (float)maxAccessibleLevel);
2539 case tcu::Sampler::NEAREST_MIPMAP_LINEAR:
2540 case tcu::Sampler::LINEAR_MIPMAP_LINEAR:
2549 vector<float> TextureQueryLodInstance::computeQuadTexCoord (void) const
2552 tcu::Mat4 coordTransMat;
2555 Vec4 s = m_maxCoord - m_minCoord;
2556 Vec4 b = m_minCoord;
2558 float baseCoordTrans[] =
2560 s.x(), 0.0f, 0.f, b.x(),
2561 0.f, s.y(), 0.f, b.y(),
2562 s.z()/2.f, -s.z()/2.f, 0.f, s.z()/2.f + b.z(),
2563 -s.w()/2.f, s.w()/2.f, 0.f, s.w()/2.f + b.w()
2566 coordTransMat = tcu::Mat4(baseCoordTrans);
2569 const int texCoordComps = getQueryLodFuncTextCoordComps(m_textureSpec.type);
2572 coordTransMat * tcu::Vec4(0, 0, 0, 1),
2573 coordTransMat * tcu::Vec4(0, 1, 0, 1),
2574 coordTransMat * tcu::Vec4(1, 0, 0, 1),
2575 coordTransMat * tcu::Vec4(1, 1, 0, 1)
2578 res.resize(4 * texCoordComps);
2580 for (int ndx = 0; ndx < 4; ndx++)
2581 deMemcpy(&res[ndx * texCoordComps], coords[ndx].getPtr(), texCoordComps * sizeof(float));
2586 class TextureQueryCase : public ShaderRenderCase
2589 TextureQueryCase (tcu::TestContext& testCtx,
2590 const std::string& name,
2591 const std::string& desc,
2592 const std::string& samplerType,
2593 const TextureSpec& texture,
2595 QueryFunction function);
2596 virtual ~TextureQueryCase (void);
2598 virtual TestInstance* createInstance (Context& context) const;
2601 void initShaderSources (void);
2603 const std::string m_samplerTypeStr;
2604 const TextureSpec m_textureSpec;
2605 const QueryFunction m_function;
2608 TextureQueryCase::TextureQueryCase (tcu::TestContext& testCtx,
2609 const std::string& name,
2610 const std::string& desc,
2611 const std::string& samplerType,
2612 const TextureSpec& texture,
2614 QueryFunction function)
2615 : ShaderRenderCase (testCtx, name, desc, isVertexCase, (ShaderEvaluator*)DE_NULL, DE_NULL, DE_NULL)
2616 , m_samplerTypeStr (samplerType)
2617 , m_textureSpec (texture)
2618 , m_function (function)
2620 initShaderSources();
2623 TextureQueryCase::~TextureQueryCase (void)
2627 TestInstance* TextureQueryCase::createInstance (Context& context) const
2631 case QUERYFUNCTION_TEXTURESIZE: return new TextureSizeInstance(context, m_isVertexCase, m_textureSpec);
2632 case QUERYFUNCTION_TEXTUREQUERYLOD: return new TextureQueryLodInstance(context, m_isVertexCase, m_textureSpec);
2633 case QUERYFUNCTION_TEXTUREQUERYLEVELS: return new TextureQueryLevelsInstance(context, m_isVertexCase, m_textureSpec);
2634 case QUERYFUNCTION_TEXTURESAMPLES: return new TextureSamplesInstance(context, m_isVertexCase, m_textureSpec);
2641 void TextureQueryCase::initShaderSources (void)
2643 std::ostringstream vert;
2644 std::ostringstream frag;
2645 std::ostringstream& op = m_isVertexCase ? vert : frag;
2646 glu::GLSLVersion version = glu::GLSL_VERSION_LAST;
2648 DE_ASSERT(m_function != QUERYFUNCTION_TEXTUREQUERYLOD || !m_isVertexCase);
2652 case QUERYFUNCTION_TEXTURESIZE:
2653 if (m_textureSpec.type == TEXTURETYPE_1D || m_textureSpec.type == TEXTURETYPE_1D_ARRAY || m_textureSpec.type == TEXTURETYPE_CUBE_ARRAY)
2654 version = glu::GLSL_VERSION_420;
2656 version = glu::GLSL_VERSION_310_ES;
2659 case QUERYFUNCTION_TEXTUREQUERYLOD:
2660 version = glu::GLSL_VERSION_420;
2663 case QUERYFUNCTION_TEXTUREQUERYLEVELS:
2664 version = glu::GLSL_VERSION_430;
2667 case QUERYFUNCTION_TEXTURESAMPLES:
2668 version = glu::GLSL_VERSION_450;
2676 vert << glu::getGLSLVersionDeclaration(version) << "\n"
2677 << "layout(location = 0) in highp vec4 a_position;\n";
2679 frag << glu::getGLSLVersionDeclaration(version) << "\n"
2680 << "layout(location = 0) out mediump vec4 o_color;\n";
2684 vert << "layout(location = 0) out mediump vec4 v_color;\n";
2685 frag << "layout(location = 0) in mediump vec4 v_color;\n";
2688 if (m_function == QUERYFUNCTION_TEXTUREQUERYLOD)
2690 const int texCoordComps = getQueryLodFuncTextCoordComps(m_textureSpec.type);
2691 const char* coordTypeName = glu::getDataTypeName(glu::getDataTypeFloatVec(texCoordComps));
2693 vert << "layout (location = 1) in highp " << coordTypeName << " a_texCoord;\n";
2694 vert << "layout (location = 0) out highp " << coordTypeName << " v_texCoord;\n";
2695 frag << "layout (location = 0) in highp " << coordTypeName << " v_texCoord;\n";
2699 op << "layout(set = 0, binding = 0) uniform highp " << m_samplerTypeStr << " u_sampler;\n";
2700 if (m_function == QUERYFUNCTION_TEXTURESIZE)
2701 op << "layout(set = 0, binding = 1) uniform buf0 { highp int u_lod; };\n";
2703 if (version != glu::GLSL_VERSION_310_ES)
2704 vert << "out gl_PerVertex {\n"
2705 << "\tvec4 gl_Position;\n"
2708 vert << "\nvoid main()\n{\n"
2709 << "\tgl_Position = a_position;\n";
2710 frag << "\nvoid main()\n{\n";
2713 vert << "\tv_color = ";
2715 frag << "\to_color = ";
2723 case QUERYFUNCTION_TEXTURESIZE:
2725 const int resultComponents = glu::getDataTypeScalarSize(getTextureSizeFuncResultType(m_textureSpec.type));
2727 op << "textureSize(u_sampler, u_lod)";
2728 for (int ndx = 0; ndx < 3 - resultComponents; ndx++)
2735 case QUERYFUNCTION_TEXTUREQUERYLOD:
2736 op << "textureQueryLod(u_sampler, v_texCoord), 0.0, 1.0";
2739 case QUERYFUNCTION_TEXTUREQUERYLEVELS:
2740 op << "textureQueryLevels(u_sampler), 0.0, 0.0, 1.0";
2743 case QUERYFUNCTION_TEXTURESAMPLES:
2744 op << "textureSamples(u_sampler), 0.0, 0.0, 1.0";
2756 frag << "\to_color = v_color;\n";
2758 if (m_function == QUERYFUNCTION_TEXTUREQUERYLOD)
2759 vert << "\tv_texCoord = a_texCoord;\n";
2764 m_vertShaderSource = vert.str();
2765 m_fragShaderSource = frag.str();
2768 class ShaderTextureFunctionTests : public tcu::TestCaseGroup
2771 ShaderTextureFunctionTests (tcu::TestContext& context);
2772 virtual ~ShaderTextureFunctionTests (void);
2773 virtual void init (void);
2776 ShaderTextureFunctionTests (const ShaderTextureFunctionTests&); // not allowed!
2777 ShaderTextureFunctionTests& operator= (const ShaderTextureFunctionTests&); // not allowed!
2780 ShaderTextureFunctionTests::ShaderTextureFunctionTests (tcu::TestContext& context)
2781 : TestCaseGroup(context, "texture_functions", "Texture Access Function Tests")
2785 ShaderTextureFunctionTests::~ShaderTextureFunctionTests (void)
2793 BOTH = VERTEX|FRAGMENT
2796 struct TexFuncCaseSpec
2799 TextureLookupSpec lookupSpec;
2800 TextureSpec texSpec;
2801 TexEvalFunc evalFunc;
2805 #define CASE_SPEC(NAME, FUNC, MINCOORD, MAXCOORD, USEBIAS, MINLOD, MAXLOD, USEOFFSET, OFFSET, TEXSPEC, EVALFUNC, FLAGS) \
2806 { #NAME, TextureLookupSpec(FUNC, MINCOORD, MAXCOORD, USEBIAS, MINLOD, MAXLOD, tcu::Vec3(0.0f), tcu::Vec3(0.0f), tcu::Vec3(0.0f), tcu::Vec3(0.0f), USEOFFSET, OFFSET), TEXSPEC, EVALFUNC, FLAGS }
2807 #define GRAD_CASE_SPEC(NAME, FUNC, MINCOORD, MAXCOORD, MINDX, MAXDX, MINDY, MAXDY, USEOFFSET, OFFSET, TEXSPEC, EVALFUNC, FLAGS) \
2808 { #NAME, TextureLookupSpec(FUNC, MINCOORD, MAXCOORD, false, 0.0f, 0.0f, MINDX, MAXDX, MINDY, MAXDY, USEOFFSET, OFFSET), TEXSPEC, EVALFUNC, FLAGS }
2810 class SparseShaderTextureFunctionInstance : public ShaderTextureFunctionInstance
2813 SparseShaderTextureFunctionInstance (Context& context,
2814 const bool isVertexCase,
2815 const ShaderEvaluator& evaluator,
2816 const UniformSetup& uniformSetup,
2817 const TextureLookupSpec& lookupSpec,
2818 const TextureSpec& textureSpec,
2819 const TexLookupParams& lookupParams,
2820 const ImageBackingMode imageBackingMode = IMAGE_BACKING_MODE_SPARSE);
2821 virtual ~SparseShaderTextureFunctionInstance (void);
2824 SparseShaderTextureFunctionInstance::SparseShaderTextureFunctionInstance (Context& context,
2825 const bool isVertexCase,
2826 const ShaderEvaluator& evaluator,
2827 const UniformSetup& uniformSetup,
2828 const TextureLookupSpec& lookupSpec,
2829 const TextureSpec& textureSpec,
2830 const TexLookupParams& lookupParams,
2831 const ImageBackingMode imageBackingMode)
2832 : ShaderTextureFunctionInstance (context, isVertexCase, evaluator, uniformSetup, lookupSpec, textureSpec, lookupParams, imageBackingMode)
2836 SparseShaderTextureFunctionInstance::~SparseShaderTextureFunctionInstance (void)
2840 class SparseShaderTextureFunctionCase : public ShaderTextureFunctionCase
2843 SparseShaderTextureFunctionCase (tcu::TestContext& testCtx,
2844 const std::string& name,
2845 const std::string& desc,
2846 const TextureLookupSpec& lookup,
2847 const TextureSpec& texture,
2848 TexEvalFunc evalFunc,
2851 virtual ~SparseShaderTextureFunctionCase (void);
2853 virtual TestInstance* createInstance (Context& context) const;
2855 void initShaderSources (void);
2858 SparseShaderTextureFunctionCase::SparseShaderTextureFunctionCase (tcu::TestContext& testCtx,
2859 const std::string& name,
2860 const std::string& desc,
2861 const TextureLookupSpec& lookup,
2862 const TextureSpec& texture,
2863 TexEvalFunc evalFunc,
2865 : ShaderTextureFunctionCase (testCtx, name, desc, lookup, texture, evalFunc, isVertexCase)
2867 initShaderSources();
2870 void SparseShaderTextureFunctionCase::initShaderSources (void)
2872 const Function function = m_lookupSpec.function;
2873 const bool isVtxCase = m_isVertexCase;
2874 const bool isProj = functionHasProj(function);
2875 const bool isGrad = functionHasGrad(function);
2876 const bool isShadow = m_textureSpec.sampler.compare != tcu::Sampler::COMPAREMODE_NONE;
2877 const bool is2DProj4 = !isShadow && m_textureSpec.type == TEXTURETYPE_2D && (function == FUNCTION_TEXTUREPROJ || function == FUNCTION_TEXTUREPROJLOD || function == FUNCTION_TEXTUREPROJGRAD);
2878 const bool isIntCoord = function == FUNCTION_TEXELFETCH;
2879 const bool hasLodBias = functionHasLod(m_lookupSpec.function) || m_lookupSpec.useBias;
2880 const int texCoordComps = m_textureSpec.type == TEXTURETYPE_2D ? 2 : 3;
2881 const int extraCoordComps = (isProj ? (is2DProj4 ? 2 : 1) : 0) + (isShadow ? 1 : 0);
2882 const glu::DataType coordType = glu::getDataTypeFloatVec(texCoordComps+extraCoordComps);
2883 const glu::Precision coordPrec = glu::PRECISION_HIGHP;
2884 const char* coordTypeName = glu::getDataTypeName(coordType);
2885 const char* coordPrecName = glu::getPrecisionName(coordPrec);
2886 const tcu::TextureFormat texFmt = glu::mapGLInternalFormat(m_textureSpec.format);
2887 glu::DataType samplerType = glu::TYPE_LAST;
2888 const glu::DataType gradType = (m_textureSpec.type == TEXTURETYPE_CUBE_MAP || m_textureSpec.type == TEXTURETYPE_3D) ? glu::TYPE_FLOAT_VEC3 : glu::TYPE_FLOAT_VEC2;
2889 const char* gradTypeName = glu::getDataTypeName(gradType);
2890 const char* baseFuncName = DE_NULL;
2892 DE_ASSERT(!isGrad || !hasLodBias);
2894 switch (m_textureSpec.type)
2896 case TEXTURETYPE_2D: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_SHADOW : glu::getSampler2DType(texFmt); break;
2897 case TEXTURETYPE_CUBE_MAP: samplerType = isShadow ? glu::TYPE_SAMPLER_CUBE_SHADOW : glu::getSamplerCubeType(texFmt); break;
2898 case TEXTURETYPE_2D_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_ARRAY_SHADOW : glu::getSampler2DArrayType(texFmt); break;
2899 case TEXTURETYPE_3D: DE_ASSERT(!isShadow); samplerType = glu::getSampler3DType(texFmt); break;
2901 DE_ASSERT(DE_FALSE);
2904 // Not supported cases
2905 switch (m_lookupSpec.function)
2907 case FUNCTION_TEXTURE: baseFuncName = "sparseTexture"; break;
2908 case FUNCTION_TEXTURELOD: baseFuncName = "sparseTextureLod"; break;
2909 case FUNCTION_TEXTUREGRAD: baseFuncName = "sparseTextureGrad"; break;
2910 case FUNCTION_TEXELFETCH: baseFuncName = "sparseTexelFetch"; break;
2912 DE_ASSERT(DE_FALSE);
2915 std::ostringstream vert;
2916 std::ostringstream frag;
2917 std::ostringstream& op = isVtxCase ? vert : frag;
2919 vert << "#version 450\n"
2920 << "#extension GL_ARB_sparse_texture2 : require\n"
2921 << "layout(location = 0) in highp vec4 a_position;\n"
2922 << "layout(location = 4) in " << coordPrecName << " " << coordTypeName << " a_in0;\n";
2926 vert << "layout(location = 5) in " << coordPrecName << " " << gradTypeName << " a_in1;\n";
2927 vert << "layout(location = 6) in " << coordPrecName << " " << gradTypeName << " a_in2;\n";
2929 else if (hasLodBias)
2930 vert << "layout(location = 5) in " << coordPrecName << " float a_in1;\n";
2932 frag << "#version 450\n"
2933 << "#extension GL_ARB_sparse_texture2 : require\n"
2934 << "layout(location = 0) out mediump vec4 o_color;\n";
2938 vert << "layout(location = 0) out mediump vec4 v_color;\n";
2939 frag << "layout(location = 0) in mediump vec4 v_color;\n";
2943 vert << "layout(location = 0) out " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
2944 frag << "layout(location = 0) in " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
2948 vert << "layout(location = 1) out " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
2949 vert << "layout(location = 2) out " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
2950 frag << "layout(location = 1) in " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
2951 frag << "layout(location = 2) in " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
2953 else if (hasLodBias)
2955 vert << "layout(location = 1) out " << coordPrecName << " float v_lodBias;\n";
2956 frag << "layout(location = 1) in " << coordPrecName << " float v_lodBias;\n";
2961 op << "layout(set = 0, binding = 0) uniform highp " << glu::getDataTypeName(samplerType) << " u_sampler;\n"
2962 << "layout(set = 0, binding = 1) uniform buf0 { highp vec4 u_scale; };\n"
2963 << "layout(set = 0, binding = 2) uniform buf1 { highp vec4 u_bias; };\n";
2965 vert << "out gl_PerVertex {\n"
2966 << " vec4 gl_Position;\n"
2968 vert << "\nvoid main()\n{\n"
2969 << "\tgl_Position = a_position;\n";
2970 frag << "\nvoid main()\n{\n";
2974 // Texel declaration
2976 op << "\tfloat texel;\n";
2978 op << "\tvec4 texel;\n";
2980 const char* const texCoord = isVtxCase ? "a_in0" : "v_texCoord";
2981 const char* const gradX = isVtxCase ? "a_in1" : "v_gradX";
2982 const char* const gradY = isVtxCase ? "a_in2" : "v_gradY";
2983 const char* const lodBias = isVtxCase ? "a_in1" : "v_lodBias";
2985 op << "\tint success = " << baseFuncName;
2987 if (m_lookupSpec.useOffset)
2990 op << "ARB(u_sampler, ";
2993 op << "ivec" << (texCoordComps+extraCoordComps) << "(";
3001 op << ", " << gradX << ", " << gradY;
3003 if (functionHasLod(function))
3006 op << ", int(" << lodBias << ")";
3008 op << ", " << lodBias;
3011 if (m_lookupSpec.useOffset)
3013 int offsetComps = m_textureSpec.type == TEXTURETYPE_3D ? 3 : 2;
3015 op << ", ivec" << offsetComps << "(";
3016 for (int ndx = 0; ndx < offsetComps; ndx++)
3020 op << m_lookupSpec.offset[ndx];
3027 if (m_lookupSpec.useBias)
3028 op << ", " << lodBias;
3032 // Check sparse validity, and handle each case
3033 op << "\tif (sparseTexelsResidentARB(success))\n";
3036 vert << "\t\tv_color = ";
3038 frag << "\t\to_color = ";
3041 op << "vec4(texel, 0.0, 0.0, 1.0);\n";
3043 op << "vec4(texel * u_scale + u_bias);\n";
3047 // This color differs from the used colors
3049 vert << "\t\tv_color = vec4(0.54117647058, 0.16862745098, 0.8862745098, 1.0);\n";
3051 frag << "\t\to_color = vec4(0.54117647058, 0.16862745098, 0.8862745098, 1.0);\n";
3055 frag << "\to_color = v_color;\n";
3058 vert << "\tv_texCoord = a_in0;\n";
3062 vert << "\tv_gradX = a_in1;\n";
3063 vert << "\tv_gradY = a_in2;\n";
3065 else if (hasLodBias)
3066 vert << "\tv_lodBias = a_in1;\n";
3072 m_vertShaderSource = vert.str();
3073 m_fragShaderSource = frag.str();
3076 SparseShaderTextureFunctionCase::~SparseShaderTextureFunctionCase ()
3080 TestInstance* SparseShaderTextureFunctionCase::createInstance (Context& context) const
3082 DE_ASSERT(m_evaluator != DE_NULL);
3083 DE_ASSERT(m_uniformSetup != DE_NULL);
3084 return new SparseShaderTextureFunctionInstance(context, m_isVertexCase, *m_evaluator, *m_uniformSetup, m_lookupSpec, m_textureSpec, m_lookupParams);
3087 static void createCaseGroup (tcu::TestCaseGroup* parent, const char* groupName, const char* groupDesc, const TexFuncCaseSpec* cases, int numCases)
3089 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(parent->getTestContext(), groupName, groupDesc));
3091 for (int ndx = 0; ndx < numCases; ndx++)
3093 std::string name = cases[ndx].name;
3094 bool sparseSupported = !functionHasProj(cases[ndx].lookupSpec.function) &&
3095 TEXTURETYPE_1D != cases[ndx].texSpec.type &&
3096 TEXTURETYPE_1D_ARRAY != cases[ndx].texSpec.type &&
3097 TEXTURETYPE_CUBE_ARRAY != cases[ndx].texSpec.type;
3099 if (cases[ndx].flags & VERTEX)
3101 if (sparseSupported)
3102 group->addChild(new SparseShaderTextureFunctionCase(parent->getTestContext(), ("sparse_" + name + "_vertex"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, true ));
3104 group->addChild(new ShaderTextureFunctionCase(parent->getTestContext(), (name + "_vertex"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, true ));
3107 if (cases[ndx].flags & FRAGMENT)
3109 if (sparseSupported)
3110 group->addChild(new SparseShaderTextureFunctionCase(parent->getTestContext(), ("sparse_" + name + "_fragment"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, false));
3112 group->addChild(new ShaderTextureFunctionCase(parent->getTestContext(), (name + "_fragment"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, false));
3116 parent->addChild(group.release());
3119 void ShaderTextureFunctionTests::init (void)
3122 static const tcu::Sampler samplerNearestNoMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3123 tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
3124 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3125 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3126 static const tcu::Sampler samplerLinearNoMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3127 tcu::Sampler::LINEAR, tcu::Sampler::LINEAR,
3128 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3129 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3130 static const tcu::Sampler samplerNearestMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3131 tcu::Sampler::NEAREST_MIPMAP_NEAREST, tcu::Sampler::NEAREST,
3132 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3133 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3134 static const tcu::Sampler samplerLinearMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3135 tcu::Sampler::LINEAR_MIPMAP_NEAREST, tcu::Sampler::LINEAR,
3136 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3137 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3139 static const tcu::Sampler samplerShadowNoMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3140 tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
3141 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_LESS,
3142 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3143 static const tcu::Sampler samplerShadowMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3144 tcu::Sampler::NEAREST_MIPMAP_NEAREST, tcu::Sampler::NEAREST,
3145 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_LESS,
3146 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3148 static const tcu::Sampler samplerTexelFetch (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3149 tcu::Sampler::NEAREST_MIPMAP_NEAREST, tcu::Sampler::NEAREST,
3150 00.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3151 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3153 // Default textures.
3154 // Type Format W H D L Sampler
3155 static const TextureSpec tex2DFixed (TEXTURETYPE_2D, GL_RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
3156 static const TextureSpec tex2DFloat (TEXTURETYPE_2D, GL_RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
3157 static const TextureSpec tex2DInt (TEXTURETYPE_2D, GL_RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
3158 static const TextureSpec tex2DUint (TEXTURETYPE_2D, GL_RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
3159 static const TextureSpec tex2DMipmapFixed (TEXTURETYPE_2D, GL_RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
3160 static const TextureSpec tex2DMipmapFloat (TEXTURETYPE_2D, GL_RGBA16F, 256, 256, 1, 9, samplerLinearMipmap);
3161 static const TextureSpec tex2DMipmapInt (TEXTURETYPE_2D, GL_RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
3162 static const TextureSpec tex2DMipmapUint (TEXTURETYPE_2D, GL_RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
3164 static const TextureSpec tex2DShadow (TEXTURETYPE_2D, GL_DEPTH_COMPONENT16, 256, 256, 1, 1, samplerShadowNoMipmap);
3165 static const TextureSpec tex2DMipmapShadow (TEXTURETYPE_2D, GL_DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
3167 static const TextureSpec tex2DTexelFetchFixed (TEXTURETYPE_2D, GL_RGBA8, 256, 256, 1, 9, samplerTexelFetch);
3168 static const TextureSpec tex2DTexelFetchFloat (TEXTURETYPE_2D, GL_RGBA16F, 256, 256, 1, 9, samplerTexelFetch);
3169 static const TextureSpec tex2DTexelFetchInt (TEXTURETYPE_2D, GL_RGBA8I, 256, 256, 1, 9, samplerTexelFetch);
3170 static const TextureSpec tex2DTexelFetchUint (TEXTURETYPE_2D, GL_RGBA8UI, 256, 256, 1, 9, samplerTexelFetch);
3172 static const TextureSpec texCubeFixed (TEXTURETYPE_CUBE_MAP, GL_RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
3173 static const TextureSpec texCubeFloat (TEXTURETYPE_CUBE_MAP, GL_RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
3174 static const TextureSpec texCubeInt (TEXTURETYPE_CUBE_MAP, GL_RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
3175 static const TextureSpec texCubeUint (TEXTURETYPE_CUBE_MAP, GL_RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
3176 static const TextureSpec texCubeMipmapFixed (TEXTURETYPE_CUBE_MAP, GL_RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
3177 static const TextureSpec texCubeMipmapFloat (TEXTURETYPE_CUBE_MAP, GL_RGBA16F, 128, 128, 1, 8, samplerLinearMipmap);
3178 static const TextureSpec texCubeMipmapInt (TEXTURETYPE_CUBE_MAP, GL_RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
3179 static const TextureSpec texCubeMipmapUint (TEXTURETYPE_CUBE_MAP, GL_RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
3181 static const TextureSpec texCubeShadow (TEXTURETYPE_CUBE_MAP, GL_DEPTH_COMPONENT16, 256, 256, 1, 1, samplerShadowNoMipmap);
3182 static const TextureSpec texCubeMipmapShadow (TEXTURETYPE_CUBE_MAP, GL_DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
3184 static const TextureSpec tex2DArrayFixed (TEXTURETYPE_2D_ARRAY, GL_RGBA8, 128, 128, 4, 1, samplerLinearNoMipmap);
3185 static const TextureSpec tex2DArrayFloat (TEXTURETYPE_2D_ARRAY, GL_RGBA16F, 128, 128, 4, 1, samplerLinearNoMipmap);
3186 static const TextureSpec tex2DArrayInt (TEXTURETYPE_2D_ARRAY, GL_RGBA8I, 128, 128, 4, 1, samplerNearestNoMipmap);
3187 static const TextureSpec tex2DArrayUint (TEXTURETYPE_2D_ARRAY, GL_RGBA8UI, 128, 128, 4, 1, samplerNearestNoMipmap);
3188 static const TextureSpec tex2DArrayMipmapFixed (TEXTURETYPE_2D_ARRAY, GL_RGBA8, 128, 128, 4, 8, samplerLinearMipmap);
3189 static const TextureSpec tex2DArrayMipmapFloat (TEXTURETYPE_2D_ARRAY, GL_RGBA16F, 128, 128, 4, 8, samplerLinearMipmap);
3190 static const TextureSpec tex2DArrayMipmapInt (TEXTURETYPE_2D_ARRAY, GL_RGBA8I, 128, 128, 4, 8, samplerNearestMipmap);
3191 static const TextureSpec tex2DArrayMipmapUint (TEXTURETYPE_2D_ARRAY, GL_RGBA8UI, 128, 128, 4, 8, samplerNearestMipmap);
3193 static const TextureSpec tex2DArrayShadow (TEXTURETYPE_2D_ARRAY, GL_DEPTH_COMPONENT16, 128, 128, 4, 1, samplerShadowNoMipmap);
3194 static const TextureSpec tex2DArrayMipmapShadow (TEXTURETYPE_2D_ARRAY, GL_DEPTH_COMPONENT16, 128, 128, 4, 8, samplerShadowMipmap);
3196 static const TextureSpec tex2DArrayTexelFetchFixed (TEXTURETYPE_2D_ARRAY, GL_RGBA8, 128, 128, 4, 8, samplerTexelFetch);
3197 static const TextureSpec tex2DArrayTexelFetchFloat (TEXTURETYPE_2D_ARRAY, GL_RGBA16F, 128, 128, 4, 8, samplerTexelFetch);
3198 static const TextureSpec tex2DArrayTexelFetchInt (TEXTURETYPE_2D_ARRAY, GL_RGBA8I, 128, 128, 4, 8, samplerTexelFetch);
3199 static const TextureSpec tex2DArrayTexelFetchUint (TEXTURETYPE_2D_ARRAY, GL_RGBA8UI, 128, 128, 4, 8, samplerTexelFetch);
3201 static const TextureSpec tex3DFixed (TEXTURETYPE_3D, GL_RGBA8, 64, 32, 32, 1, samplerLinearNoMipmap);
3202 static const TextureSpec tex3DFloat (TEXTURETYPE_3D, GL_RGBA16F, 64, 32, 32, 1, samplerLinearNoMipmap);
3203 static const TextureSpec tex3DInt (TEXTURETYPE_3D, GL_RGBA8I, 64, 32, 32, 1, samplerNearestNoMipmap);
3204 static const TextureSpec tex3DUint (TEXTURETYPE_3D, GL_RGBA8UI, 64, 32, 32, 1, samplerNearestNoMipmap);
3205 static const TextureSpec tex3DMipmapFixed (TEXTURETYPE_3D, GL_RGBA8, 64, 32, 32, 7, samplerLinearMipmap);
3206 static const TextureSpec tex3DMipmapFloat (TEXTURETYPE_3D, GL_RGBA16F, 64, 32, 32, 7, samplerLinearMipmap);
3207 static const TextureSpec tex3DMipmapInt (TEXTURETYPE_3D, GL_RGBA8I, 64, 32, 32, 7, samplerNearestMipmap);
3208 static const TextureSpec tex3DMipmapUint (TEXTURETYPE_3D, GL_RGBA8UI, 64, 32, 32, 7, samplerNearestMipmap);
3210 static const TextureSpec tex3DTexelFetchFixed (TEXTURETYPE_3D, GL_RGBA8, 64, 32, 32, 7, samplerTexelFetch);
3211 static const TextureSpec tex3DTexelFetchFloat (TEXTURETYPE_3D, GL_RGBA16F, 64, 32, 32, 7, samplerTexelFetch);
3212 static const TextureSpec tex3DTexelFetchInt (TEXTURETYPE_3D, GL_RGBA8I, 64, 32, 32, 7, samplerTexelFetch);
3213 static const TextureSpec tex3DTexelFetchUint (TEXTURETYPE_3D, GL_RGBA8UI, 64, 32, 32, 7, samplerTexelFetch);
3215 static const TextureSpec tex1DFixed (TEXTURETYPE_1D, GL_RGBA8, 256, 1, 1, 1, samplerLinearNoMipmap);
3216 static const TextureSpec tex1DFloat (TEXTURETYPE_1D, GL_RGBA16F, 256, 1, 1, 1, samplerLinearNoMipmap);
3217 static const TextureSpec tex1DInt (TEXTURETYPE_1D, GL_RGBA8I, 256, 1, 1, 1, samplerNearestNoMipmap);
3218 static const TextureSpec tex1DUint (TEXTURETYPE_1D, GL_RGBA8UI, 256, 1, 1, 1, samplerNearestNoMipmap);
3219 static const TextureSpec tex1DMipmapFixed (TEXTURETYPE_1D, GL_RGBA8, 256, 1, 1, 9, samplerLinearMipmap);
3220 static const TextureSpec tex1DMipmapFloat (TEXTURETYPE_1D, GL_RGBA16F, 256, 1, 1, 9, samplerLinearMipmap);
3221 static const TextureSpec tex1DMipmapInt (TEXTURETYPE_1D, GL_RGBA8I, 256, 1, 1, 9, samplerNearestMipmap);
3222 static const TextureSpec tex1DMipmapUint (TEXTURETYPE_1D, GL_RGBA8UI, 256, 1, 1, 9, samplerNearestMipmap);
3224 static const TextureSpec tex1DShadow (TEXTURETYPE_1D, GL_DEPTH_COMPONENT16, 256, 1, 1, 1, samplerShadowNoMipmap);
3225 static const TextureSpec tex1DMipmapShadow (TEXTURETYPE_1D, GL_DEPTH_COMPONENT16, 256, 1, 1, 9, samplerShadowMipmap);
3227 static const TextureSpec tex1DTexelFetchFixed (TEXTURETYPE_1D, GL_RGBA8, 256, 1, 1, 9, samplerTexelFetch);
3228 static const TextureSpec tex1DTexelFetchFloat (TEXTURETYPE_1D, GL_RGBA16F, 256, 1, 1, 9, samplerTexelFetch);
3229 static const TextureSpec tex1DTexelFetchInt (TEXTURETYPE_1D, GL_RGBA8I, 256, 1, 1, 9, samplerTexelFetch);
3230 static const TextureSpec tex1DTexelFetchUint (TEXTURETYPE_1D, GL_RGBA8UI, 256, 1, 1, 9, samplerTexelFetch);
3232 static const TextureSpec tex1DArrayFixed (TEXTURETYPE_1D_ARRAY, GL_RGBA8, 256, 1, 4, 1, samplerLinearNoMipmap);
3233 static const TextureSpec tex1DArrayFloat (TEXTURETYPE_1D_ARRAY, GL_RGBA16F, 256, 1, 4, 1, samplerLinearNoMipmap);
3234 static const TextureSpec tex1DArrayInt (TEXTURETYPE_1D_ARRAY, GL_RGBA8I, 256, 1, 4, 1, samplerNearestNoMipmap);
3235 static const TextureSpec tex1DArrayUint (TEXTURETYPE_1D_ARRAY, GL_RGBA8UI, 256, 1, 4, 1, samplerNearestNoMipmap);
3236 static const TextureSpec tex1DArrayMipmapFixed (TEXTURETYPE_1D_ARRAY, GL_RGBA8, 256, 1, 4, 9, samplerLinearMipmap);
3237 static const TextureSpec tex1DArrayMipmapFloat (TEXTURETYPE_1D_ARRAY, GL_RGBA16F, 256, 1, 4, 9, samplerLinearMipmap);
3238 static const TextureSpec tex1DArrayMipmapInt (TEXTURETYPE_1D_ARRAY, GL_RGBA8I, 256, 1, 4, 9, samplerNearestMipmap);
3239 static const TextureSpec tex1DArrayMipmapUint (TEXTURETYPE_1D_ARRAY, GL_RGBA8UI, 256, 1, 4, 9, samplerNearestMipmap);
3241 static const TextureSpec tex1DArrayShadow (TEXTURETYPE_1D_ARRAY, GL_DEPTH_COMPONENT16, 256, 1, 4, 1, samplerShadowNoMipmap);
3242 static const TextureSpec tex1DArrayMipmapShadow (TEXTURETYPE_1D_ARRAY, GL_DEPTH_COMPONENT16, 256, 1, 4, 9, samplerShadowMipmap);
3244 static const TextureSpec tex1DArrayTexelFetchFixed (TEXTURETYPE_1D_ARRAY, GL_RGBA8, 256, 1, 4, 9, samplerTexelFetch);
3245 static const TextureSpec tex1DArrayTexelFetchFloat (TEXTURETYPE_1D_ARRAY, GL_RGBA16F, 256, 1, 4, 9, samplerTexelFetch);
3246 static const TextureSpec tex1DArrayTexelFetchInt (TEXTURETYPE_1D_ARRAY, GL_RGBA8I, 256, 1, 4, 9, samplerTexelFetch);
3247 static const TextureSpec tex1DArrayTexelFetchUint (TEXTURETYPE_1D_ARRAY, GL_RGBA8UI, 256, 1, 4, 9, samplerTexelFetch);
3249 static const TextureSpec texCubeArrayFixed (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8, 64, 64, 12, 1, samplerLinearNoMipmap);
3250 static const TextureSpec texCubeArrayFloat (TEXTURETYPE_CUBE_ARRAY, GL_RGBA16F, 64, 64, 12, 1, samplerLinearNoMipmap);
3251 static const TextureSpec texCubeArrayInt (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8I, 64, 64, 12, 1, samplerNearestNoMipmap);
3252 static const TextureSpec texCubeArrayUint (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8UI, 64, 64, 12, 1, samplerNearestNoMipmap);
3253 static const TextureSpec texCubeArrayMipmapFixed (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8, 64, 64, 12, 7, samplerLinearMipmap);
3254 static const TextureSpec texCubeArrayMipmapFloat (TEXTURETYPE_CUBE_ARRAY, GL_RGBA16F, 64, 64, 12, 7, samplerLinearMipmap);
3255 static const TextureSpec texCubeArrayMipmapInt (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8I, 64, 64, 12, 7, samplerNearestMipmap);
3256 static const TextureSpec texCubeArrayMipmapUint (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8UI, 64, 64, 12, 7, samplerNearestMipmap);
3258 static const TextureSpec texCubeArrayShadow (TEXTURETYPE_CUBE_ARRAY, GL_DEPTH_COMPONENT16, 64, 64, 12, 1, samplerShadowNoMipmap);
3259 static const TextureSpec texCubeArrayMipmapShadow (TEXTURETYPE_CUBE_ARRAY, GL_DEPTH_COMPONENT16, 64, 64, 12, 7, samplerShadowMipmap);
3262 static const TexFuncCaseSpec textureCases[] =
3264 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3265 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DFixed, evalTexture2D, VERTEX),
3266 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2D, FRAGMENT),
3267 CASE_SPEC(sampler2d_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DFloat, evalTexture2D, VERTEX),
3268 CASE_SPEC(sampler2d_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2D, FRAGMENT),
3269 CASE_SPEC(isampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DInt, evalTexture2D, VERTEX),
3270 CASE_SPEC(isampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2D, FRAGMENT),
3271 CASE_SPEC(usampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DUint, evalTexture2D, VERTEX),
3272 CASE_SPEC(usampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2D, FRAGMENT),
3274 CASE_SPEC(sampler2d_bias_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DBias, FRAGMENT),
3275 CASE_SPEC(sampler2d_bias_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DBias, FRAGMENT),
3276 CASE_SPEC(isampler2d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DBias, FRAGMENT),
3277 CASE_SPEC(usampler2d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DBias, FRAGMENT),
3279 CASE_SPEC(samplercube_fixed, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeFixed, evalTextureCube, VERTEX),
3280 CASE_SPEC(samplercube_fixed, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeMipmapFixed, evalTextureCube, FRAGMENT),
3281 CASE_SPEC(samplercube_float, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeFloat, evalTextureCube, VERTEX),
3282 CASE_SPEC(samplercube_float, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeMipmapFloat, evalTextureCube, FRAGMENT),
3283 CASE_SPEC(isamplercube, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeInt, evalTextureCube, VERTEX),
3284 CASE_SPEC(isamplercube, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeMipmapInt, evalTextureCube, FRAGMENT),
3285 CASE_SPEC(usamplercube, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeUint, evalTextureCube, VERTEX),
3286 CASE_SPEC(usamplercube, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeMipmapUint, evalTextureCube, FRAGMENT),
3288 CASE_SPEC(samplercube_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), texCubeMipmapFixed, evalTextureCubeBias, FRAGMENT),
3289 CASE_SPEC(samplercube_bias_float, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), texCubeMipmapFloat, evalTextureCubeBias, FRAGMENT),
3290 CASE_SPEC(isamplercube_bias, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), texCubeMipmapInt, evalTextureCubeBias, FRAGMENT),
3291 CASE_SPEC(usamplercube_bias, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), texCubeMipmapUint, evalTextureCubeBias, FRAGMENT),
3293 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayFixed, evalTexture2DArray, VERTEX),
3294 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayMipmapFixed, evalTexture2DArray, FRAGMENT),
3295 CASE_SPEC(sampler2darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayFloat, evalTexture2DArray, VERTEX),
3296 CASE_SPEC(sampler2darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayMipmapFloat, evalTexture2DArray, FRAGMENT),
3297 CASE_SPEC(isampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayInt, evalTexture2DArray, VERTEX),
3298 CASE_SPEC(isampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayMipmapInt, evalTexture2DArray, FRAGMENT),
3299 CASE_SPEC(usampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayUint, evalTexture2DArray, VERTEX),
3300 CASE_SPEC(usampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayMipmapUint, evalTexture2DArray, FRAGMENT),
3302 CASE_SPEC(sampler2darray_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DArrayMipmapFixed, evalTexture2DArrayBias, FRAGMENT),
3303 CASE_SPEC(sampler2darray_bias_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DArrayMipmapFloat, evalTexture2DArrayBias, FRAGMENT),
3304 CASE_SPEC(isampler2darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DArrayMipmapInt, evalTexture2DArrayBias, FRAGMENT),
3305 CASE_SPEC(usampler2darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DArrayMipmapUint, evalTexture2DArrayBias, FRAGMENT),
3307 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DFixed, evalTexture3D, VERTEX),
3308 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapFixed, evalTexture3D, FRAGMENT),
3309 CASE_SPEC(sampler3d_float, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DFloat, evalTexture3D, VERTEX),
3310 CASE_SPEC(sampler3d_float, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapFloat, evalTexture3D, FRAGMENT),
3311 CASE_SPEC(isampler3d, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DInt, evalTexture3D, VERTEX),
3312 CASE_SPEC(isampler3d, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapInt, evalTexture3D, FRAGMENT),
3313 CASE_SPEC(usampler3d, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DUint, evalTexture3D, VERTEX),
3314 CASE_SPEC(usampler3d, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapUint, evalTexture3D, FRAGMENT),
3316 CASE_SPEC(sampler3d_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 1.0f, false, IVec3(0), tex3DMipmapFixed, evalTexture3DBias, FRAGMENT),
3317 CASE_SPEC(sampler3d_bias_float, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 1.0f, false, IVec3(0), tex3DMipmapFloat, evalTexture3DBias, FRAGMENT),
3318 CASE_SPEC(isampler3d_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex3DMipmapInt, evalTexture3DBias, FRAGMENT),
3319 CASE_SPEC(usampler3d_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex3DMipmapUint, evalTexture3DBias, FRAGMENT),
3321 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DFixed, evalTexture1D, VERTEX),
3322 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1D, FRAGMENT),
3323 CASE_SPEC(sampler1d_float, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DFloat, evalTexture1D, VERTEX),
3324 CASE_SPEC(sampler1d_float, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1D, FRAGMENT),
3325 CASE_SPEC(isampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DInt, evalTexture1D, VERTEX),
3326 CASE_SPEC(isampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1D, FRAGMENT),
3327 CASE_SPEC(usampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DUint, evalTexture1D, VERTEX),
3328 CASE_SPEC(usampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1D, FRAGMENT),
3330 CASE_SPEC(sampler1d_bias_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DBias, FRAGMENT),
3331 CASE_SPEC(sampler1d_bias_float, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DBias, FRAGMENT),
3332 CASE_SPEC(isampler1d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DBias, FRAGMENT),
3333 CASE_SPEC(usampler1d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DBias, FRAGMENT),
3335 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayFixed, evalTexture1DArray, VERTEX),
3336 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayMipmapFixed, evalTexture1DArray, FRAGMENT),
3337 CASE_SPEC(sampler1darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayFloat, evalTexture1DArray, VERTEX),
3338 CASE_SPEC(sampler1darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayMipmapFloat, evalTexture1DArray, FRAGMENT),
3339 CASE_SPEC(isampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayInt, evalTexture1DArray, VERTEX),
3340 CASE_SPEC(isampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayMipmapInt, evalTexture1DArray, FRAGMENT),
3341 CASE_SPEC(usampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayUint, evalTexture1DArray, VERTEX),
3342 CASE_SPEC(usampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayMipmapUint, evalTexture1DArray, FRAGMENT),
3344 CASE_SPEC(sampler1darray_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DArrayMipmapFixed, evalTexture1DArrayBias, FRAGMENT),
3345 CASE_SPEC(sampler1darray_bias_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DArrayMipmapFloat, evalTexture1DArrayBias, FRAGMENT),
3346 CASE_SPEC(isampler1darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DArrayMipmapInt, evalTexture1DArrayBias, FRAGMENT),
3347 CASE_SPEC(usampler1darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DArrayMipmapUint, evalTexture1DArrayBias, FRAGMENT),
3349 CASE_SPEC(samplercubearray_fixed, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayFixed, evalTextureCubeArray, VERTEX),
3350 CASE_SPEC(samplercubearray_fixed, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayMipmapFixed, evalTextureCubeArray, FRAGMENT),
3351 CASE_SPEC(samplercubearray_float, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayFloat, evalTextureCubeArray, VERTEX),
3352 CASE_SPEC(samplercubearray_float, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayMipmapFloat, evalTextureCubeArray, FRAGMENT),
3353 CASE_SPEC(isamplercubearray, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayInt, evalTextureCubeArray, VERTEX),
3354 CASE_SPEC(isamplercubearray, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayMipmapInt, evalTextureCubeArray, FRAGMENT),
3355 CASE_SPEC(usamplercubearray, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayUint, evalTextureCubeArray, VERTEX),
3356 CASE_SPEC(usamplercubearray, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayMipmapUint, evalTextureCubeArray, FRAGMENT),
3358 CASE_SPEC(samplercubearray_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), texCubeArrayMipmapFixed, evalTextureCubeArrayBias, FRAGMENT),
3359 CASE_SPEC(samplercubearray_bias_float, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), texCubeArrayMipmapFloat, evalTextureCubeArrayBias, FRAGMENT),
3360 CASE_SPEC(isamplercubearray_bias, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), texCubeArrayMipmapInt, evalTextureCubeArrayBias, FRAGMENT),
3361 CASE_SPEC(usamplercubearray_bias, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), texCubeArrayMipmapUint, evalTextureCubeArrayBias, FRAGMENT),
3363 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DShadow, evalTexture2DShadow, VERTEX),
3364 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadow, FRAGMENT),
3365 CASE_SPEC(sampler2dshadow_bias, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowBias, FRAGMENT),
3367 CASE_SPEC(samplercubeshadow, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 1.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeShadow, evalTextureCubeShadow, VERTEX),
3368 CASE_SPEC(samplercubeshadow, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 1.0f), false, 0.0f, 0.0f, false, IVec3(0), texCubeMipmapShadow, evalTextureCubeShadow, FRAGMENT),
3369 CASE_SPEC(samplercubeshadow_bias, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 1.0f), true, -2.0f, 2.0f, false, IVec3(0), texCubeMipmapShadow, evalTextureCubeShadowBias, FRAGMENT),
3371 CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayShadow, evalTexture2DArrayShadow, VERTEX),
3372 CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayMipmapShadow, evalTexture2DArrayShadow, FRAGMENT),
3374 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DShadow, evalTexture1DShadow, VERTEX),
3375 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadow, FRAGMENT),
3376 CASE_SPEC(sampler1dshadow_bias, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowBias, FRAGMENT),
3378 CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayShadow, evalTexture1DArrayShadow, VERTEX),
3379 CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayMipmapShadow, evalTexture1DArrayShadow, FRAGMENT),
3380 CASE_SPEC(sampler1darrayshadow_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowBias, FRAGMENT),
3382 CASE_SPEC(samplercubearrayshadow, FUNCTION_TEXTURE, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), texCubeArrayMipmapShadow, evalTextureCubeArrayShadow, FRAGMENT),
3384 createCaseGroup(this, "texture", "texture() Tests", textureCases, DE_LENGTH_OF_ARRAY(textureCases));
3386 // textureOffset() cases
3387 // \note _bias variants are not using mipmap thanks to wide allowed range for LOD computation
3388 static const TexFuncCaseSpec textureOffsetCases[] =
3390 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3391 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DFixed, evalTexture2DOffset, VERTEX),
3392 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapFixed, evalTexture2DOffset, FRAGMENT),
3393 CASE_SPEC(sampler2d_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DFloat, evalTexture2DOffset, VERTEX),
3394 CASE_SPEC(sampler2d_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DOffset, FRAGMENT),
3395 CASE_SPEC(isampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DInt, evalTexture2DOffset, VERTEX),
3396 CASE_SPEC(isampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapInt, evalTexture2DOffset, FRAGMENT),
3397 CASE_SPEC(usampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DUint, evalTexture2DOffset, VERTEX),
3398 CASE_SPEC(usampler2d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DOffset, FRAGMENT),
3400 CASE_SPEC(sampler2d_bias_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DFixed, evalTexture2DOffsetBias, FRAGMENT),
3401 CASE_SPEC(sampler2d_bias_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DFloat, evalTexture2DOffsetBias, FRAGMENT),
3402 CASE_SPEC(isampler2d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DInt, evalTexture2DOffsetBias, FRAGMENT),
3403 CASE_SPEC(usampler2d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DUint, evalTexture2DOffsetBias, FRAGMENT),
3405 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DArrayFixed, evalTexture2DArrayOffset, VERTEX),
3406 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DArrayMipmapFixed, evalTexture2DArrayOffset, FRAGMENT),
3407 CASE_SPEC(sampler2darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DArrayFloat, evalTexture2DArrayOffset, VERTEX),
3408 CASE_SPEC(sampler2darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DArrayMipmapFloat, evalTexture2DArrayOffset, FRAGMENT),
3409 CASE_SPEC(isampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DArrayInt, evalTexture2DArrayOffset, VERTEX),
3410 CASE_SPEC(isampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DArrayMipmapInt, evalTexture2DArrayOffset, FRAGMENT),
3411 CASE_SPEC(usampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DArrayUint, evalTexture2DArrayOffset, VERTEX),
3412 CASE_SPEC(usampler2darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DArrayMipmapUint, evalTexture2DArrayOffset, FRAGMENT),
3414 CASE_SPEC(sampler2darray_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DArrayFixed, evalTexture2DArrayOffsetBias, FRAGMENT),
3415 CASE_SPEC(sampler2darray_bias_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DArrayFloat, evalTexture2DArrayOffsetBias, FRAGMENT),
3416 CASE_SPEC(isampler2darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DArrayInt, evalTexture2DArrayOffsetBias, FRAGMENT),
3417 CASE_SPEC(usampler2darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DArrayUint, evalTexture2DArrayOffsetBias, FRAGMENT),
3419 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DFixed, evalTexture3DOffset, VERTEX),
3420 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, 3, -8), tex3DMipmapFixed, evalTexture3DOffset, FRAGMENT),
3421 CASE_SPEC(sampler3d_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(3, -8, 7), tex3DFloat, evalTexture3DOffset, VERTEX),
3422 CASE_SPEC(sampler3d_float, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DMipmapFloat, evalTexture3DOffset, FRAGMENT),
3423 CASE_SPEC(isampler3d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, 3, -8), tex3DInt, evalTexture3DOffset, VERTEX),
3424 CASE_SPEC(isampler3d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(3, -8, 7), tex3DMipmapInt, evalTexture3DOffset, FRAGMENT),
3425 CASE_SPEC(usampler3d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DUint, evalTexture3DOffset, VERTEX),
3426 CASE_SPEC(usampler3d, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, 3, -8), tex3DMipmapUint, evalTexture3DOffset, FRAGMENT),
3428 CASE_SPEC(sampler3d_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 1.0f, true, IVec3(-8, 7, 3), tex3DFixed, evalTexture3DOffsetBias, FRAGMENT),
3429 CASE_SPEC(sampler3d_bias_float, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 1.0f, true, IVec3(7, 3, -8), tex3DFloat, evalTexture3DOffsetBias, FRAGMENT),
3430 CASE_SPEC(isampler3d_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 2.0f, true, IVec3(3, -8, 7), tex3DInt, evalTexture3DOffsetBias, FRAGMENT),
3431 CASE_SPEC(usampler3d_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 3), tex3DUint, evalTexture3DOffsetBias, FRAGMENT),
3433 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DFixed, evalTexture1DOffset, VERTEX),
3434 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DMipmapFixed, evalTexture1DOffset, FRAGMENT),
3435 CASE_SPEC(sampler1d_float, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DFloat, evalTexture1DOffset, VERTEX),
3436 CASE_SPEC(sampler1d_float, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DMipmapFloat, evalTexture1DOffset, FRAGMENT),
3437 CASE_SPEC(isampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DInt, evalTexture1DOffset, VERTEX),
3438 CASE_SPEC(isampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DMipmapInt, evalTexture1DOffset, FRAGMENT),
3439 CASE_SPEC(usampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DUint, evalTexture1DOffset, VERTEX),
3440 CASE_SPEC(usampler1d, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DMipmapUint, evalTexture1DOffset, FRAGMENT),
3442 CASE_SPEC(sampler1d_bias_fixed, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DFixed, evalTexture1DOffsetBias, FRAGMENT),
3443 CASE_SPEC(sampler1d_bias_float, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3( 7, 0, 0), tex1DFloat, evalTexture1DOffsetBias, FRAGMENT),
3444 CASE_SPEC(isampler1d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DInt, evalTexture1DOffsetBias, FRAGMENT),
3445 CASE_SPEC(usampler1d_bias, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3( 7, 0, 0), tex1DUint, evalTexture1DOffsetBias, FRAGMENT),
3447 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DArrayFixed, evalTexture1DArrayOffset, VERTEX),
3448 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DArrayMipmapFixed, evalTexture1DArrayOffset, FRAGMENT),
3449 CASE_SPEC(sampler1darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DArrayFloat, evalTexture1DArrayOffset, VERTEX),
3450 CASE_SPEC(sampler1darray_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DArrayMipmapFloat, evalTexture1DArrayOffset, FRAGMENT),
3451 CASE_SPEC(isampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DArrayInt, evalTexture1DArrayOffset, VERTEX),
3452 CASE_SPEC(isampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DArrayMipmapInt, evalTexture1DArrayOffset, FRAGMENT),
3453 CASE_SPEC(usampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DArrayUint, evalTexture1DArrayOffset, VERTEX),
3454 CASE_SPEC(usampler1darray, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DArrayMipmapUint, evalTexture1DArrayOffset, FRAGMENT),
3456 CASE_SPEC(sampler1darray_bias_fixed, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DArrayFixed, evalTexture1DArrayOffsetBias, FRAGMENT),
3457 CASE_SPEC(sampler1darray_bias_float, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3( 7, 0, 0), tex1DArrayFloat, evalTexture1DArrayOffsetBias, FRAGMENT),
3458 CASE_SPEC(isampler1darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DArrayInt, evalTexture1DArrayOffsetBias, FRAGMENT),
3459 CASE_SPEC(usampler1darray_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3( 7, 0, 0), tex1DArrayUint, evalTexture1DArrayOffsetBias, FRAGMENT),
3461 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DShadow, evalTexture2DShadowOffset, VERTEX),
3462 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapShadow, evalTexture2DShadowOffset, FRAGMENT),
3463 CASE_SPEC(sampler2dshadow_bias, FUNCTION_TEXTURE, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DShadow, evalTexture2DShadowOffsetBias, FRAGMENT),
3464 CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DArrayShadow, evalTexture2DArrayShadowOffset, VERTEX),
3465 CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DArrayMipmapShadow, evalTexture2DArrayShadowOffset, FRAGMENT),
3466 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DShadow, evalTexture1DShadowOffset, VERTEX),
3467 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DMipmapShadow, evalTexture1DShadowOffset, FRAGMENT),
3468 CASE_SPEC(sampler1dshadow_bias, FUNCTION_TEXTURE, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DShadow, evalTexture1DShadowOffsetBias, FRAGMENT),
3469 CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DArrayShadow, evalTexture1DArrayShadowOffset, VERTEX),
3470 CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3( 7, 0, 0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowOffset, FRAGMENT),
3471 CASE_SPEC(sampler1darrayshadow_bias, FUNCTION_TEXTURE, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DArrayShadow, evalTexture1DArrayShadowOffsetBias, FRAGMENT),
3473 createCaseGroup(this, "textureoffset", "textureOffset() Tests", textureOffsetCases, DE_LENGTH_OF_ARRAY(textureOffsetCases));
3475 // textureProj() cases
3476 // \note Currently uses constant divider!
3477 static const TexFuncCaseSpec textureProjCases[] =
3479 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3480 CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DFixed, evalTexture2DProj3, VERTEX),
3481 CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DProj3, FRAGMENT),
3482 CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DFloat, evalTexture2DProj3, VERTEX),
3483 CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DProj3, FRAGMENT),
3484 CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DInt, evalTexture2DProj3, VERTEX),
3485 CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DProj3, FRAGMENT),
3486 CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DUint, evalTexture2DProj3, VERTEX),
3487 CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DProj3, FRAGMENT),
3489 CASE_SPEC(sampler2d_vec3_bias_fixed, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DProj3Bias, FRAGMENT),
3490 CASE_SPEC(sampler2d_vec3_bias_float, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DProj3Bias, FRAGMENT),
3491 CASE_SPEC(isampler2d_vec3_bias, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DProj3Bias, FRAGMENT),
3492 CASE_SPEC(usampler2d_vec3_bias, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DProj3Bias, FRAGMENT),
3494 CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DFixed, evalTexture2DProj, VERTEX),
3495 CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DProj, FRAGMENT),
3496 CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DFloat, evalTexture2DProj, VERTEX),
3497 CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DProj, FRAGMENT),
3498 CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DInt, evalTexture2DProj, VERTEX),
3499 CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DProj, FRAGMENT),
3500 CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DUint, evalTexture2DProj, VERTEX),
3501 CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DProj, FRAGMENT),
3503 CASE_SPEC(sampler2d_vec4_bias_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DProjBias, FRAGMENT),
3504 CASE_SPEC(sampler2d_vec4_bias_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DProjBias, FRAGMENT),
3505 CASE_SPEC(isampler2d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DProjBias, FRAGMENT),
3506 CASE_SPEC(usampler2d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DProjBias, FRAGMENT),
3508 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DFixed, evalTexture3DProj, VERTEX),
3509 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapFixed, evalTexture3DProj, FRAGMENT),
3510 CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DFloat, evalTexture3DProj, VERTEX),
3511 CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapFloat, evalTexture3DProj, FRAGMENT),
3512 CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DInt, evalTexture3DProj, VERTEX),
3513 CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapInt, evalTexture3DProj, FRAGMENT),
3514 CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DUint, evalTexture3DProj, VERTEX),
3515 CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, 0.0f, 0.0f, false, IVec3(0), tex3DMipmapUint, evalTexture3DProj, FRAGMENT),
3517 CASE_SPEC(sampler3d_bias_fixed, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 1.0f, false, IVec3(0), tex3DMipmapFixed, evalTexture3DProjBias, FRAGMENT),
3518 CASE_SPEC(sampler3d_bias_float, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 1.0f, false, IVec3(0), tex3DMipmapFloat, evalTexture3DProjBias, FRAGMENT),
3519 CASE_SPEC(isampler3d_bias, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 2.0f, false, IVec3(0), tex3DMipmapInt, evalTexture3DProjBias, FRAGMENT),
3520 CASE_SPEC(usampler3d_bias, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 2.0f, false, IVec3(0), tex3DMipmapUint, evalTexture3DProjBias, FRAGMENT),
3522 CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DFixed, evalTexture1DProj2, VERTEX),
3523 CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DProj2, FRAGMENT),
3524 CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DFloat, evalTexture1DProj2, VERTEX),
3525 CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DProj2, FRAGMENT),
3526 CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DInt, evalTexture1DProj2, VERTEX),
3527 CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DProj2, FRAGMENT),
3528 CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DUint, evalTexture1DProj2, VERTEX),
3529 CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DProj2, FRAGMENT),
3531 CASE_SPEC(sampler1d_vec2_bias_fixed, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DProj2Bias, FRAGMENT),
3532 CASE_SPEC(sampler1d_vec2_bias_float, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DProj2Bias, FRAGMENT),
3533 CASE_SPEC(isampler1d_vec2_bias, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DProj2Bias, FRAGMENT),
3534 CASE_SPEC(usampler1d_vec2_bias, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DProj2Bias, FRAGMENT),
3536 CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DFixed, evalTexture1DProj, VERTEX),
3537 CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DProj, FRAGMENT),
3538 CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DFloat, evalTexture1DProj, VERTEX),
3539 CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DProj, FRAGMENT),
3540 CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DInt, evalTexture1DProj, VERTEX),
3541 CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DProj, FRAGMENT),
3542 CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DUint, evalTexture1DProj, VERTEX),
3543 CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DProj, FRAGMENT),
3545 CASE_SPEC(sampler1d_vec4_bias_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DProjBias, FRAGMENT),
3546 CASE_SPEC(sampler1d_vec4_bias_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DProjBias, FRAGMENT),
3547 CASE_SPEC(isampler1d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DProjBias, FRAGMENT),
3548 CASE_SPEC(usampler1d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DProjBias, FRAGMENT),
3550 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DShadow, evalTexture2DShadowProj, VERTEX),
3551 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowProj, FRAGMENT),
3552 CASE_SPEC(sampler2dshadow_bias, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowProjBias, FRAGMENT),
3553 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 1.5f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DShadow, evalTexture1DShadowProj, VERTEX),
3554 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 1.5f, 1.5f), false, 0.0f, 0.0f, false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowProj, FRAGMENT),
3555 CASE_SPEC(sampler1dshadow_bias, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 1.5f, 1.5f), true, -2.0f, 2.0f, false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowProjBias, FRAGMENT),
3557 createCaseGroup(this, "textureproj", "textureProj() Tests", textureProjCases, DE_LENGTH_OF_ARRAY(textureProjCases));
3559 // textureProjOffset() cases
3560 // \note Currently uses constant divider!
3561 static const TexFuncCaseSpec textureProjOffsetCases[] =
3563 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3564 CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DFixed, evalTexture2DProj3Offset, VERTEX),
3565 CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapFixed, evalTexture2DProj3Offset, FRAGMENT),
3566 CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DFloat, evalTexture2DProj3Offset, VERTEX),
3567 CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DProj3Offset, FRAGMENT),
3568 CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DInt, evalTexture2DProj3Offset, VERTEX),
3569 CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapInt, evalTexture2DProj3Offset, FRAGMENT),
3570 CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DUint, evalTexture2DProj3Offset, VERTEX),
3571 CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DProj3Offset, FRAGMENT),
3573 CASE_SPEC(sampler2d_vec3_bias_fixed, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DFixed, evalTexture2DProj3OffsetBias, FRAGMENT),
3574 CASE_SPEC(sampler2d_vec3_bias_float, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DFloat, evalTexture2DProj3OffsetBias, FRAGMENT),
3575 CASE_SPEC(isampler2d_vec3_bias, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DInt, evalTexture2DProj3OffsetBias, FRAGMENT),
3576 CASE_SPEC(usampler2d_vec3_bias, FUNCTION_TEXTUREPROJ3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DUint, evalTexture2DProj3OffsetBias, FRAGMENT),
3578 CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DFixed, evalTexture2DProjOffset, VERTEX),
3579 CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapFixed, evalTexture2DProjOffset, FRAGMENT),
3580 CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DFloat, evalTexture2DProjOffset, VERTEX),
3581 CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DProjOffset, FRAGMENT),
3582 CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DInt, evalTexture2DProjOffset, VERTEX),
3583 CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapInt, evalTexture2DProjOffset, FRAGMENT),
3584 CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DUint, evalTexture2DProjOffset, VERTEX),
3585 CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DProjOffset, FRAGMENT),
3587 CASE_SPEC(sampler2d_vec4_bias_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DFixed, evalTexture2DProjOffsetBias, FRAGMENT),
3588 CASE_SPEC(sampler2d_vec4_bias_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DFloat, evalTexture2DProjOffsetBias, FRAGMENT),
3589 CASE_SPEC(isampler2d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DInt, evalTexture2DProjOffsetBias, FRAGMENT),
3590 CASE_SPEC(usampler2d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(7, -8, 0), tex2DUint, evalTexture2DProjOffsetBias, FRAGMENT),
3592 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DFixed, evalTexture3DProjOffset, VERTEX),
3593 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 3, -8), tex3DMipmapFixed, evalTexture3DProjOffset, FRAGMENT),
3594 CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(3, -8, 7), tex3DFloat, evalTexture3DProjOffset, VERTEX),
3595 CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DMipmapFloat, evalTexture3DProjOffset, FRAGMENT),
3596 CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 3, -8), tex3DInt, evalTexture3DProjOffset, VERTEX),
3597 CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(3, -8, 7), tex3DMipmapInt, evalTexture3DProjOffset, FRAGMENT),
3598 CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DUint, evalTexture3DProjOffset, VERTEX),
3599 CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 2.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 3, -8), tex3DMipmapUint, evalTexture3DProjOffset, FRAGMENT),
3601 CASE_SPEC(sampler3d_bias_fixed, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 3), tex3DFixed, evalTexture3DProjOffsetBias, FRAGMENT),
3602 CASE_SPEC(sampler3d_bias_float, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 2.0f, true, IVec3(7, 3, -8), tex3DFloat, evalTexture3DProjOffsetBias, FRAGMENT),
3603 CASE_SPEC(isampler3d_bias, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 2.0f, true, IVec3(3, -8, 7), tex3DInt, evalTexture3DProjOffsetBias, FRAGMENT),
3604 CASE_SPEC(usampler3d_bias, FUNCTION_TEXTUREPROJ, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 3), tex3DUint, evalTexture3DProjOffsetBias, FRAGMENT),
3606 CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DFixed, evalTexture1DProj2Offset, VERTEX),
3607 CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapFixed, evalTexture1DProj2Offset, FRAGMENT),
3608 CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DFloat, evalTexture1DProj2Offset, VERTEX),
3609 CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapFloat, evalTexture1DProj2Offset, FRAGMENT),
3610 CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DInt, evalTexture1DProj2Offset, VERTEX),
3611 CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapInt, evalTexture1DProj2Offset, FRAGMENT),
3612 CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DUint, evalTexture1DProj2Offset, VERTEX),
3613 CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapUint, evalTexture1DProj2Offset, FRAGMENT),
3615 CASE_SPEC(sampler1d_vec2_bias_fixed, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DFixed, evalTexture1DProj2OffsetBias, FRAGMENT),
3616 CASE_SPEC(sampler1d_vec2_bias_float, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, 0, 0), tex1DFloat, evalTexture1DProj2OffsetBias, FRAGMENT),
3617 CASE_SPEC(isampler1d_vec2_bias, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DInt, evalTexture1DProj2OffsetBias, FRAGMENT),
3618 CASE_SPEC(usampler1d_vec2_bias, FUNCTION_TEXTUREPROJ2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), true, -2.0f, 2.0f, true, IVec3(7, 0, 0), tex1DUint, evalTexture1DProj2OffsetBias, FRAGMENT),
3620 CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DFixed, evalTexture1DProjOffset, VERTEX),
3621 CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapFixed, evalTexture1DProjOffset, FRAGMENT),
3622 CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DFloat, evalTexture1DProjOffset, VERTEX),
3623 CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapFloat, evalTexture1DProjOffset, FRAGMENT),
3624 CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DInt, evalTexture1DProjOffset, VERTEX),
3625 CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapInt, evalTexture1DProjOffset, FRAGMENT),
3626 CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DUint, evalTexture1DProjOffset, VERTEX),
3627 CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapUint, evalTexture1DProjOffset, FRAGMENT),
3629 CASE_SPEC(sampler1d_vec4_bias_fixed, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DFixed, evalTexture1DProjOffsetBias, FRAGMENT),
3630 CASE_SPEC(sampler1d_vec4_bias_float, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(7, 0, 0), tex1DFloat, evalTexture1DProjOffsetBias, FRAGMENT),
3631 CASE_SPEC(isampler1d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DInt, evalTexture1DProjOffsetBias, FRAGMENT),
3632 CASE_SPEC(usampler1d_vec4_bias, FUNCTION_TEXTUREPROJ, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), true, -2.0f, 2.0f, true, IVec3(7, 0, 0), tex1DUint, evalTexture1DProjOffsetBias, FRAGMENT),
3634 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DShadow, evalTexture2DShadowProjOffset, VERTEX),
3635 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, -8, 0), tex2DMipmapShadow, evalTexture2DShadowProjOffset, FRAGMENT),
3636 CASE_SPEC(sampler2dshadow_bias, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), true, -2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DShadow, evalTexture2DShadowProjOffsetBias, FRAGMENT),
3637 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 1.5f, 1.5f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DShadow, evalTexture1DShadowProjOffset, VERTEX),
3638 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 1.5f, 1.5f), false, 0.0f, 0.0f, true, IVec3(7, 0, 0), tex1DMipmapShadow, evalTexture1DShadowProjOffset, FRAGMENT),
3639 CASE_SPEC(sampler1dshadow_bias, FUNCTION_TEXTUREPROJ, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 1.5f, 1.5f), true, -2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DShadow, evalTexture1DShadowProjOffsetBias, FRAGMENT),
3641 createCaseGroup(this, "textureprojoffset", "textureOffsetProj() Tests", textureProjOffsetCases, DE_LENGTH_OF_ARRAY(textureProjOffsetCases));
3643 // textureLod() cases
3644 static const TexFuncCaseSpec textureLodCases[] =
3646 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3647 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DLod, BOTH),
3648 CASE_SPEC(sampler2d_float, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DLod, BOTH),
3649 CASE_SPEC(isampler2d, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DLod, BOTH),
3650 CASE_SPEC(usampler2d, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DLod, BOTH),
3652 CASE_SPEC(samplercube_fixed, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), texCubeMipmapFixed, evalTextureCubeLod, BOTH),
3653 CASE_SPEC(samplercube_float, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), texCubeMipmapFloat, evalTextureCubeLod, BOTH),
3654 CASE_SPEC(isamplercube, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), texCubeMipmapInt, evalTextureCubeLod, BOTH),
3655 CASE_SPEC(usamplercube, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), texCubeMipmapUint, evalTextureCubeLod, BOTH),
3657 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, false, IVec3(0), tex2DArrayMipmapFixed, evalTexture2DArrayLod, BOTH),
3658 CASE_SPEC(sampler2darray_float, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, false, IVec3(0), tex2DArrayMipmapFloat, evalTexture2DArrayLod, BOTH),
3659 CASE_SPEC(isampler2darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, false, IVec3(0), tex2DArrayMipmapInt, evalTexture2DArrayLod, BOTH),
3660 CASE_SPEC(usampler2darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, false, IVec3(0), tex2DArrayMipmapUint, evalTexture2DArrayLod, BOTH),
3662 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapFixed, evalTexture3DLod, BOTH),
3663 CASE_SPEC(sampler3d_float, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapFloat, evalTexture3DLod, BOTH),
3664 CASE_SPEC(isampler3d, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapInt, evalTexture3DLod, BOTH),
3665 CASE_SPEC(usampler3d, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapUint, evalTexture3DLod, BOTH),
3667 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DLod, BOTH),
3668 CASE_SPEC(sampler1d_float, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DLod, BOTH),
3669 CASE_SPEC(isampler1d, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DLod, BOTH),
3670 CASE_SPEC(usampler1d, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DLod, BOTH),
3672 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DArrayMipmapFixed, evalTexture1DArrayLod, BOTH),
3673 CASE_SPEC(sampler1darray_float, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DArrayMipmapFloat, evalTexture1DArrayLod, BOTH),
3674 CASE_SPEC(isampler1darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DArrayMipmapInt, evalTexture1DArrayLod, BOTH),
3675 CASE_SPEC(usampler1darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DArrayMipmapUint, evalTexture1DArrayLod, BOTH),
3677 CASE_SPEC(samplercubearray_fixed, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), false, -1.0f, 7.0f, false, IVec3(0), texCubeArrayMipmapFixed, evalTextureCubeArrayLod, BOTH),
3678 CASE_SPEC(samplercubearray_float, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), false, -1.0f, 7.0f, false, IVec3(0), texCubeArrayMipmapFloat, evalTextureCubeArrayLod, BOTH),
3679 CASE_SPEC(isamplercubearray, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), false, -1.0f, 7.0f, false, IVec3(0), texCubeArrayMipmapInt, evalTextureCubeArrayLod, BOTH),
3680 CASE_SPEC(usamplercubearray, FUNCTION_TEXTURELOD, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), false, -1.0f, 7.0f, false, IVec3(0), texCubeArrayMipmapUint, evalTextureCubeArrayLod, BOTH),
3682 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowLod, BOTH),
3683 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowLod, BOTH),
3684 CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowLod, BOTH),
3686 createCaseGroup(this, "texturelod", "textureLod() Tests", textureLodCases, DE_LENGTH_OF_ARRAY(textureLodCases));
3688 // textureLodOffset() cases
3689 static const TexFuncCaseSpec textureLodOffsetCases[] =
3691 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3692 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapFixed, evalTexture2DLodOffset, BOTH),
3693 CASE_SPEC(sampler2d_float, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DLodOffset, BOTH),
3694 CASE_SPEC(isampler2d, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapInt, evalTexture2DLodOffset, BOTH),
3695 CASE_SPEC(usampler2d, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DLodOffset, BOTH),
3697 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, true, IVec3(-8, 7, 0), tex2DArrayMipmapFixed, evalTexture2DArrayLodOffset, BOTH),
3698 CASE_SPEC(sampler2darray_float, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, true, IVec3(7, -8, 0), tex2DArrayMipmapFloat, evalTexture2DArrayLodOffset, BOTH),
3699 CASE_SPEC(isampler2darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, true, IVec3(-8, 7, 0), tex2DArrayMipmapInt, evalTexture2DArrayLodOffset, BOTH),
3700 CASE_SPEC(usampler2darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), false, -1.0f, 8.0f, true, IVec3(7, -8, 0), tex2DArrayMipmapUint, evalTexture2DArrayLodOffset, BOTH),
3702 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, true, IVec3(-8, 7, 3), tex3DMipmapFixed, evalTexture3DLodOffset, BOTH),
3703 CASE_SPEC(sampler3d_float, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, true, IVec3(7, 3, -8), tex3DMipmapFloat, evalTexture3DLodOffset, BOTH),
3704 CASE_SPEC(isampler3d, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, true, IVec3(3, -8, 7), tex3DMipmapInt, evalTexture3DLodOffset, BOTH),
3705 CASE_SPEC(usampler3d, FUNCTION_TEXTURELOD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), false, -1.0f, 7.0f, true, IVec3(-8, 7, 3), tex3DMipmapUint, evalTexture3DLodOffset, BOTH),
3707 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DMipmapFixed, evalTexture1DLodOffset, BOTH),
3708 CASE_SPEC(sampler1d_float, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DMipmapFloat, evalTexture1DLodOffset, BOTH),
3709 CASE_SPEC(isampler1d, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DMipmapInt, evalTexture1DLodOffset, BOTH),
3710 CASE_SPEC(usampler1d, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DMipmapUint, evalTexture1DLodOffset, BOTH),
3712 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DArrayMipmapFixed, evalTexture1DArrayLodOffset, BOTH),
3713 CASE_SPEC(sampler1darray_float, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DArrayMipmapFloat, evalTexture1DArrayLodOffset, BOTH),
3714 CASE_SPEC(isampler1darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DArrayMipmapInt, evalTexture1DArrayLodOffset, BOTH),
3715 CASE_SPEC(usampler1darray, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DArrayMipmapUint, evalTexture1DArrayLodOffset, BOTH),
3717 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTURELOD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapShadow, evalTexture2DShadowLodOffset, BOTH),
3718 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTURELOD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DMipmapShadow, evalTexture1DShadowLodOffset, BOTH),
3719 CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTURELOD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowLodOffset, BOTH),
3721 createCaseGroup(this, "texturelodoffset", "textureLodOffset() Tests", textureLodOffsetCases, DE_LENGTH_OF_ARRAY(textureLodOffsetCases));
3723 // textureProjLod() cases
3724 static const TexFuncCaseSpec textureProjLodCases[] =
3726 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3727 CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DProjLod3, BOTH),
3728 CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DProjLod3, BOTH),
3729 CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DProjLod3, BOTH),
3730 CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DProjLod3, BOTH),
3732 CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapFixed, evalTexture2DProjLod, BOTH),
3733 CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapFloat, evalTexture2DProjLod, BOTH),
3734 CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapInt, evalTexture2DProjLod, BOTH),
3735 CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapUint, evalTexture2DProjLod, BOTH),
3737 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapFixed, evalTexture3DProjLod, BOTH),
3738 CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapFloat, evalTexture3DProjLod, BOTH),
3739 CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapInt, evalTexture3DProjLod, BOTH),
3740 CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, false, IVec3(0), tex3DMipmapUint, evalTexture3DProjLod, BOTH),
3742 CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DProjLod2, BOTH),
3743 CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DProjLod2, BOTH),
3744 CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DProjLod2, BOTH),
3745 CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DProjLod2, BOTH),
3747 CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapFixed, evalTexture1DProjLod, BOTH),
3748 CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapFloat, evalTexture1DProjLod, BOTH),
3749 CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapInt, evalTexture1DProjLod, BOTH),
3750 CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapUint, evalTexture1DProjLod, BOTH),
3752 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJLOD, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowProjLod, BOTH),
3753 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJLOD, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowProjLod, BOTH),
3755 createCaseGroup(this, "textureprojlod", "textureProjLod() Tests", textureProjLodCases, DE_LENGTH_OF_ARRAY(textureProjLodCases));
3757 // textureProjLodOffset() cases
3758 static const TexFuncCaseSpec textureProjLodOffsetCases[] =
3760 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3761 CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapFixed, evalTexture2DProjLod3Offset, BOTH),
3762 CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DProjLod3Offset, BOTH),
3763 CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapInt, evalTexture2DProjLod3Offset, BOTH),
3764 CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJLOD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DProjLod3Offset, BOTH),
3766 CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapFixed, evalTexture2DProjLodOffset, BOTH),
3767 CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DProjLodOffset, BOTH),
3768 CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapInt, evalTexture2DProjLodOffset, BOTH),
3769 CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DProjLodOffset, BOTH),
3771 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, true, IVec3(-8, 7, 3), tex3DMipmapFixed, evalTexture3DProjLodOffset, BOTH),
3772 CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, true, IVec3(7, 3, -8), tex3DMipmapFloat, evalTexture3DProjLodOffset, BOTH),
3773 CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, true, IVec3(3, -8, 7), tex3DMipmapInt, evalTexture3DProjLodOffset, BOTH),
3774 CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJLOD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), false, -1.0f, 7.0f, true, IVec3(-8, 7, 3), tex3DMipmapUint, evalTexture3DProjLodOffset, BOTH),
3776 CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DMipmapFixed, evalTexture1DProjLod2Offset, BOTH),
3777 CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DMipmapFloat, evalTexture1DProjLod2Offset, BOTH),
3778 CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DMipmapInt, evalTexture1DProjLod2Offset, BOTH),
3779 CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJLOD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DMipmapUint, evalTexture1DProjLod2Offset, BOTH),
3781 CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DMipmapFixed, evalTexture1DProjLodOffset, BOTH),
3782 CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DMipmapFloat, evalTexture1DProjLodOffset, BOTH),
3783 CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(-8, 0, 0), tex1DMipmapInt, evalTexture1DProjLodOffset, BOTH),
3784 CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJLOD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DMipmapUint, evalTexture1DProjLodOffset, BOTH),
3786 CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJLOD, Vec4( 0.2f, 0.6f, 0.0f, 1.5f), Vec4(-2.25f, -3.45f, 1.5f, 1.5f), false, -1.0f, 9.0f, true, IVec3(-8, 7, 0), tex2DMipmapShadow, evalTexture2DShadowProjLodOffset, BOTH),
3787 CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJLOD, Vec4( 0.2f, 0.0f, 0.0f, 1.5f), Vec4(-2.25f, 0.0f, 1.5f, 1.5f), false, -1.0f, 9.0f, true, IVec3(7, 0, 0), tex1DMipmapShadow, evalTexture1DShadowProjLodOffset, BOTH),
3789 createCaseGroup(this, "textureprojlodoffset", "textureProjLodOffset() Tests", textureProjLodOffsetCases, DE_LENGTH_OF_ARRAY(textureProjLodOffsetCases));
3791 // textureGrad() cases
3792 // \note Only one of dudx, dudy, dvdx, dvdy is non-zero since spec allows approximating p from derivates by various methods.
3793 static const TexFuncCaseSpec textureGradCases[] =
3795 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
3796 GRAD_CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapFixed, evalTexture2DGrad, BOTH),
3797 GRAD_CASE_SPEC(sampler2d_float, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapFloat, evalTexture2DGrad, BOTH),
3798 GRAD_CASE_SPEC(isampler2d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapInt, evalTexture2DGrad, BOTH),
3799 GRAD_CASE_SPEC(usampler2d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), tex2DMipmapUint, evalTexture2DGrad, BOTH),
3801 GRAD_CASE_SPEC(samplercube_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), texCubeMipmapFixed, evalTextureCubeGrad, BOTH),
3802 GRAD_CASE_SPEC(samplercube_float, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), texCubeMipmapFloat, evalTextureCubeGrad, BOTH),
3803 GRAD_CASE_SPEC(isamplercube, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), texCubeMipmapInt, evalTextureCubeGrad, BOTH),
3804 GRAD_CASE_SPEC(usamplercube, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, -1.01f, 0.0f), Vec4( 1.0f, 1.0f, -1.01f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), texCubeMipmapUint, evalTextureCubeGrad, BOTH),
3806 GRAD_CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DArrayMipmapFixed, evalTexture2DArrayGrad, BOTH),
3807 GRAD_CASE_SPEC(sampler2darray_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DArrayMipmapFloat, evalTexture2DArrayGrad, BOTH),
3808 GRAD_CASE_SPEC(isampler2darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex2DArrayMipmapInt, evalTexture2DArrayGrad, BOTH),
3809 GRAD_CASE_SPEC(usampler2darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), tex2DArrayMipmapUint, evalTexture2DArrayGrad, BOTH),
3811 GRAD_CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapFixed, evalTexture3DGrad, BOTH),
3812 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapFloat, evalTexture3DGrad, VERTEX),
3813 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.2f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapFloat, evalTexture3DGrad, FRAGMENT),
3814 GRAD_CASE_SPEC(isampler3d, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapInt, evalTexture3DGrad, BOTH),
3815 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), tex3DMipmapUint, evalTexture3DGrad, VERTEX),
3816 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, -0.2f), false, IVec3(0), tex3DMipmapUint, evalTexture3DGrad, FRAGMENT),
3818 GRAD_CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapFixed, evalTexture1DGrad, BOTH),
3819 GRAD_CASE_SPEC(sampler1d_float, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapFloat, evalTexture1DGrad, BOTH),
3820 GRAD_CASE_SPEC(isampler1d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapInt, evalTexture1DGrad, BOTH),
3821 GRAD_CASE_SPEC(usampler1d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapUint, evalTexture1DGrad, BOTH),
3823 GRAD_CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DArrayMipmapFixed, evalTexture1DArrayGrad, BOTH),
3824 GRAD_CASE_SPEC(sampler1darray_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DArrayMipmapFloat, evalTexture1DArrayGrad, BOTH),
3825 GRAD_CASE_SPEC(isampler1darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DArrayMipmapInt, evalTexture1DArrayGrad, BOTH),
3826 GRAD_CASE_SPEC(usampler1darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DArrayMipmapUint, evalTexture1DArrayGrad, BOTH),
3828 GRAD_CASE_SPEC(samplercubearray_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), texCubeArrayMipmapFixed, evalTextureCubeArrayGrad, BOTH),
3829 GRAD_CASE_SPEC(samplercubearray_float, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), texCubeArrayMipmapFloat, evalTextureCubeArrayGrad, BOTH),
3830 GRAD_CASE_SPEC(isamplercubearray, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, 1.01f, -0.5f), Vec4( 1.0f, 1.0f, 1.01f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), texCubeArrayMipmapInt, evalTextureCubeArrayGrad, BOTH),
3831 GRAD_CASE_SPEC(usamplercubearray, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, -1.01f, -0.5f), Vec4( 1.0f, 1.0f, -1.01f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), texCubeArrayMipmapUint, evalTextureCubeArrayGrad, BOTH),
3833 GRAD_CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowGrad, BOTH),
3834 GRAD_CASE_SPEC(samplercubeshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.0f, -1.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 1.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), texCubeMipmapShadow, evalTextureCubeShadowGrad, BOTH),
3835 GRAD_CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), false, IVec3(0), tex2DArrayMipmapShadow, evalTexture2DArrayShadowGrad, VERTEX),
3836 GRAD_CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), false, IVec3(0), tex2DArrayMipmapShadow, evalTexture2DArrayShadowGrad, FRAGMENT),
3837 GRAD_CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowGrad, BOTH),
3838 GRAD_CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowGrad, VERTEX),
3839 GRAD_CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowGrad, FRAGMENT),
3841 createCaseGroup(this, "texturegrad", "textureGrad() Tests", textureGradCases, DE_LENGTH_OF_ARRAY(textureGradCases));
3843 // textureGradOffset() cases
3844 static const TexFuncCaseSpec textureGradOffsetCases[] =
3846 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
3847 GRAD_CASE_SPEC(sampler2d_fixed, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapFixed, evalTexture2DGradOffset, BOTH),
3848 GRAD_CASE_SPEC(sampler2d_float, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DGradOffset, BOTH),
3849 GRAD_CASE_SPEC(isampler2d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapInt, evalTexture2DGradOffset, BOTH),
3850 GRAD_CASE_SPEC(usampler2d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DGradOffset, BOTH),
3852 GRAD_CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DArrayMipmapFixed, evalTexture2DArrayGradOffset, BOTH),
3853 GRAD_CASE_SPEC(sampler2darray_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex2DArrayMipmapFloat, evalTexture2DArrayGradOffset, BOTH),
3854 GRAD_CASE_SPEC(isampler2darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DArrayMipmapInt, evalTexture2DArrayGradOffset, BOTH),
3855 GRAD_CASE_SPEC(usampler2darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), true, IVec3(7, -8, 0), tex2DArrayMipmapUint, evalTexture2DArrayGradOffset, BOTH),
3857 GRAD_CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 3), tex3DMipmapFixed, evalTexture3DGradOffset, BOTH),
3858 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, 3, -8), tex3DMipmapFloat, evalTexture3DGradOffset, VERTEX),
3859 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.2f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(3, -8, 7), tex3DMipmapFloat, evalTexture3DGradOffset, FRAGMENT),
3860 GRAD_CASE_SPEC(isampler3d, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 3), tex3DMipmapInt, evalTexture3DGradOffset, BOTH),
3861 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), true, IVec3(7, 3, -8), tex3DMipmapUint, evalTexture3DGradOffset, VERTEX),
3862 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -1.4f, 0.1f, 0.0f), Vec4( 1.5f, 2.3f, 2.3f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, -0.2f), true, IVec3(3, -8, 7), tex3DMipmapUint, evalTexture3DGradOffset, FRAGMENT),
3864 GRAD_CASE_SPEC(sampler1d_fixed, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 0, 0), tex1DMipmapFixed, evalTexture1DGradOffset, BOTH),
3865 GRAD_CASE_SPEC(sampler1d_float, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, 0, 0), tex1DMipmapFloat, evalTexture1DGradOffset, BOTH),
3866 GRAD_CASE_SPEC(isampler1d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 0, 0), tex1DMipmapInt, evalTexture1DGradOffset, BOTH),
3867 GRAD_CASE_SPEC(usampler1d, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), true, IVec3(7, 0, 0), tex1DMipmapUint, evalTexture1DGradOffset, BOTH),
3869 GRAD_CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 0, 0), tex1DArrayMipmapFixed, evalTexture1DArrayGradOffset, BOTH),
3870 GRAD_CASE_SPEC(sampler1darray_float, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, 0, 0), tex1DArrayMipmapFloat, evalTexture1DArrayGradOffset, BOTH),
3871 GRAD_CASE_SPEC(isampler1darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 0, 0), tex1DArrayMipmapInt, evalTexture1DArrayGradOffset, BOTH),
3872 GRAD_CASE_SPEC(usampler1darray, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), true, IVec3(7, 0, 0), tex1DArrayMipmapUint, evalTexture1DArrayGradOffset, BOTH),
3874 GRAD_CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapShadow, evalTexture2DShadowGradOffset, VERTEX),
3875 GRAD_CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, -0.4f, 0.0f, 0.0f), Vec4( 1.5f, 2.3f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapShadow, evalTexture2DShadowGradOffset, FRAGMENT),
3876 GRAD_CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DArrayMipmapShadow, evalTexture2DArrayShadowGradOffset, VERTEX),
3877 GRAD_CASE_SPEC(sampler2darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.4f, -0.5f, 0.0f), Vec4( 1.5f, 2.3f, 3.5f, 1.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), true, IVec3(7, -8, 0), tex2DArrayMipmapShadow, evalTexture2DArrayShadowGradOffset, FRAGMENT),
3878 GRAD_CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 0, 0), tex1DMipmapShadow, evalTexture1DShadowGradOffset, VERTEX),
3879 GRAD_CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREGRAD, Vec4(-0.2f, 0.0f, 0.0f, 0.0f), Vec4( 1.5f, 0.0f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, 0, 0), tex1DMipmapShadow, evalTexture1DShadowGradOffset, FRAGMENT),
3880 GRAD_CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), true, IVec3(-8, 0, 0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowGradOffset, VERTEX),
3881 GRAD_CASE_SPEC(sampler1darrayshadow, FUNCTION_TEXTUREGRAD, Vec4(-1.2f, -0.5f, 0.0f, 0.0f), Vec4( 1.5f, 3.5f, 1.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(7, 0, 0), tex1DArrayMipmapShadow, evalTexture1DArrayShadowGradOffset, FRAGMENT),
3883 createCaseGroup(this, "texturegradoffset", "textureGradOffset() Tests", textureGradOffsetCases, DE_LENGTH_OF_ARRAY(textureGradOffsetCases));
3885 // textureProjGrad() cases
3886 static const TexFuncCaseSpec textureProjGradCases[] =
3888 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
3889 GRAD_CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapFixed, evalTexture2DProjGrad3, BOTH),
3890 GRAD_CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapFloat, evalTexture2DProjGrad3, BOTH),
3891 GRAD_CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapInt, evalTexture2DProjGrad3, BOTH),
3892 GRAD_CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), tex2DMipmapUint, evalTexture2DProjGrad3, BOTH),
3894 GRAD_CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapFixed, evalTexture2DProjGrad, BOTH),
3895 GRAD_CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapFloat, evalTexture2DProjGrad, BOTH),
3896 GRAD_CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapInt, evalTexture2DProjGrad, BOTH),
3897 GRAD_CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), tex2DMipmapUint, evalTexture2DProjGrad, BOTH),
3899 GRAD_CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapFixed, evalTexture3DProjGrad, BOTH),
3900 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapFloat, evalTexture3DProjGrad, VERTEX),
3901 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.2f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapFloat, evalTexture3DProjGrad, FRAGMENT),
3902 GRAD_CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex3DMipmapInt, evalTexture3DProjGrad, BOTH),
3903 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), false, IVec3(0), tex3DMipmapUint, evalTexture3DProjGrad, VERTEX),
3904 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, -0.2f), false, IVec3(0), tex3DMipmapUint, evalTexture3DProjGrad, FRAGMENT),
3906 GRAD_CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapFixed, evalTexture1DProjGrad2, BOTH),
3907 GRAD_CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapFloat, evalTexture1DProjGrad2, BOTH),
3908 GRAD_CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapInt, evalTexture1DProjGrad2, BOTH),
3909 GRAD_CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapUint, evalTexture1DProjGrad2, BOTH),
3911 GRAD_CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapFixed, evalTexture1DProjGrad, BOTH),
3912 GRAD_CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapFloat, evalTexture1DProjGrad, BOTH),
3913 GRAD_CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapInt, evalTexture1DProjGrad, BOTH),
3914 GRAD_CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapUint, evalTexture1DProjGrad, BOTH),
3916 GRAD_CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.6f, 0.0f, -1.5f), Vec4(-2.25f, -3.45f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowProjGrad, VERTEX),
3917 GRAD_CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.6f, 0.0f, -1.5f), Vec4(-2.25f, -3.45f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), false, IVec3(0), tex2DMipmapShadow, evalTexture2DShadowProjGrad, FRAGMENT),
3918 GRAD_CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.0f, 0.0f, -1.5f), Vec4(-2.25f, 0.0f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowProjGrad, VERTEX),
3919 GRAD_CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.0f, 0.0f, -1.5f), Vec4(-2.25f, 0.0f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), false, IVec3(0), tex1DMipmapShadow, evalTexture1DShadowProjGrad, FRAGMENT),
3921 createCaseGroup(this, "textureprojgrad", "textureProjGrad() Tests", textureProjGradCases, DE_LENGTH_OF_ARRAY(textureProjGradCases));
3923 // textureProjGradOffset() cases
3924 static const TexFuncCaseSpec textureProjGradOffsetCases[] =
3926 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
3927 GRAD_CASE_SPEC(sampler2d_vec3_fixed, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapFixed, evalTexture2DProjGrad3Offset, BOTH),
3928 GRAD_CASE_SPEC(sampler2d_vec3_float, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DProjGrad3Offset, BOTH),
3929 GRAD_CASE_SPEC(isampler2d_vec3, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapInt, evalTexture2DProjGrad3Offset, BOTH),
3930 GRAD_CASE_SPEC(usampler2d_vec3, FUNCTION_TEXTUREPROJGRAD3, Vec4(-0.3f, -0.6f, 1.5f, 0.0f), Vec4(2.25f, 3.45f, 1.5f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DProjGrad3Offset, BOTH),
3932 GRAD_CASE_SPEC(sampler2d_vec4_fixed, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapFixed, evalTexture2DProjGradOffset, BOTH),
3933 GRAD_CASE_SPEC(sampler2d_vec4_float, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapFloat, evalTexture2DProjGradOffset, BOTH),
3934 GRAD_CASE_SPEC(isampler2d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapInt, evalTexture2DProjGradOffset, BOTH),
3935 GRAD_CASE_SPEC(usampler2d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, -0.6f, 0.0f, 1.5f), Vec4(2.25f, 3.45f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapUint, evalTexture2DProjGradOffset, BOTH),
3937 GRAD_CASE_SPEC(sampler3d_fixed, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 3), tex3DMipmapFixed, evalTexture3DProjGradOffset, BOTH),
3938 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, 3, -8), tex3DMipmapFloat, evalTexture3DProjGradOffset, VERTEX),
3939 GRAD_CASE_SPEC(sampler3d_float, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.2f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(3, -8, 7), tex3DMipmapFloat, evalTexture3DProjGradOffset, FRAGMENT),
3940 GRAD_CASE_SPEC(isampler3d, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 3), tex3DMipmapInt, evalTexture3DProjGradOffset, BOTH),
3941 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.2f, 0.0f), true, IVec3(7, 3, -8), tex3DMipmapUint, evalTexture3DProjGradOffset, VERTEX),
3942 GRAD_CASE_SPEC(usampler3d, FUNCTION_TEXTUREPROJGRAD, Vec4(0.9f, 1.05f, -0.08f, -0.75f), Vec4(-1.13f, -1.7f, -1.7f, -0.75f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, -0.2f), true, IVec3(3, -8, 7), tex3DMipmapUint, evalTexture3DProjGradOffset, FRAGMENT),
3944 GRAD_CASE_SPEC(sampler1d_vec2_fixed, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex1DMipmapFixed, evalTexture1DProjGrad2Offset, BOTH),
3945 GRAD_CASE_SPEC(sampler1d_vec2_float, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex1DMipmapFloat, evalTexture1DProjGrad2Offset, BOTH),
3946 GRAD_CASE_SPEC(isampler1d_vec2, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex1DMipmapInt, evalTexture1DProjGrad2Offset, BOTH),
3947 GRAD_CASE_SPEC(usampler1d_vec2, FUNCTION_TEXTUREPROJGRAD2, Vec4(-0.3f, 1.5f, 0.0f, 0.0f), Vec4(2.25f, 1.5f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex1DMipmapUint, evalTexture1DProjGrad2Offset, BOTH),
3949 GRAD_CASE_SPEC(sampler1d_vec4_fixed, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex1DMipmapFixed, evalTexture1DProjGradOffset, BOTH),
3950 GRAD_CASE_SPEC(sampler1d_vec4_float, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex1DMipmapFloat, evalTexture1DProjGradOffset, BOTH),
3951 GRAD_CASE_SPEC(isampler1d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex1DMipmapInt, evalTexture1DProjGradOffset, BOTH),
3952 GRAD_CASE_SPEC(usampler1d_vec4, FUNCTION_TEXTUREPROJGRAD, Vec4(-0.3f, 0.0f, 0.0f, 1.5f), Vec4(2.25f, 0.0f, 0.0f, 1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex1DMipmapUint, evalTexture1DProjGradOffset, BOTH),
3954 GRAD_CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.6f, 0.0f, -1.5f), Vec4(-2.25f, -3.45f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex2DMipmapShadow, evalTexture2DShadowProjGradOffset, VERTEX),
3955 GRAD_CASE_SPEC(sampler2dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.6f, 0.0f, -1.5f), Vec4(-2.25f, -3.45f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, -0.2f, 0.0f), true, IVec3(7, -8, 0), tex2DMipmapShadow, evalTexture2DShadowProjGradOffset, FRAGMENT),
3956 GRAD_CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.0f, 0.0f, -1.5f), Vec4(-2.25f, 0.0f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.2f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), true, IVec3(-8, 7, 0), tex1DMipmapShadow, evalTexture1DShadowProjGradOffset, VERTEX),
3957 GRAD_CASE_SPEC(sampler1dshadow, FUNCTION_TEXTUREPROJGRAD, Vec4( 0.2f, 0.0f, 0.0f, -1.5f), Vec4(-2.25f, 0.0f, -1.5f, -1.5f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3( 0.0f, 0.0f, 0.0f), Vec3(-0.2f, 0.0f, 0.0f), true, IVec3(7, -8, 0), tex1DMipmapShadow, evalTexture1DShadowProjGradOffset, FRAGMENT),
3959 createCaseGroup(this, "textureprojgradoffset", "textureProjGradOffset() Tests", textureProjGradOffsetCases, DE_LENGTH_OF_ARRAY(textureProjGradOffsetCases));
3961 // texelFetch() cases
3962 // \note Level is constant across quad
3963 static const TexFuncCaseSpec texelFetchCases[] =
3965 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3966 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(255.9f, 255.9f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DTexelFetchFixed, evalTexelFetch2D, BOTH),
3967 CASE_SPEC(sampler2d_float, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(127.9f, 127.9f, 0.0f, 0.0f), false, 1.0f, 1.0f, false, IVec3(0), tex2DTexelFetchFloat, evalTexelFetch2D, BOTH),
3968 CASE_SPEC(isampler2d, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 63.9f, 63.9f, 0.0f, 0.0f), false, 2.0f, 2.0f, false, IVec3(0), tex2DTexelFetchInt, evalTexelFetch2D, BOTH),
3969 CASE_SPEC(usampler2d, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 15.9f, 15.9f, 0.0f, 0.0f), false, 4.0f, 4.0f, false, IVec3(0), tex2DTexelFetchUint, evalTexelFetch2D, BOTH),
3971 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(127.9f, 127.9f, 3.9f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex2DArrayTexelFetchFixed, evalTexelFetch2DArray, BOTH),
3972 CASE_SPEC(sampler2darray_float, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 63.9f, 63.9f, 3.9f, 0.0f), false, 1.0f, 1.0f, false, IVec3(0), tex2DArrayTexelFetchFloat, evalTexelFetch2DArray, BOTH),
3973 CASE_SPEC(isampler2darray, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 31.9f, 31.9f, 3.9f, 0.0f), false, 2.0f, 2.0f, false, IVec3(0), tex2DArrayTexelFetchInt, evalTexelFetch2DArray, BOTH),
3974 CASE_SPEC(usampler2darray, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 15.9f, 15.9f, 3.9f, 0.0f), false, 3.0f, 3.0f, false, IVec3(0), tex2DArrayTexelFetchUint, evalTexelFetch2DArray, BOTH),
3976 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(63.9f, 31.9f, 31.9f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DTexelFetchFixed, evalTexelFetch3D, BOTH),
3977 CASE_SPEC(sampler3d_float, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(31.9f, 15.9f, 15.9f, 0.0f), false, 1.0f, 1.0f, false, IVec3(0), tex3DTexelFetchFloat, evalTexelFetch3D, BOTH),
3978 CASE_SPEC(isampler3d, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(15.9f, 7.9f, 7.9f, 0.0f), false, 2.0f, 2.0f, false, IVec3(0), tex3DTexelFetchInt, evalTexelFetch3D, BOTH),
3979 CASE_SPEC(usampler3d, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(63.9f, 31.9f, 31.9f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex3DTexelFetchUint, evalTexelFetch3D, BOTH),
3981 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(255.9f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DTexelFetchFixed, evalTexelFetch1D, BOTH),
3982 CASE_SPEC(sampler1d_float, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(127.9f, 0.0f, 0.0f, 0.0f), false, 1.0f, 1.0f, false, IVec3(0), tex1DTexelFetchFloat, evalTexelFetch1D, BOTH),
3983 CASE_SPEC(isampler1d, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 63.9f, 0.0f, 0.0f, 0.0f), false, 2.0f, 2.0f, false, IVec3(0), tex1DTexelFetchInt, evalTexelFetch1D, BOTH),
3984 CASE_SPEC(usampler1d, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 15.9f, 0.0f, 0.0f, 0.0f), false, 4.0f, 4.0f, false, IVec3(0), tex1DTexelFetchUint, evalTexelFetch1D, BOTH),
3986 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(255.9f, 3.9f, 0.0f, 0.0f), false, 0.0f, 0.0f, false, IVec3(0), tex1DArrayTexelFetchFixed, evalTexelFetch1DArray, BOTH),
3987 CASE_SPEC(sampler1darray_float, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(127.9f, 3.9f, 0.0f, 0.0f), false, 1.0f, 1.0f, false, IVec3(0), tex1DArrayTexelFetchFloat, evalTexelFetch1DArray, BOTH),
3988 CASE_SPEC(isampler1darray, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 63.9f, 3.9f, 0.0f, 0.0f), false, 2.0f, 2.0f, false, IVec3(0), tex1DArrayTexelFetchInt, evalTexelFetch1DArray, BOTH),
3989 CASE_SPEC(usampler1darray, FUNCTION_TEXELFETCH, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 15.9f, 3.9f, 0.0f, 0.0f), false, 4.0f, 4.0f, false, IVec3(0), tex1DArrayTexelFetchUint, evalTexelFetch1DArray, BOTH),
3991 createCaseGroup(this, "texelfetch", "texelFetch() Tests", texelFetchCases, DE_LENGTH_OF_ARRAY(texelFetchCases));
3993 // texelFetchOffset() cases
3994 static const TexFuncCaseSpec texelFetchOffsetCases[] =
3996 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3997 CASE_SPEC(sampler2d_fixed, FUNCTION_TEXELFETCH, Vec4( 8.0f, -7.0f, 0.0f, 0.0f), Vec4(263.9f, 248.9f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DTexelFetchFixed, evalTexelFetch2D, BOTH),
3998 CASE_SPEC(sampler2d_float, FUNCTION_TEXELFETCH, Vec4(-7.0f, 8.0f, 0.0f, 0.0f), Vec4(120.9f, 135.9f, 0.0f, 0.0f), false, 1.0f, 1.0f, true, IVec3(7, -8, 0), tex2DTexelFetchFloat, evalTexelFetch2D, BOTH),
3999 CASE_SPEC(isampler2d, FUNCTION_TEXELFETCH, Vec4( 8.0f, -7.0f, 0.0f, 0.0f), Vec4( 71.9f, 56.9f, 0.0f, 0.0f), false, 2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DTexelFetchInt, evalTexelFetch2D, BOTH),
4000 CASE_SPEC(usampler2d, FUNCTION_TEXELFETCH, Vec4(-7.0f, 8.0f, 0.0f, 0.0f), Vec4( 8.9f, 23.9f, 0.0f, 0.0f), false, 4.0f, 4.0f, true, IVec3(7, -8, 0), tex2DTexelFetchUint, evalTexelFetch2D, BOTH),
4002 CASE_SPEC(sampler2darray_fixed, FUNCTION_TEXELFETCH, Vec4( 8.0f, -7.0f, 0.0f, 0.0f), Vec4(135.9f, 120.9f, 3.9f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 0), tex2DArrayTexelFetchFixed, evalTexelFetch2DArray, BOTH),
4003 CASE_SPEC(sampler2darray_float, FUNCTION_TEXELFETCH, Vec4(-7.0f, 8.0f, 0.0f, 0.0f), Vec4( 56.9f, 71.9f, 3.9f, 0.0f), false, 1.0f, 1.0f, true, IVec3(7, -8, 0), tex2DArrayTexelFetchFloat, evalTexelFetch2DArray, BOTH),
4004 CASE_SPEC(isampler2darray, FUNCTION_TEXELFETCH, Vec4( 8.0f, -7.0f, 0.0f, 0.0f), Vec4( 39.9f, 24.9f, 3.9f, 0.0f), false, 2.0f, 2.0f, true, IVec3(-8, 7, 0), tex2DArrayTexelFetchInt, evalTexelFetch2DArray, BOTH),
4005 CASE_SPEC(usampler2darray, FUNCTION_TEXELFETCH, Vec4(-7.0f, 8.0f, 0.0f, 0.0f), Vec4( 8.9f, 23.9f, 3.9f, 0.0f), false, 3.0f, 3.0f, true, IVec3(7, -8, 0), tex2DArrayTexelFetchUint, evalTexelFetch2DArray, BOTH),
4007 CASE_SPEC(sampler3d_fixed, FUNCTION_TEXELFETCH, Vec4( 8.0f, -7.0f, -3.0f, 0.0f),Vec4(71.9f, 24.9f, 28.9f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DTexelFetchFixed, evalTexelFetch3D, BOTH),
4008 CASE_SPEC(sampler3d_float, FUNCTION_TEXELFETCH, Vec4(-7.0f, -3.0f, 8.0f, 0.0f),Vec4(24.9f, 12.9f, 23.9f, 0.0f), false, 1.0f, 1.0f, true, IVec3(7, 3, -8), tex3DTexelFetchFloat, evalTexelFetch3D, BOTH),
4009 CASE_SPEC(isampler3d, FUNCTION_TEXELFETCH, Vec4(-3.0f, 8.0f, -7.0f, 0.0f),Vec4(12.9f, 15.9f, 0.9f, 0.0f), false, 2.0f, 2.0f, true, IVec3(3, -8, 7), tex3DTexelFetchInt, evalTexelFetch3D, BOTH),
4010 CASE_SPEC(usampler3d, FUNCTION_TEXELFETCH, Vec4( 8.0f, -7.0f, -3.0f, 0.0f),Vec4(71.9f, 24.9f, 28.9f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 7, 3), tex3DTexelFetchUint, evalTexelFetch3D, BOTH),
4012 CASE_SPEC(sampler1d_fixed, FUNCTION_TEXELFETCH, Vec4( 8.0f, 0.0f, 0.0f, 0.0f), Vec4(263.9f, 0.0f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DTexelFetchFixed, evalTexelFetch1D, BOTH),
4013 CASE_SPEC(sampler1d_float, FUNCTION_TEXELFETCH, Vec4(-7.0f, 0.0f, 0.0f, 0.0f), Vec4(120.9f, 0.0f, 0.0f, 0.0f), false, 1.0f, 1.0f, true, IVec3(7, 0, 0), tex1DTexelFetchFloat, evalTexelFetch1D, BOTH),
4014 CASE_SPEC(isampler1d, FUNCTION_TEXELFETCH, Vec4( 8.0f, 0.0f, 0.0f, 0.0f), Vec4( 71.9f, 0.0f, 0.0f, 0.0f), false, 2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DTexelFetchInt, evalTexelFetch1D, BOTH),
4015 CASE_SPEC(usampler1d, FUNCTION_TEXELFETCH, Vec4(-7.0f, 0.0f, 0.0f, 0.0f), Vec4( 8.9f, 0.0f, 0.0f, 0.0f), false, 4.0f, 4.0f, true, IVec3(7, 0, 0), tex1DTexelFetchUint, evalTexelFetch1D, BOTH),
4017 CASE_SPEC(sampler1darray_fixed, FUNCTION_TEXELFETCH, Vec4( 8.0f, 0.0f, 0.0f, 0.0f), Vec4(135.9f, 3.9f, 0.0f, 0.0f), false, 0.0f, 0.0f, true, IVec3(-8, 0, 0), tex1DArrayTexelFetchFixed, evalTexelFetch1DArray, BOTH),
4018 CASE_SPEC(sampler1darray_float, FUNCTION_TEXELFETCH, Vec4(-7.0f, 0.0f, 0.0f, 0.0f), Vec4( 56.9f, 3.9f, 0.0f, 0.0f), false, 1.0f, 1.0f, true, IVec3(7, 0, 0), tex1DArrayTexelFetchFloat, evalTexelFetch1DArray, BOTH),
4019 CASE_SPEC(isampler1darray, FUNCTION_TEXELFETCH, Vec4( 8.0f, 0.0f, 0.0f, 0.0f), Vec4( 39.9f, 3.9f, 0.0f, 0.0f), false, 2.0f, 2.0f, true, IVec3(-8, 0, 0), tex1DArrayTexelFetchInt, evalTexelFetch1DArray, BOTH),
4020 CASE_SPEC(usampler1darray, FUNCTION_TEXELFETCH, Vec4(-7.0f, 0.0f, 0.0f, 0.0f), Vec4( 8.9f, 3.9f, 0.0f, 0.0f), false, 3.0f, 3.0f, true, IVec3(7, 0, 0), tex1DArrayTexelFetchUint, evalTexelFetch1DArray, BOTH),
4022 createCaseGroup(this, "texelfetchoffset", "texelFetchOffset() Tests", texelFetchOffsetCases, DE_LENGTH_OF_ARRAY(texelFetchOffsetCases));
4024 // texture query functions
4026 struct TexQueryFuncCaseSpec
4029 const char* samplerName;
4030 TextureSpec textureSpec;
4033 de::MovePtr<tcu::TestCaseGroup> queryGroup (new tcu::TestCaseGroup(m_testCtx, "query", "Texture query function tests"));
4035 // textureSize() cases
4037 const TexQueryFuncCaseSpec textureSizeCases[] =
4039 { "sampler2d_fixed", "sampler2D", tex2DFixed },
4040 { "sampler2d_float", "sampler2D", tex2DFloat },
4041 { "isampler2d", "isampler2D", tex2DInt },
4042 { "usampler2d", "usampler2D", tex2DUint },
4043 { "sampler2dshadow", "sampler2DShadow", tex2DShadow },
4044 { "sampler3d_fixed", "sampler3D", tex3DFixed },
4045 { "sampler3d_float", "sampler3D", tex3DFloat },
4046 { "isampler3d", "isampler3D", tex3DInt },
4047 { "usampler3d", "usampler3D", tex3DUint },
4048 { "samplercube_fixed", "samplerCube", texCubeFixed },
4049 { "samplercube_float", "samplerCube", texCubeFloat },
4050 { "isamplercube", "isamplerCube", texCubeInt },
4051 { "usamplercube", "usamplerCube", texCubeUint },
4052 { "samplercubeshadow", "samplerCubeShadow", texCubeShadow },
4053 { "sampler2darray_fixed", "sampler2DArray", tex2DArrayFixed },
4054 { "sampler2darray_float", "sampler2DArray", tex2DArrayFloat },
4055 { "isampler2darray", "isampler2DArray", tex2DArrayInt },
4056 { "usampler2darray", "usampler2DArray", tex2DArrayUint },
4057 { "sampler2darrayshadow", "sampler2DArrayShadow", tex2DArrayShadow },
4058 { "samplercubearray_fixed", "samplerCubeArray", texCubeArrayFixed },
4059 { "samplercubearray_float", "samplerCubeArray", texCubeArrayFloat },
4060 { "isamplercubearray", "isamplerCubeArray", texCubeArrayInt },
4061 { "usamplercubearray", "usamplerCubeArray", texCubeArrayUint },
4062 { "samplercubearrayshadow", "samplerCubeArrayShadow", texCubeArrayShadow },
4063 { "sampler1d_fixed", "sampler1D", tex1DFixed },
4064 { "sampler1d_float", "sampler1D", tex1DFloat },
4065 { "isampler1d", "isampler1D", tex1DInt },
4066 { "usampler1d", "usampler1D", tex1DUint },
4067 { "sampler1dshadow", "sampler1DShadow", tex1DShadow },
4068 { "sampler1darray_fixed", "sampler1DArray", tex1DArrayFixed },
4069 { "sampler1darray_float", "sampler1DArray", tex1DArrayFloat },
4070 { "isampler1darray", "isampler1DArray", tex1DArrayInt },
4071 { "usampler1darray", "usampler1DArray", tex1DArrayUint },
4072 { "sampler1darrayshadow", "sampler1DArrayShadow", tex1DArrayShadow },
4075 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturesize", "textureSize() Tests"));
4077 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureSizeCases); ++ndx)
4079 const TexQueryFuncCaseSpec& caseSpec = textureSizeCases[ndx];
4081 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_vertex"), "", caseSpec.samplerName, caseSpec.textureSpec, true, QUERYFUNCTION_TEXTURESIZE));
4082 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTURESIZE));
4085 queryGroup->addChild(group.release());
4088 // textureSamples() cases
4090 const TexQueryFuncCaseSpec textureSamplesCases[] =
4092 { "sampler2dms_fixed", "sampler2DMS", tex2DFixed },
4093 { "sampler2dms_float", "sampler2DMS", tex2DFloat },
4094 { "isampler2dms", "isampler2DMS", tex2DInt },
4095 { "usampler2dms", "usampler2DMS", tex2DUint },
4096 { "sampler2dmsarray_fixed", "sampler2DMSArray", tex2DArrayFixed },
4097 { "sampler2dmsarray_float", "sampler2DMSArray", tex2DArrayFloat },
4098 { "isampler2dmsarray", "isampler2DMSArray", tex2DArrayInt },
4099 { "usampler2dmsarray", "usampler2DMSArray", tex2DArrayUint },
4102 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturesamples", "textureSamples() Tests"));
4104 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureSamplesCases); ++ndx)
4106 const TexQueryFuncCaseSpec& caseSpec = textureSamplesCases[ndx];
4108 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_vertex"), "", caseSpec.samplerName, caseSpec.textureSpec, true, QUERYFUNCTION_TEXTURESAMPLES));
4109 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTURESAMPLES));
4112 queryGroup->addChild(group.release());
4115 // textureQueryLevels() cases
4117 const TexQueryFuncCaseSpec textureQueryLevelsCases[] =
4119 { "sampler2d_fixed", "sampler2D", tex2DFixed },
4120 { "sampler2d_float", "sampler2D", tex2DFloat },
4121 { "isampler2d", "isampler2D", tex2DInt },
4122 { "usampler2d", "usampler2D", tex2DUint },
4123 { "sampler2dshadow", "sampler2DShadow", tex2DShadow },
4124 { "sampler3d_fixed", "sampler3D", tex3DFixed },
4125 { "sampler3d_float", "sampler3D", tex3DFloat },
4126 { "isampler3d", "isampler3D", tex3DInt },
4127 { "usampler3d", "usampler3D", tex3DUint },
4128 { "samplercube_fixed", "samplerCube", texCubeFixed },
4129 { "samplercube_float", "samplerCube", texCubeFloat },
4130 { "isamplercube", "isamplerCube", texCubeInt },
4131 { "usamplercube", "usamplerCube", texCubeUint },
4132 { "samplercubeshadow", "samplerCubeShadow", texCubeShadow },
4133 { "sampler2darray_fixed", "sampler2DArray", tex2DArrayFixed },
4134 { "sampler2darray_float", "sampler2DArray", tex2DArrayFloat },
4135 { "isampler2darray", "isampler2DArray", tex2DArrayInt },
4136 { "usampler2darray", "usampler2DArray", tex2DArrayUint },
4137 { "sampler2darrayshadow", "sampler2DArrayShadow", tex2DArrayShadow },
4138 { "samplercubearray_fixed", "samplerCubeArray", texCubeArrayFixed },
4139 { "samplercubearray_float", "samplerCubeArray", texCubeArrayFloat },
4140 { "isamplercubearray", "isamplerCubeArray", texCubeArrayInt },
4141 { "usamplercubearray", "usamplerCubeArray", texCubeArrayUint },
4142 { "samplercubearrayshadow", "samplerCubeArrayShadow", texCubeArrayShadow },
4143 { "sampler1d_fixed", "sampler1D", tex1DFixed },
4144 { "sampler1d_float", "sampler1D", tex1DFloat },
4145 { "isampler1d", "isampler1D", tex1DInt },
4146 { "usampler1d", "usampler1D", tex1DUint },
4147 { "sampler1dshadow", "sampler1DShadow", tex1DShadow },
4148 { "sampler1darray_fixed", "sampler1DArray", tex1DArrayFixed },
4149 { "sampler1darray_float", "sampler1DArray", tex1DArrayFloat },
4150 { "isampler1darray", "isampler1DArray", tex1DArrayInt },
4151 { "usampler1darray", "usampler1DArray", tex1DArrayUint },
4152 { "sampler1darrayshadow", "sampler1DArrayShadow", tex1DArrayShadow },
4155 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturequerylevels", "textureQueryLevels() Tests"));
4157 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureQueryLevelsCases); ++ndx)
4159 const TexQueryFuncCaseSpec& caseSpec = textureQueryLevelsCases[ndx];
4161 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_vertex"), "", caseSpec.samplerName, caseSpec.textureSpec, true, QUERYFUNCTION_TEXTUREQUERYLEVELS));
4162 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTUREQUERYLEVELS));
4165 queryGroup->addChild(group.release());
4168 // textureQueryLod() cases
4170 const TexQueryFuncCaseSpec textureQueryLodCases[] =
4172 { "sampler2d_fixed", "sampler2D", tex2DMipmapFixed },
4173 { "sampler2d_float", "sampler2D", tex2DMipmapFloat },
4174 { "isampler2d", "isampler2D", tex2DMipmapInt },
4175 { "usampler2d", "usampler2D", tex2DMipmapUint },
4176 { "sampler2dshadow", "sampler2DShadow", tex2DMipmapShadow },
4177 { "sampler3d_fixed", "sampler3D", tex3DMipmapFixed },
4178 { "sampler3d_float", "sampler3D", tex3DMipmapFloat },
4179 { "isampler3d", "isampler3D", tex3DMipmapInt },
4180 { "usampler3d", "usampler3D", tex3DMipmapUint },
4181 { "samplercube_fixed", "samplerCube", texCubeMipmapFixed },
4182 { "samplercube_float", "samplerCube", texCubeMipmapFloat },
4183 { "isamplercube", "isamplerCube", texCubeMipmapInt },
4184 { "usamplercube", "usamplerCube", texCubeMipmapUint },
4185 { "samplercubeshadow", "samplerCubeShadow", texCubeMipmapShadow },
4186 { "sampler2darray_fixed", "sampler2DArray", tex2DArrayMipmapFixed },
4187 { "sampler2darray_float", "sampler2DArray", tex2DArrayMipmapFloat },
4188 { "isampler2darray", "isampler2DArray", tex2DArrayMipmapInt },
4189 { "usampler2darray", "usampler2DArray", tex2DArrayMipmapUint },
4190 { "sampler2darrayshadow", "sampler2DArrayShadow", tex2DArrayMipmapShadow },
4191 { "samplercubearray_fixed", "samplerCubeArray", texCubeArrayMipmapFixed },
4192 { "samplercubearray_float", "samplerCubeArray", texCubeArrayMipmapFloat },
4193 { "isamplercubearray", "isamplerCubeArray", texCubeArrayMipmapInt },
4194 { "usamplercubearray", "usamplerCubeArray", texCubeArrayMipmapUint },
4195 { "samplercubearrayshadow", "samplerCubeArrayShadow", texCubeArrayMipmapShadow },
4196 { "sampler1d_fixed", "sampler1D", tex1DMipmapFixed },
4197 { "sampler1d_float", "sampler1D", tex1DMipmapFloat },
4198 { "isampler1d", "isampler1D", tex1DMipmapInt },
4199 { "usampler1d", "usampler1D", tex1DMipmapUint },
4200 { "sampler1dshadow", "sampler1DShadow", tex1DMipmapShadow },
4201 { "sampler1darray_fixed", "sampler1DArray", tex1DArrayMipmapFixed },
4202 { "sampler1darray_float", "sampler1DArray", tex1DArrayMipmapFloat },
4203 { "isampler1darray", "isampler1DArray", tex1DArrayMipmapInt },
4204 { "usampler1darray", "usampler1DArray", tex1DArrayMipmapUint },
4205 { "sampler1darrayshadow", "sampler1DArrayShadow", tex1DArrayMipmapShadow },
4208 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturequerylod", "textureQueryLod() Tests"));
4210 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureQueryLodCases); ++ndx)
4212 const TexQueryFuncCaseSpec& caseSpec = textureQueryLodCases[ndx];
4214 // available only in fragment shader
4215 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTUREQUERYLOD));
4218 queryGroup->addChild(group.release());
4221 addChild(queryGroup.release());
4227 tcu::TestCaseGroup* createTextureFunctionTests (tcu::TestContext& testCtx)
4229 return new ShaderTextureFunctionTests(testCtx);