1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
4 *
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
8 *
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
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
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.
20 *
21 *//*!
22 * \file
23 * \brief Texture access and query function tests.
24 *//*--------------------------------------------------------------------*/
25
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"
33 #include "deMath.h"
34 #include "vkImageUtil.hpp"
35 #include "vkQueryUtil.hpp"
36 #include <limits>
37
38 namespace vkt
39 {
40 namespace sr
41 {
42 namespace
43 {
44
45 using tcu::Vec2;
46 using tcu::Vec3;
47 using tcu::Vec4;
48 using tcu::IVec2;
49 using tcu::IVec3;
50 using tcu::IVec4;
51
52 using std::vector;
53
54 enum Function
55 {
56 FUNCTION_TEXTURE = 0, //!< texture(), textureOffset(), textureClampARB, textureOffsetClampARB
57 FUNCTION_TEXTUREPROJ, //!< textureProj(), textureProjOffset()
58 FUNCTION_TEXTUREPROJ2, //!< textureProj(sampler1D, vec2)
59 FUNCTION_TEXTUREPROJ3, //!< textureProj(sampler2D, vec3)
60 FUNCTION_TEXTURELOD, // ...
61 FUNCTION_TEXTUREPROJLOD,
62 FUNCTION_TEXTUREPROJLOD2, //!< textureProjLod(sampler1D, vec2)
63 FUNCTION_TEXTUREPROJLOD3, //!< textureProjLod(sampler2D, vec3)
64 FUNCTION_TEXTUREGRAD, //!< textureGrad, textureGradOffset, textureGradClampARB, textureGradOffsetClampARB
65 FUNCTION_TEXTUREPROJGRAD,
66 FUNCTION_TEXTUREPROJGRAD2, //!< textureProjGrad(sampler1D, vec2)
67 FUNCTION_TEXTUREPROJGRAD3, //!< textureProjGrad(sampler2D, vec3)
68 FUNCTION_TEXELFETCH,
69
70 FUNCTION_LAST
71 };
72
functionHasAutoLod(glu::ShaderType shaderType,Function function)73 inline bool functionHasAutoLod (glu::ShaderType shaderType, Function function)
74 {
75 return shaderType == glu::SHADERTYPE_FRAGMENT &&
76 (function == FUNCTION_TEXTURE ||
77 function == FUNCTION_TEXTUREPROJ ||
78 function == FUNCTION_TEXTUREPROJ2 ||
79 function == FUNCTION_TEXTUREPROJ3);
80 }
81
functionHasProj(Function function)82 inline bool functionHasProj (Function function)
83 {
84 return function == FUNCTION_TEXTUREPROJ ||
85 function == FUNCTION_TEXTUREPROJ2 ||
86 function == FUNCTION_TEXTUREPROJ3 ||
87 function == FUNCTION_TEXTUREPROJLOD ||
88 function == FUNCTION_TEXTUREPROJLOD2 ||
89 function == FUNCTION_TEXTUREPROJLOD3 ||
90 function == FUNCTION_TEXTUREPROJGRAD ||
91 function == FUNCTION_TEXTUREPROJGRAD2||
92 function == FUNCTION_TEXTUREPROJGRAD3;
93 }
94
functionHasGrad(Function function)95 inline bool functionHasGrad (Function function)
96 {
97 return function == FUNCTION_TEXTUREGRAD ||
98 function == FUNCTION_TEXTUREPROJGRAD ||
99 function == FUNCTION_TEXTUREPROJGRAD2||
100 function == FUNCTION_TEXTUREPROJGRAD3;
101 }
102
functionHasLod(Function function)103 inline bool functionHasLod (Function function)
104 {
105 return function == FUNCTION_TEXTURELOD ||
106 function == FUNCTION_TEXTUREPROJLOD ||
107 function == FUNCTION_TEXTUREPROJLOD2 ||
108 function == FUNCTION_TEXTUREPROJLOD3 ||
109 function == FUNCTION_TEXELFETCH;
110 }
111
112 struct TextureLookupSpec
113 {
114 Function function;
115
116 tcu::Vec4 minCoord;
117 tcu::Vec4 maxCoord;
118
119 // Bias
120 bool useBias;
121
122 // Bias or Lod for *Lod* functions
123 float minLodBias;
124 float maxLodBias;
125
126 // For *Grad* functions
127 tcu::Vec3 minDX;
128 tcu::Vec3 maxDX;
129 tcu::Vec3 minDY;
130 tcu::Vec3 maxDY;
131
132 bool useOffset;
133 tcu::IVec3 offset;
134
135 // Lod clamp
136 bool useClamp;
137 float lodClamp;
138
TextureLookupSpecvkt::sr::__anon5a8db67a0111::TextureLookupSpec139 TextureLookupSpec (void)
140 : function (FUNCTION_LAST)
141 , minCoord (0.0f)
142 , maxCoord (1.0f)
143 , useBias (false)
144 , minLodBias (0.0f)
145 , maxLodBias (0.0f)
146 , minDX (0.0f)
147 , maxDX (0.0f)
148 , minDY (0.0f)
149 , maxDY (0.0f)
150 , useOffset (false)
151 , offset (0)
152 , useClamp (false)
153 , lodClamp (0.0f)
154 {
155 }
156
TextureLookupSpecvkt::sr::__anon5a8db67a0111::TextureLookupSpec157 TextureLookupSpec (Function function_,
158 const tcu::Vec4& minCoord_,
159 const tcu::Vec4& maxCoord_,
160 bool useBias_,
161 float minLodBias_,
162 float maxLodBias_,
163 const tcu::Vec3& minDX_,
164 const tcu::Vec3& maxDX_,
165 const tcu::Vec3& minDY_,
166 const tcu::Vec3& maxDY_,
167 bool useOffset_,
168 const tcu::IVec3& offset_,
169 bool useClamp_,
170 float lodClamp_)
171 : function (function_)
172 , minCoord (minCoord_)
173 , maxCoord (maxCoord_)
174 , useBias (useBias_)
175 , minLodBias (minLodBias_)
176 , maxLodBias (maxLodBias_)
177 , minDX (minDX_)
178 , maxDX (maxDX_)
179 , minDY (minDY_)
180 , maxDY (maxDY_)
181 , useOffset (useOffset_)
182 , offset (offset_)
183 , useClamp (useClamp_)
184 , lodClamp (lodClamp_)
185 {
186 }
187 };
188
189 enum TextureType
190 {
191 TEXTURETYPE_1D = 0,
192 TEXTURETYPE_2D,
193 TEXTURETYPE_3D,
194 TEXTURETYPE_CUBE_MAP,
195 TEXTURETYPE_1D_ARRAY,
196 TEXTURETYPE_2D_ARRAY,
197 TEXTURETYPE_CUBE_ARRAY,
198
199 TEXTURETYPE_LAST
200 };
201
202 struct TextureSpec
203 {
204 TextureType type; //!< Texture type (2D, cubemap, ...)
205 deUint32 format; //!< Internal format.
206 int width;
207 int height;
208 int depth;
209 int numLevels;
210 tcu::Sampler sampler;
211
TextureSpecvkt::sr::__anon5a8db67a0111::TextureSpec212 TextureSpec (void)
213 : type (TEXTURETYPE_LAST)
214 , format (GL_NONE)
215 , width (0)
216 , height (0)
217 , depth (0)
218 , numLevels (0)
219 {
220 }
221
TextureSpecvkt::sr::__anon5a8db67a0111::TextureSpec222 TextureSpec (TextureType type_,
223 deUint32 format_,
224 int width_,
225 int height_,
226 int depth_,
227 int numLevels_,
228 const tcu::Sampler& sampler_)
229 : type (type_)
230 , format (format_)
231 , width (width_)
232 , height (height_)
233 , depth (depth_)
234 , numLevels (numLevels_)
235 , sampler (sampler_)
236 {
237 }
238 };
239
240 struct TexLookupParams
241 {
242 float lod;
243 float lodClamp;
244 tcu::IVec3 offset;
245 tcu::Vec4 scale;
246 tcu::Vec4 bias;
247
TexLookupParamsvkt::sr::__anon5a8db67a0111::TexLookupParams248 TexLookupParams (void)
249 : lod (0.0f)
250 , lodClamp (0.0f)
251 , offset (0)
252 , scale (1.0f)
253 , bias (0.0f)
254 {
255 }
256 };
257
258 // \note LodMode and computeLodFromDerivates functions are copied from glsTextureTestUtil
259 namespace TextureTestUtil
260 {
261
262 enum LodMode
263 {
264 LODMODE_EXACT = 0, //!< Ideal lod computation.
265 LODMODE_MIN_BOUND, //!< Use estimation range minimum bound.
266 LODMODE_MAX_BOUND, //!< Use estimation range maximum bound.
267
268 LODMODE_LAST
269 };
270
271 // 1D lookup LOD computation.
272
computeLodFromDerivates(LodMode mode,float dudx,float dudy)273 float computeLodFromDerivates (LodMode mode, float dudx, float dudy)
274 {
275 float p = 0.0f;
276 switch (mode)
277 {
278 // \note [mika] Min and max bounds equal to exact with 1D textures
279 case LODMODE_EXACT:
280 case LODMODE_MIN_BOUND:
281 case LODMODE_MAX_BOUND:
282 p = de::max(deFloatAbs(dudx), deFloatAbs(dudy));
283 break;
284
285 default:
286 DE_ASSERT(DE_FALSE);
287 }
288
289 return deFloatLog2(p);
290 }
291
292 // 2D lookup LOD computation.
293
computeLodFromDerivates(LodMode mode,float dudx,float dvdx,float dudy,float dvdy)294 float computeLodFromDerivates (LodMode mode, float dudx, float dvdx, float dudy, float dvdy)
295 {
296 float p = 0.0f;
297 switch (mode)
298 {
299 case LODMODE_EXACT:
300 p = de::max(deFloatSqrt(dudx*dudx + dvdx*dvdx), deFloatSqrt(dudy*dudy + dvdy*dvdy));
301 break;
302
303 case LODMODE_MIN_BOUND:
304 case LODMODE_MAX_BOUND:
305 {
306 float mu = de::max(deFloatAbs(dudx), deFloatAbs(dudy));
307 float mv = de::max(deFloatAbs(dvdx), deFloatAbs(dvdy));
308
309 p = mode == LODMODE_MIN_BOUND ? de::max(mu, mv) : mu + mv;
310 break;
311 }
312
313 default:
314 DE_ASSERT(DE_FALSE);
315 }
316
317 return deFloatLog2(p);
318 }
319
320 // 3D lookup LOD computation.
321
computeLodFromDerivates(LodMode mode,float dudx,float dvdx,float dwdx,float dudy,float dvdy,float dwdy)322 float computeLodFromDerivates (LodMode mode, float dudx, float dvdx, float dwdx, float dudy, float dvdy, float dwdy)
323 {
324 float p = 0.0f;
325 switch (mode)
326 {
327 case LODMODE_EXACT:
328 p = de::max(deFloatSqrt(dudx*dudx + dvdx*dvdx + dwdx*dwdx), deFloatSqrt(dudy*dudy + dvdy*dvdy + dwdy*dwdy));
329 break;
330
331 case LODMODE_MIN_BOUND:
332 case LODMODE_MAX_BOUND:
333 {
334 float mu = de::max(deFloatAbs(dudx), deFloatAbs(dudy));
335 float mv = de::max(deFloatAbs(dvdx), deFloatAbs(dvdy));
336 float mw = de::max(deFloatAbs(dwdx), deFloatAbs(dwdy));
337
338 p = mode == LODMODE_MIN_BOUND ? de::max(de::max(mu, mv), mw) : (mu + mv + mw);
339 break;
340 }
341
342 default:
343 DE_ASSERT(DE_FALSE);
344 }
345
346 return deFloatLog2(p);
347 }
348
349 } // TextureTestUtil
350
351 using namespace TextureTestUtil;
352
353 static const LodMode DEFAULT_LOD_MODE = LODMODE_EXACT;
354
computeLodFromGrad2D(const ShaderEvalContext & c)355 inline float computeLodFromGrad2D (const ShaderEvalContext& c)
356 {
357 float w = (float)c.textures[0].tex2D->getWidth();
358 float h = (float)c.textures[0].tex2D->getHeight();
359 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);
360 }
361
computeLodFromGrad2DArray(const ShaderEvalContext & c)362 inline float computeLodFromGrad2DArray (const ShaderEvalContext& c)
363 {
364 float w = (float)c.textures[0].tex2DArray->getWidth();
365 float h = (float)c.textures[0].tex2DArray->getHeight();
366 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);
367 }
368
computeLodFromGrad3D(const ShaderEvalContext & c)369 inline float computeLodFromGrad3D (const ShaderEvalContext& c)
370 {
371 float w = (float)c.textures[0].tex3D->getWidth();
372 float h = (float)c.textures[0].tex3D->getHeight();
373 float d = (float)c.textures[0].tex3D->getDepth();
374 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);
375 }
376
computeLodFromGradCube(const ShaderEvalContext & c)377 inline float computeLodFromGradCube (const ShaderEvalContext& c)
378 {
379 // \note Major axis is always -Z or +Z
380 float m = de::abs(c.in[0].z());
381 float d = (float)c.textures[0].texCube->getSize();
382 float s = d/(2.0f*m);
383 float t = d/(2.0f*m);
384 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);
385 }
386
computeLodFromGrad1D(const ShaderEvalContext & c)387 inline float computeLodFromGrad1D (const ShaderEvalContext& c)
388 {
389 float w = (float)c.textures[0].tex1D->getWidth();
390 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*w, c.in[2].x()*w);
391 }
392
computeLodFromGrad1DArray(const ShaderEvalContext & c)393 inline float computeLodFromGrad1DArray (const ShaderEvalContext& c)
394 {
395 float w = (float)c.textures[0].tex1DArray->getWidth();
396 return computeLodFromDerivates(DEFAULT_LOD_MODE, c.in[1].x()*w, c.in[2].x()*w);
397 }
398
computeLodFromGradCubeArray(const ShaderEvalContext & c)399 inline float computeLodFromGradCubeArray (const ShaderEvalContext& c)
400 {
401 // \note Major axis is always -Z or +Z
402 float m = de::abs(c.in[0].z());
403 float d = (float)c.textures[0].texCubeArray->getSize();
404 float s = d/(2.0f*m);
405 float t = d/(2.0f*m);
406 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);
407 }
408
409 typedef void (*TexEvalFunc) (ShaderEvalContext& c, const TexLookupParams& lookupParams);
410
texture2D(const ShaderEvalContext & c,float s,float t,float lod)411 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); }
textureCube(const ShaderEvalContext & c,float s,float t,float r,float lod)412 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); }
texture2DArray(const ShaderEvalContext & c,float s,float t,float r,float lod)413 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); }
texture3D(const ShaderEvalContext & c,float s,float t,float r,float lod)414 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); }
texture1D(const ShaderEvalContext & c,float s,float lod)415 inline Vec4 texture1D (const ShaderEvalContext& c, float s, float lod) { return c.textures[0].tex1D->sample(c.textures[0].sampler, s, lod); }
texture1DArray(const ShaderEvalContext & c,float s,float t,float lod)416 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); }
textureCubeArray(const ShaderEvalContext & c,float s,float t,float r,float q,float lod)417 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); }
418
texture2DShadow(const ShaderEvalContext & c,float ref,float s,float t,float lod)419 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); }
textureCubeShadow(const ShaderEvalContext & c,float ref,float s,float t,float r,float lod)420 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); }
texture2DArrayShadow(const ShaderEvalContext & c,float ref,float s,float t,float r,float lod)421 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); }
texture1DShadow(const ShaderEvalContext & c,float ref,float s,float lod)422 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); }
texture1DArrayShadow(const ShaderEvalContext & c,float ref,float s,float t,float lod)423 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); }
textureCubeArrayShadow(const ShaderEvalContext & c,float ref,float s,float t,float r,float q,float lod)424 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); }
425
texture2DOffset(const ShaderEvalContext & c,float s,float t,float lod,IVec2 offset)426 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); }
texture2DArrayOffset(const ShaderEvalContext & c,float s,float t,float r,float lod,IVec2 offset)427 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); }
texture3DOffset(const ShaderEvalContext & c,float s,float t,float r,float lod,IVec3 offset)428 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); }
texture1DOffset(const ShaderEvalContext & c,float s,float lod,deInt32 offset)429 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); }
texture1DArrayOffset(const ShaderEvalContext & c,float s,float t,float lod,deInt32 offset)430 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); }
431
texture2DShadowOffset(const ShaderEvalContext & c,float ref,float s,float t,float lod,IVec2 offset)432 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); }
texture2DArrayShadowOffset(const ShaderEvalContext & c,float ref,float s,float t,float r,float lod,IVec2 offset)433 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); }
texture1DShadowOffset(const ShaderEvalContext & c,float ref,float s,float lod,deInt32 offset)434 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); }
texture1DArrayShadowOffset(const ShaderEvalContext & c,float ref,float s,float t,float lod,deInt32 offset)435 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); }
436
437 // Eval functions.
evalTexture2D(ShaderEvalContext & c,const TexLookupParams & p)438 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; }
evalTextureCube(ShaderEvalContext & c,const TexLookupParams & p)439 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; }
evalTexture2DArray(ShaderEvalContext & c,const TexLookupParams & p)440 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; }
evalTexture3D(ShaderEvalContext & c,const TexLookupParams & p)441 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; }
evalTexture1D(ShaderEvalContext & c,const TexLookupParams & p)442 static void evalTexture1D (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), p.lod)*p.scale + p.bias; }
evalTexture1DArray(ShaderEvalContext & c,const TexLookupParams & p)443 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; }
evalTextureCubeArray(ShaderEvalContext & c,const TexLookupParams & p)444 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; }
445
evalTexture2DBias(ShaderEvalContext & c,const TexLookupParams & p)446 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; }
evalTextureCubeBias(ShaderEvalContext & c,const TexLookupParams & p)447 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; }
evalTexture2DArrayBias(ShaderEvalContext & c,const TexLookupParams & p)448 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; }
evalTexture3DBias(ShaderEvalContext & c,const TexLookupParams & p)449 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; }
evalTexture1DBias(ShaderEvalContext & c,const TexLookupParams & p)450 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; }
evalTexture1DArrayBias(ShaderEvalContext & c,const TexLookupParams & p)451 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; }
evalTextureCubeArrayBias(ShaderEvalContext & c,const TexLookupParams & p)452 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; }
453
evalTexture2DProj3(ShaderEvalContext & c,const TexLookupParams & p)454 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; }
evalTexture2DProj3Bias(ShaderEvalContext & c,const TexLookupParams & p)455 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; }
evalTexture2DProj(ShaderEvalContext & c,const TexLookupParams & p)456 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; }
evalTexture2DProjBias(ShaderEvalContext & c,const TexLookupParams & p)457 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; }
evalTexture3DProj(ShaderEvalContext & c,const TexLookupParams & p)458 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; }
evalTexture3DProjBias(ShaderEvalContext & c,const TexLookupParams & p)459 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; }
evalTexture1DProj2(ShaderEvalContext & c,const TexLookupParams & p)460 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; }
evalTexture1DProj2Bias(ShaderEvalContext & c,const TexLookupParams & p)461 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; }
evalTexture1DProj(ShaderEvalContext & c,const TexLookupParams & p)462 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; }
evalTexture1DProjBias(ShaderEvalContext & c,const TexLookupParams & p)463 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; }
464
evalTexture2DLod(ShaderEvalContext & c,const TexLookupParams & p)465 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; }
evalTextureCubeLod(ShaderEvalContext & c,const TexLookupParams & p)466 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; }
evalTexture2DArrayLod(ShaderEvalContext & c,const TexLookupParams & p)467 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; }
evalTexture3DLod(ShaderEvalContext & c,const TexLookupParams & p)468 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; }
evalTexture1DLod(ShaderEvalContext & c,const TexLookupParams & p)469 static void evalTexture1DLod (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), c.in[1].x())*p.scale + p.bias; }
evalTexture1DArrayLod(ShaderEvalContext & c,const TexLookupParams & p)470 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; }
evalTextureCubeArrayLod(ShaderEvalContext & c,const TexLookupParams & p)471 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; }
472
evalTexture2DProjLod3(ShaderEvalContext & c,const TexLookupParams & p)473 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; }
evalTexture2DProjLod(ShaderEvalContext & c,const TexLookupParams & p)474 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; }
evalTexture3DProjLod(ShaderEvalContext & c,const TexLookupParams & p)475 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; }
evalTexture1DProjLod2(ShaderEvalContext & c,const TexLookupParams & p)476 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; }
evalTexture1DProjLod(ShaderEvalContext & c,const TexLookupParams & p)477 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; }
478
evalTexture2DBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)479 static void evalTexture2DBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp))*p.scale + p.bias; }
evalTextureCubeBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)480 static void evalTextureCubeBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCube(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(p.lod+c.in[1].x(), p.lodClamp))*p.scale + p.bias; }
evalTexture2DArrayBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)481 static void evalTexture2DArrayBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(p.lod+c.in[1].x(), p.lodClamp))*p.scale + p.bias; }
evalTexture3DBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)482 static void evalTexture3DBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(p.lod+c.in[1].x(), p.lodClamp))*p.scale + p.bias; }
evalTexture1DBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)483 static void evalTexture1DBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), de::max(p.lod+c.in[1].x(), p.lodClamp))*p.scale + p.bias; }
evalTexture1DArrayBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)484 static void evalTexture1DArrayBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArray(c, c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp))*p.scale + p.bias; }
evalTextureCubeArrayBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)485 static void evalTextureCubeArrayBiasClamp (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(), de::max(p.lod+c.in[1].x(), p.lodClamp))*p.scale + p.bias; }
486
487 // Offset variants
488
evalTexture2DOffset(ShaderEvalContext & c,const TexLookupParams & p)489 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; }
evalTexture2DArrayOffset(ShaderEvalContext & c,const TexLookupParams & p)490 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; }
evalTexture3DOffset(ShaderEvalContext & c,const TexLookupParams & p)491 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; }
evalTexture1DOffset(ShaderEvalContext & c,const TexLookupParams & p)492 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; }
evalTexture1DArrayOffset(ShaderEvalContext & c,const TexLookupParams & p)493 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; }
494
evalTexture2DOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)495 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; }
evalTexture2DArrayOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)496 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; }
evalTexture3DOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)497 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; }
evalTexture1DOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)498 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; }
evalTexture1DArrayOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)499 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; }
500
evalTexture2DLodOffset(ShaderEvalContext & c,const TexLookupParams & p)501 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; }
evalTexture2DArrayLodOffset(ShaderEvalContext & c,const TexLookupParams & p)502 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; }
evalTexture3DLodOffset(ShaderEvalContext & c,const TexLookupParams & p)503 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; }
evalTexture1DLodOffset(ShaderEvalContext & c,const TexLookupParams & p)504 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; }
evalTexture1DArrayLodOffset(ShaderEvalContext & c,const TexLookupParams & p)505 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; }
506
evalTexture2DProj3Offset(ShaderEvalContext & c,const TexLookupParams & p)507 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; }
evalTexture2DProj3OffsetBias(ShaderEvalContext & c,const TexLookupParams & p)508 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; }
evalTexture2DProjOffset(ShaderEvalContext & c,const TexLookupParams & p)509 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; }
evalTexture2DProjOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)510 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; }
evalTexture3DProjOffset(ShaderEvalContext & c,const TexLookupParams & p)511 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; }
evalTexture3DProjOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)512 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; }
evalTexture1DProj2Offset(ShaderEvalContext & c,const TexLookupParams & p)513 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; }
evalTexture1DProj2OffsetBias(ShaderEvalContext & c,const TexLookupParams & p)514 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; }
evalTexture1DProjOffset(ShaderEvalContext & c,const TexLookupParams & p)515 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; }
evalTexture1DProjOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)516 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; }
517
evalTexture2DProjLod3Offset(ShaderEvalContext & c,const TexLookupParams & p)518 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; }
evalTexture2DProjLodOffset(ShaderEvalContext & c,const TexLookupParams & p)519 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; }
evalTexture3DProjLodOffset(ShaderEvalContext & c,const TexLookupParams & p)520 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; }
evalTexture1DProjLod2Offset(ShaderEvalContext & c,const TexLookupParams & p)521 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; }
evalTexture1DProjLodOffset(ShaderEvalContext & c,const TexLookupParams & p)522 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; }
523
evalTexture2DOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)524 static void evalTexture2DOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset.swizzle(0,1))*p.scale + p.bias; }
evalTexture2DArrayOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)525 static void evalTexture2DArrayOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArrayOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset.swizzle(0,1))*p.scale + p.bias; }
evalTexture3DOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)526 static void evalTexture3DOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset)*p.scale + p.bias; }
evalTexture1DOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)527 static void evalTexture1DOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset.x())*p.scale + p.bias; }
evalTexture1DArrayOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)528 static void evalTexture1DArrayOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArrayOffset(c, c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset.x())*p.scale + p.bias; }
529
530 // Shadow variants
531
evalTexture2DShadow(ShaderEvalContext & c,const TexLookupParams & p)532 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); }
evalTexture2DShadowBias(ShaderEvalContext & c,const TexLookupParams & p)533 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()); }
534
evalTextureCubeShadow(ShaderEvalContext & c,const TexLookupParams & p)535 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); }
evalTextureCubeShadowBias(ShaderEvalContext & c,const TexLookupParams & p)536 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()); }
537
evalTexture2DArrayShadow(ShaderEvalContext & c,const TexLookupParams & p)538 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); }
evalTexture1DShadow(ShaderEvalContext & c,const TexLookupParams & p)539 static void evalTexture1DShadow (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), p.lod); }
evalTexture1DShadowBias(ShaderEvalContext & c,const TexLookupParams & p)540 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()); }
evalTexture1DArrayShadow(ShaderEvalContext & c,const TexLookupParams & p)541 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); }
evalTexture1DArrayShadowBias(ShaderEvalContext & c,const TexLookupParams & p)542 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()); }
evalTextureCubeArrayShadow(ShaderEvalContext & c,const TexLookupParams & p)543 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); }
544
evalTexture2DShadowLod(ShaderEvalContext & c,const TexLookupParams &)545 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()); }
evalTexture2DShadowLodOffset(ShaderEvalContext & c,const TexLookupParams & p)546 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)); }
evalTexture1DShadowLod(ShaderEvalContext & c,const TexLookupParams &)547 static void evalTexture1DShadowLod (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), c.in[1].x()); }
evalTexture1DShadowLodOffset(ShaderEvalContext & c,const TexLookupParams & p)548 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()); }
evalTexture1DArrayShadowLod(ShaderEvalContext & c,const TexLookupParams &)549 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()); }
evalTexture1DArrayShadowLodOffset(ShaderEvalContext & c,const TexLookupParams & p)550 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()); }
551
evalTexture2DShadowProj(ShaderEvalContext & c,const TexLookupParams & p)552 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); }
evalTexture2DShadowProjBias(ShaderEvalContext & c,const TexLookupParams & p)553 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()); }
evalTexture1DShadowProj(ShaderEvalContext & c,const TexLookupParams & p)554 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); }
evalTexture1DShadowProjBias(ShaderEvalContext & c,const TexLookupParams & p)555 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()); }
556
evalTexture2DShadowProjLod(ShaderEvalContext & c,const TexLookupParams &)557 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()); }
evalTexture2DShadowProjLodOffset(ShaderEvalContext & c,const TexLookupParams & p)558 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)); }
evalTexture1DShadowProjLod(ShaderEvalContext & c,const TexLookupParams &)559 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()); }
evalTexture1DShadowProjLodOffset(ShaderEvalContext & c,const TexLookupParams & p)560 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()); }
561
evalTexture2DShadowOffset(ShaderEvalContext & c,const TexLookupParams & p)562 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)); }
evalTexture2DShadowOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)563 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)); }
evalTexture2DArrayShadowOffset(ShaderEvalContext & c,const TexLookupParams & p)564 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)); }
evalTexture1DShadowOffset(ShaderEvalContext & c,const TexLookupParams & p)565 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()); }
evalTexture1DShadowOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)566 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()); }
evalTexture1DArrayShadowOffset(ShaderEvalContext & c,const TexLookupParams & p)567 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()); }
evalTexture1DArrayShadowOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)568 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()); }
569
evalTexture2DShadowProjOffset(ShaderEvalContext & c,const TexLookupParams & p)570 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)); }
evalTexture2DShadowProjOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)571 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)); }
evalTexture1DShadowProjOffset(ShaderEvalContext & c,const TexLookupParams & p)572 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()); }
evalTexture1DShadowProjOffsetBias(ShaderEvalContext & c,const TexLookupParams & p)573 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()); }
574
evalTexture2DShadowBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)575 static void evalTexture2DShadowBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp)); }
evalTextureCubeShadowBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)576 static void evalTextureCubeShadowBiasClamp (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(), de::max(p.lod+c.in[1].x(), p.lodClamp)); }
evalTexture1DShadowBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)577 static void evalTexture1DShadowBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), de::max(p.lod+c.in[1].x(), p.lodClamp)); }
evalTexture1DArrayShadowBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)578 static void evalTexture1DArrayShadowBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp)); }
evalTexture2DShadowOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)579 static void evalTexture2DShadowOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset.swizzle(0,1)); }
evalTexture1DShadowOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)580 static void evalTexture1DShadowOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z(), c.in[0].x(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset.x()); }
evalTexture1DArrayShadowOffsetBiasClamp(ShaderEvalContext & c,const TexLookupParams & p)581 static void evalTexture1DArrayShadowOffsetBiasClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(p.lod+c.in[1].x(), p.lodClamp), p.offset.x()); }
582
583 // Gradient variarts
584
evalTexture2DGrad(ShaderEvalContext & c,const TexLookupParams & p)585 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; }
evalTextureCubeGrad(ShaderEvalContext & c,const TexLookupParams & p)586 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; }
evalTexture2DArrayGrad(ShaderEvalContext & c,const TexLookupParams & p)587 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; }
evalTexture3DGrad(ShaderEvalContext & c,const TexLookupParams & p)588 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; }
evalTexture1DGrad(ShaderEvalContext & c,const TexLookupParams & p)589 static void evalTexture1DGrad (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), computeLodFromGrad1D(c))*p.scale + p.bias; }
evalTexture1DArrayGrad(ShaderEvalContext & c,const TexLookupParams & p)590 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; }
evalTextureCubeArrayGrad(ShaderEvalContext & c,const TexLookupParams & p)591 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; }
592
evalTexture2DShadowGrad(ShaderEvalContext & c,const TexLookupParams &)593 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)); }
evalTextureCubeShadowGrad(ShaderEvalContext & c,const TexLookupParams &)594 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)); }
evalTexture2DArrayShadowGrad(ShaderEvalContext & c,const TexLookupParams &)595 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)); }
evalTexture1DShadowGrad(ShaderEvalContext & c,const TexLookupParams &)596 static void evalTexture1DShadowGrad (ShaderEvalContext& c, const TexLookupParams&) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), computeLodFromGrad1D(c)); }
evalTexture1DArrayShadowGrad(ShaderEvalContext & c,const TexLookupParams &)597 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)); }
598
evalTexture2DGradOffset(ShaderEvalContext & c,const TexLookupParams & p)599 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; }
evalTexture2DArrayGradOffset(ShaderEvalContext & c,const TexLookupParams & p)600 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; }
evalTexture3DGradOffset(ShaderEvalContext & c,const TexLookupParams & p)601 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; }
evalTexture1DGradOffset(ShaderEvalContext & c,const TexLookupParams & p)602 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; }
evalTexture1DArrayGradOffset(ShaderEvalContext & c,const TexLookupParams & p)603 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; }
604
evalTexture2DShadowGradOffset(ShaderEvalContext & c,const TexLookupParams & p)605 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)); }
evalTexture2DArrayShadowGradOffset(ShaderEvalContext & c,const TexLookupParams & p)606 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)); }
evalTexture1DShadowGradOffset(ShaderEvalContext & c,const TexLookupParams & p)607 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()); }
evalTexture1DArrayShadowGradOffset(ShaderEvalContext & c,const TexLookupParams & p)608 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()); }
609
evalTexture2DShadowProjGrad(ShaderEvalContext & c,const TexLookupParams &)610 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)); }
evalTexture2DShadowProjGradOffset(ShaderEvalContext & c,const TexLookupParams & p)611 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)); }
evalTexture1DShadowProjGrad(ShaderEvalContext & c,const TexLookupParams &)612 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)); }
evalTexture1DShadowProjGradOffset(ShaderEvalContext & c,const TexLookupParams & p)613 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()); }
614
evalTexture2DProjGrad3(ShaderEvalContext & c,const TexLookupParams & p)615 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; }
evalTexture2DProjGrad(ShaderEvalContext & c,const TexLookupParams & p)616 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; }
evalTexture3DProjGrad(ShaderEvalContext & c,const TexLookupParams & p)617 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; }
evalTexture1DProjGrad2(ShaderEvalContext & c,const TexLookupParams & p)618 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; }
evalTexture1DProjGrad(ShaderEvalContext & c,const TexLookupParams & p)619 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; }
620
evalTexture2DProjGrad3Offset(ShaderEvalContext & c,const TexLookupParams & p)621 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; }
evalTexture2DProjGradOffset(ShaderEvalContext & c,const TexLookupParams & p)622 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; }
evalTexture3DProjGradOffset(ShaderEvalContext & c,const TexLookupParams & p)623 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; }
evalTexture1DProjGrad2Offset(ShaderEvalContext & c,const TexLookupParams & p)624 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; }
evalTexture1DProjGradOffset(ShaderEvalContext & c,const TexLookupParams & p)625 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; }
626
evalTexture2DGradClamp(ShaderEvalContext & c,const TexLookupParams & p)627 static void evalTexture2DGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2D(c, c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad2D(c), p.lodClamp))*p.scale + p.bias; }
evalTextureCubeGradClamp(ShaderEvalContext & c,const TexLookupParams & p)628 static void evalTextureCubeGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = textureCube(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(computeLodFromGradCube(c), p.lodClamp))*p.scale + p.bias; }
evalTexture2DArrayGradClamp(ShaderEvalContext & c,const TexLookupParams & p)629 static void evalTexture2DArrayGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArray(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(computeLodFromGrad2DArray(c), p.lodClamp))*p.scale + p.bias; }
evalTexture3DGradClamp(ShaderEvalContext & c,const TexLookupParams & p)630 static void evalTexture3DGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3D(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(computeLodFromGrad3D(c), p.lodClamp))*p.scale + p.bias; }
evalTexture1DGradClamp(ShaderEvalContext & c,const TexLookupParams & p)631 static void evalTexture1DGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1D(c, c.in[0].x(), de::max(computeLodFromGrad1D(c), p.lodClamp))*p.scale + p.bias; }
evalTexture1DArrayGradClamp(ShaderEvalContext & c,const TexLookupParams & p)632 static void evalTexture1DArrayGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArray(c, c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad1DArray(c), p.lodClamp))*p.scale + p.bias; }
evalTextureCubeArrayGradClamp(ShaderEvalContext & c,const TexLookupParams & p)633 static void evalTextureCubeArrayGradClamp (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(), de::max(computeLodFromGradCubeArray(c), p.lodClamp))*p.scale + p.bias; }
634
evalTexture2DShadowGradClamp(ShaderEvalContext & c,const TexLookupParams & p)635 static void evalTexture2DShadowGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad2D(c), p.lodClamp)); }
evalTextureCubeShadowGradClamp(ShaderEvalContext & c,const TexLookupParams & p)636 static void evalTextureCubeShadowGradClamp (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(), de::max(computeLodFromGradCube(c), p.lodClamp)); }
evalTexture2DArrayShadowGradClamp(ShaderEvalContext & c,const TexLookupParams & p)637 static void evalTexture2DArrayShadowGradClamp (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(), de::max(computeLodFromGrad2DArray(c), p.lodClamp)); }
evalTexture1DShadowGradClamp(ShaderEvalContext & c,const TexLookupParams & p)638 static void evalTexture1DShadowGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadow(c, c.in[0].z(), c.in[0].x(), de::max(computeLodFromGrad1D(c), p.lodClamp)); }
evalTexture1DArrayShadowGradClamp(ShaderEvalContext & c,const TexLookupParams & p)639 static void evalTexture1DArrayShadowGradClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadow(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad1DArray(c), p.lodClamp)); }
640
evalTexture2DGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)641 static void evalTexture2DGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DOffset(c, c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad2D(c), p.lodClamp), p.offset.swizzle(0,1))*p.scale + p.bias; }
evalTexture2DArrayGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)642 static void evalTexture2DArrayGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture2DArrayOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(computeLodFromGrad2DArray(c), p.lodClamp), p.offset.swizzle(0,1))*p.scale + p.bias; }
evalTexture3DGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)643 static void evalTexture3DGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture3DOffset(c, c.in[0].x(), c.in[0].y(), c.in[0].z(), de::max(computeLodFromGrad3D(c), p.lodClamp), p.offset)*p.scale + p.bias; }
evalTexture1DGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)644 static void evalTexture1DGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DOffset(c, c.in[0].x(), de::max(computeLodFromGrad1D(c), p.lodClamp), p.offset.x())*p.scale + p.bias; }
evalTexture1DArrayGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)645 static void evalTexture1DArrayGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color = texture1DArrayOffset(c, c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad1DArray(c), p.lodClamp), p.offset.x())*p.scale + p.bias; }
646
evalTexture2DShadowGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)647 static void evalTexture2DShadowGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture2DShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad2D(c), p.lodClamp), p.offset.swizzle(0,1)); }
evalTexture2DArrayShadowGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)648 static void evalTexture2DArrayShadowGradOffsetClamp (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(), de::max(computeLodFromGrad2DArray(c), p.lodClamp), p.offset.swizzle(0,1)); }
evalTexture1DShadowGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)649 static void evalTexture1DShadowGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DShadowOffset(c, c.in[0].z(), c.in[0].x(), de::max(computeLodFromGrad1D(c), p.lodClamp), p.offset.x()); }
evalTexture1DArrayShadowGradOffsetClamp(ShaderEvalContext & c,const TexLookupParams & p)650 static void evalTexture1DArrayShadowGradOffsetClamp (ShaderEvalContext& c, const TexLookupParams& p) { c.color.x() = texture1DArrayShadowOffset(c, c.in[0].z(), c.in[0].x(), c.in[0].y(), de::max(computeLodFromGrad1DArray(c), p.lodClamp), p.offset.x()); }
651
652 // Texel fetch variants
653
evalTexelFetch2D(ShaderEvalContext & c,const TexLookupParams & p)654 static void evalTexelFetch2D (ShaderEvalContext& c, const TexLookupParams& p)
655 {
656 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
657 int y = deChopFloatToInt32(c.in[0].y())+p.offset.y();
658 int lod = deChopFloatToInt32(c.in[1].x());
659 c.color = c.textures[0].tex2D->getLevel(lod).getPixel(x, y)*p.scale + p.bias;
660 }
661
evalTexelFetch2DArray(ShaderEvalContext & c,const TexLookupParams & p)662 static void evalTexelFetch2DArray (ShaderEvalContext& c, const TexLookupParams& p)
663 {
664 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
665 int y = deChopFloatToInt32(c.in[0].y())+p.offset.y();
666 int l = deChopFloatToInt32(c.in[0].z());
667 int lod = deChopFloatToInt32(c.in[1].x());
668 c.color = c.textures[0].tex2DArray->getLevel(lod).getPixel(x, y, l)*p.scale + p.bias;
669 }
670
evalTexelFetch3D(ShaderEvalContext & c,const TexLookupParams & p)671 static void evalTexelFetch3D (ShaderEvalContext& c, const TexLookupParams& p)
672 {
673 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
674 int y = deChopFloatToInt32(c.in[0].y())+p.offset.y();
675 int z = deChopFloatToInt32(c.in[0].z())+p.offset.z();
676 int lod = deChopFloatToInt32(c.in[1].x());
677 c.color = c.textures[0].tex3D->getLevel(lod).getPixel(x, y, z)*p.scale + p.bias;
678 }
679
evalTexelFetch1D(ShaderEvalContext & c,const TexLookupParams & p)680 static void evalTexelFetch1D (ShaderEvalContext& c, const TexLookupParams& p)
681 {
682 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
683 int lod = deChopFloatToInt32(c.in[1].x());
684 c.color = c.textures[0].tex1D->getLevel(lod).getPixel(x, 0)*p.scale + p.bias;
685 }
686
evalTexelFetch1DArray(ShaderEvalContext & c,const TexLookupParams & p)687 static void evalTexelFetch1DArray (ShaderEvalContext& c, const TexLookupParams& p)
688 {
689 int x = deChopFloatToInt32(c.in[0].x())+p.offset.x();
690 int l = deChopFloatToInt32(c.in[0].y());
691 int lod = deChopFloatToInt32(c.in[1].x());
692 c.color = c.textures[0].tex1DArray->getLevel(lod).getPixel(x, l)*p.scale + p.bias;
693 }
694
695 class TexLookupEvaluator : public ShaderEvaluator
696 {
697 public:
TexLookupEvaluator(TexEvalFunc evalFunc,const TexLookupParams & lookupParams)698 TexLookupEvaluator (TexEvalFunc evalFunc, const TexLookupParams& lookupParams) : m_evalFunc(evalFunc), m_lookupParams(lookupParams) {}
~TexLookupEvaluator(void)699 virtual ~TexLookupEvaluator (void) {}
700
evaluate(ShaderEvalContext & ctx) const701 virtual void evaluate (ShaderEvalContext& ctx) const { m_evalFunc(ctx, m_lookupParams); }
702
703 private:
704 TexEvalFunc m_evalFunc;
705 const TexLookupParams& m_lookupParams;
706 };
707
checkDeviceFeatures(Context & context,TextureType textureType)708 static void checkDeviceFeatures (Context& context, TextureType textureType)
709 {
710 if (textureType == TEXTURETYPE_CUBE_ARRAY)
711 {
712 const vk::VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
713
714 if (!deviceFeatures.imageCubeArray)
715 TCU_THROW(NotSupportedError, "Cube array is not supported");
716 }
717 }
718
checkMutableComparisonSamplersSupport(Context & context,const TextureSpec & textureSpec)719 static void checkMutableComparisonSamplersSupport(Context& context, const TextureSpec& textureSpec)
720 {
721 // when compare mode is not none then ShaderRenderCaseInstance::createSamplerUniform
722 // uses mapSampler utill from vkImageUtil that sets compareEnable to true
723 // for portability this needs to be under feature flag
724 if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
725 !context.getPortabilitySubsetFeatures().mutableComparisonSamplers &&
726 (textureSpec.sampler.compare != tcu::Sampler::COMPAREMODE_NONE))
727 {
728 TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: mutableComparisonSamplers are not supported by this implementation");
729 }
730 }
731
732 class ShaderTextureFunctionInstance : public ShaderRenderCaseInstance
733 {
734 public:
735 ShaderTextureFunctionInstance (Context& context,
736 const bool isVertexCase,
737 const ShaderEvaluator& evaluator,
738 const UniformSetup& uniformSetup,
739 const TextureLookupSpec& lookupSpec,
740 const TextureSpec& textureSpec,
741 const TexLookupParams& lookupParams,
742 const ImageBackingMode imageBackingMode = IMAGE_BACKING_MODE_REGULAR);
743 virtual ~ShaderTextureFunctionInstance (void);
744
745 protected:
746 virtual void setupUniforms (const tcu::Vec4&);
747 void initTexture (void);
748 private:
749 const TextureLookupSpec& m_lookupSpec;
750 const TextureSpec& m_textureSpec;
751 const TexLookupParams& m_lookupParams;
752 };
753
ShaderTextureFunctionInstance(Context & context,const bool isVertexCase,const ShaderEvaluator & evaluator,const UniformSetup & uniformSetup,const TextureLookupSpec & lookupSpec,const TextureSpec & textureSpec,const TexLookupParams & lookupParams,const ImageBackingMode imageBackingMode)754 ShaderTextureFunctionInstance::ShaderTextureFunctionInstance (Context& context,
755 const bool isVertexCase,
756 const ShaderEvaluator& evaluator,
757 const UniformSetup& uniformSetup,
758 const TextureLookupSpec& lookupSpec,
759 const TextureSpec& textureSpec,
760 const TexLookupParams& lookupParams,
761 const ImageBackingMode imageBackingMode)
762 : ShaderRenderCaseInstance (context, isVertexCase, evaluator, uniformSetup, DE_NULL, imageBackingMode,
763 (isVertexCase ? 92 : GRID_SIZE_DEFAULT_FRAGMENT))
764 , m_lookupSpec (lookupSpec)
765 , m_textureSpec (textureSpec)
766 , m_lookupParams (lookupParams)
767 {
768 checkDeviceFeatures(m_context, m_textureSpec.type);
769
770 if (lookupSpec.useClamp)
771 {
772 const vk::VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
773
774 if (!deviceFeatures.shaderResourceMinLod)
775 TCU_THROW(NotSupportedError, "ShaderResourceMinLod feature not supported.");
776 }
777
778 {
779 // Base coord scale & bias
780 Vec4 s = m_lookupSpec.maxCoord-m_lookupSpec.minCoord;
781 Vec4 b = m_lookupSpec.minCoord;
782
783 float baseCoordTrans[] =
784 {
785 s.x(), 0.0f, 0.f, b.x(),
786 0.f, s.y(), 0.f, b.y(),
787 s.z()/2.f, -s.z()/2.f, 0.f, s.z()/2.f + b.z(),
788 -s.w()/2.f, s.w()/2.f, 0.f, s.w()/2.f + b.w()
789 };
790
791 m_userAttribTransforms.push_back(tcu::Mat4(baseCoordTrans));
792
793 useAttribute(4u, A_IN0);
794 }
795
796 bool hasLodBias = functionHasLod(m_lookupSpec.function) || m_lookupSpec.useBias;
797 bool isGrad = functionHasGrad(m_lookupSpec.function);
798 DE_ASSERT(!isGrad || !hasLodBias);
799
800 if (hasLodBias)
801 {
802 float s = m_lookupSpec.maxLodBias-m_lookupSpec.minLodBias;
803 float b = m_lookupSpec.minLodBias;
804 float lodCoordTrans[] =
805 {
806 s/2.0f, s/2.0f, 0.f, b,
807 0.0f, 0.0f, 0.0f, 0.0f,
808 0.0f, 0.0f, 0.0f, 0.0f,
809 0.0f, 0.0f, 0.0f, 0.0f
810 };
811
812 m_userAttribTransforms.push_back(tcu::Mat4(lodCoordTrans));
813
814 useAttribute(5u, A_IN1);
815 }
816 else if (isGrad)
817 {
818 Vec3 sx = m_lookupSpec.maxDX-m_lookupSpec.minDX;
819 Vec3 sy = m_lookupSpec.maxDY-m_lookupSpec.minDY;
820 float gradDxTrans[] =
821 {
822 sx.x()/2.0f, sx.x()/2.0f, 0.f, m_lookupSpec.minDX.x(),
823 sx.y()/2.0f, sx.y()/2.0f, 0.0f, m_lookupSpec.minDX.y(),
824 sx.z()/2.0f, sx.z()/2.0f, 0.0f, m_lookupSpec.minDX.z(),
825 0.0f, 0.0f, 0.0f, 0.0f
826 };
827 float gradDyTrans[] =
828 {
829 -sy.x()/2.0f, -sy.x()/2.0f, 0.f, m_lookupSpec.maxDY.x(),
830 -sy.y()/2.0f, -sy.y()/2.0f, 0.0f, m_lookupSpec.maxDY.y(),
831 -sy.z()/2.0f, -sy.z()/2.0f, 0.0f, m_lookupSpec.maxDY.z(),
832 0.0f, 0.0f, 0.0f, 0.0f
833 };
834
835 m_userAttribTransforms.push_back(tcu::Mat4(gradDxTrans));
836 m_userAttribTransforms.push_back(tcu::Mat4(gradDyTrans));
837
838 useAttribute(5u, A_IN1);
839 useAttribute(6u, A_IN2);
840 }
841
842 initTexture();
843 }
844
~ShaderTextureFunctionInstance(void)845 ShaderTextureFunctionInstance::~ShaderTextureFunctionInstance (void)
846 {
847 }
848
setupUniforms(const tcu::Vec4 &)849 void ShaderTextureFunctionInstance::setupUniforms (const tcu::Vec4&)
850 {
851 useSampler(0u, 0u);
852 addUniform(1u, vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, sizeof(tcu::Vec4), m_lookupParams.scale.getPtr());
853 addUniform(2u, vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, sizeof(tcu::Vec4), m_lookupParams.bias.getPtr());
854 }
855
initTexture(void)856 void ShaderTextureFunctionInstance::initTexture (void)
857 {
858 static const IVec4 texCubeSwz[] =
859 {
860 IVec4(0,0,1,1),
861 IVec4(1,1,0,0),
862 IVec4(0,1,0,1),
863 IVec4(1,0,1,0),
864 IVec4(0,1,1,0),
865 IVec4(1,0,0,1)
866 };
867 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(texCubeSwz) == tcu::CUBEFACE_LAST);
868
869 tcu::TextureFormat texFmt = glu::mapGLInternalFormat(m_textureSpec.format);
870 tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFmt);
871 tcu::UVec2 viewportSize = getViewportSize();
872 bool isProj = functionHasProj(m_lookupSpec.function);
873 bool isAutoLod = functionHasAutoLod(m_isVertexCase ? glu::SHADERTYPE_VERTEX : glu::SHADERTYPE_FRAGMENT,
874 m_lookupSpec.function); // LOD can vary significantly
875 float proj = isProj ? 1.0f/m_lookupSpec.minCoord[m_lookupSpec.function == FUNCTION_TEXTUREPROJ2 ? 1 : m_lookupSpec.function == FUNCTION_TEXTUREPROJ3 ? 2 : 3] : 1.0f;
876 TexLookupParams lookupParams;
877
878 switch (m_textureSpec.type)
879 {
880 case TEXTURETYPE_2D:
881 {
882 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
883 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
884 Vec4 cBias = fmtInfo.valueMin;
885 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
886 de::MovePtr<tcu::Texture2D> texture2D;
887
888 texture2D = de::MovePtr<tcu::Texture2D>(new tcu::Texture2D(texFmt, m_textureSpec.width, m_textureSpec.height));
889
890 for (int level = 0; level < m_textureSpec.numLevels; level++)
891 {
892 float fA = float(level)*levelStep;
893 float fB = 1.0f-fA;
894 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
895 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
896
897 texture2D->allocLevel(level);
898 tcu::fillWithGrid(texture2D->getLevel(level), de::max(1, baseCellSize>>level), colorA, colorB);
899 }
900
901 // Compute LOD.
902 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
903 float dvdy = (m_lookupSpec.maxCoord[1]-m_lookupSpec.minCoord[1])*proj*(float)m_textureSpec.height / (float)viewportSize[1];
904 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
905
906 // Append to texture list.
907 m_textures.push_back(TextureBindingSp(new TextureBinding(texture2D.release(), m_textureSpec.sampler)));
908 break;
909 }
910
911 case TEXTURETYPE_CUBE_MAP:
912 {
913 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
914 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
915 Vec4 cBias = fmtInfo.valueMin;
916 Vec4 cCorner = cBias + cScale*0.5f;
917 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
918 de::MovePtr<tcu::TextureCube> textureCube;
919
920 DE_ASSERT(m_textureSpec.width == m_textureSpec.height);
921 textureCube = de::MovePtr<tcu::TextureCube>(new tcu::TextureCube(texFmt, m_textureSpec.width));
922
923 for (int level = 0; level < m_textureSpec.numLevels; level++)
924 {
925 float fA = float(level)*levelStep;
926 float fB = 1.0f-fA;
927 Vec2 f (fA, fB);
928
929 for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
930 {
931 const IVec4& swzA = texCubeSwz[face];
932 IVec4 swzB = 1-swzA;
933 Vec4 colorA = cBias + cScale*f.swizzle(swzA[0], swzA[1], swzA[2], swzA[3]);
934 Vec4 colorB = cBias + cScale*f.swizzle(swzB[0], swzB[1], swzB[2], swzB[3]);
935
936 textureCube->allocLevel((tcu::CubeFace)face, level);
937
938 {
939 const tcu::PixelBufferAccess access = textureCube->getLevelFace(level, (tcu::CubeFace)face);
940 const int lastPix = access.getWidth()-1;
941
942 tcu::fillWithGrid(access, de::max(1, baseCellSize>>level), colorA, colorB);
943
944 // Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering
945 access.setPixel(cCorner, 0, 0);
946 access.setPixel(cCorner, 0, lastPix);
947 access.setPixel(cCorner, lastPix, 0);
948 access.setPixel(cCorner, lastPix, lastPix);
949 }
950 }
951 }
952
953 // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
954 DE_ASSERT(de::abs(m_lookupSpec.minCoord[2] - m_lookupSpec.maxCoord[2]) < 0.005);
955 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]));
956 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]));
957
958 tcu::CubeFaceFloatCoords c00 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
959 tcu::CubeFaceFloatCoords c10 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.maxCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
960 tcu::CubeFaceFloatCoords c01 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.maxCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
961 float dudx = (c10.s - c00.s)*(float)m_textureSpec.width / (float)viewportSize[0];
962 float dvdy = (c01.t - c00.t)*(float)m_textureSpec.height / (float)viewportSize[1];
963 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
964
965 // Append to texture list.
966 m_textures.push_back(TextureBindingSp(new TextureBinding(textureCube.release(), m_textureSpec.sampler)));
967 break;
968 }
969
970 case TEXTURETYPE_2D_ARRAY:
971 {
972 float layerStep = 1.0f / (float)m_textureSpec.depth;
973 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)(de::max(1, m_textureSpec.numLevels-1)*m_textureSpec.depth);
974 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
975 Vec4 cBias = fmtInfo.valueMin;
976 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
977 de::MovePtr<tcu::Texture2DArray> texture2DArray;
978
979 texture2DArray = de::MovePtr<tcu::Texture2DArray>(new tcu::Texture2DArray(texFmt, m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth));
980
981 for (int level = 0; level < m_textureSpec.numLevels; level++)
982 {
983 texture2DArray->allocLevel(level);
984 tcu::PixelBufferAccess levelAccess = texture2DArray->getLevel(level);
985
986 for (int layer = 0; layer < levelAccess.getDepth(); layer++)
987 {
988 float fA = (float)layer*layerStep + (float)level*levelStep;
989 float fB = 1.0f-fA;
990 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
991 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
992
993 tcu::fillWithGrid(tcu::getSubregion(levelAccess, 0, 0, layer, levelAccess.getWidth(), levelAccess.getHeight(), 1), de::max(1, baseCellSize>>level), colorA, colorB);
994 }
995 }
996
997 // Compute LOD.
998 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
999 float dvdy = (m_lookupSpec.maxCoord[1]-m_lookupSpec.minCoord[1])*proj*(float)m_textureSpec.height / (float)viewportSize[1];
1000 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
1001
1002 // Append to texture list.
1003 m_textures.push_back(TextureBindingSp(new TextureBinding(texture2DArray.release(), m_textureSpec.sampler)));
1004 break;
1005 }
1006
1007 case TEXTURETYPE_3D:
1008 {
1009 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
1010 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
1011 Vec4 cBias = fmtInfo.valueMin;
1012 int baseCellSize = de::min(de::min(m_textureSpec.width/2, m_textureSpec.height/2), m_textureSpec.depth/2);
1013 de::MovePtr<tcu::Texture3D> texture3D;
1014
1015 texture3D = de::MovePtr<tcu::Texture3D>(new tcu::Texture3D(texFmt, m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth));
1016
1017 for (int level = 0; level < m_textureSpec.numLevels; level++)
1018 {
1019 float fA = (float)level*levelStep;
1020 float fB = 1.0f-fA;
1021 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
1022 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
1023
1024 texture3D->allocLevel(level);
1025 tcu::fillWithGrid(texture3D->getLevel(level), de::max(1, baseCellSize>>level), colorA, colorB);
1026 }
1027
1028 // Compute LOD.
1029 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
1030 float dvdy = (m_lookupSpec.maxCoord[1]-m_lookupSpec.minCoord[1])*proj*(float)m_textureSpec.height / (float)viewportSize[1];
1031 float dwdx = (m_lookupSpec.maxCoord[2]-m_lookupSpec.minCoord[2])*0.5f*proj*(float)m_textureSpec.depth / (float)viewportSize[0];
1032 float dwdy = (m_lookupSpec.maxCoord[2]-m_lookupSpec.minCoord[2])*0.5f*proj*(float)m_textureSpec.depth / (float)viewportSize[1];
1033 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, dwdx, 0.0f, dvdy, dwdy);
1034
1035 // Append to texture list.
1036 m_textures.push_back(TextureBindingSp(new TextureBinding(texture3D.release(), m_textureSpec.sampler)));
1037 break;
1038 }
1039
1040 case TEXTURETYPE_1D:
1041 {
1042 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
1043 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
1044 Vec4 cBias = fmtInfo.valueMin;
1045 int baseCellSize = m_textureSpec.width/4;
1046 de::MovePtr<tcu::Texture1D> texture1D;
1047
1048 texture1D = de::MovePtr<tcu::Texture1D>(new tcu::Texture1D(texFmt, m_textureSpec.width));
1049
1050 for (int level = 0; level < m_textureSpec.numLevels; level++)
1051 {
1052 float fA = float(level)*levelStep;
1053 float fB = 1.0f-fA;
1054 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
1055 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
1056
1057 texture1D->allocLevel(level);
1058 tcu::fillWithGrid(texture1D->getLevel(level), de::max(1, baseCellSize>>level), colorA, colorB);
1059 }
1060
1061 // Compute LOD.
1062 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
1063 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f);
1064
1065 // Append to texture list.
1066 m_textures.push_back(TextureBindingSp(new TextureBinding(texture1D.release(), m_textureSpec.sampler)));
1067 break;
1068 }
1069
1070 case TEXTURETYPE_1D_ARRAY:
1071 {
1072 float layerStep = 1.0f / (float)m_textureSpec.depth;
1073 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)(de::max(1, m_textureSpec.numLevels-1)*m_textureSpec.depth);
1074 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
1075 Vec4 cBias = fmtInfo.valueMin;
1076 int baseCellSize = m_textureSpec.width/4;
1077 de::MovePtr<tcu::Texture1DArray> texture1DArray;
1078
1079 texture1DArray = de::MovePtr<tcu::Texture1DArray>(new tcu::Texture1DArray(texFmt, m_textureSpec.width, m_textureSpec.depth));
1080
1081 for (int level = 0; level < m_textureSpec.numLevels; level++)
1082 {
1083 texture1DArray->allocLevel(level);
1084 tcu::PixelBufferAccess levelAccess = texture1DArray->getLevel(level);
1085
1086 for (int layer = 0; layer < levelAccess.getHeight(); layer++)
1087 {
1088 float fA = (float)layer*layerStep + (float)level*levelStep;
1089 float fB = 1.0f-fA;
1090 Vec4 colorA = cBias + cScale*Vec4(fA, fB, fA, fB);
1091 Vec4 colorB = cBias + cScale*Vec4(fB, fA, fB, fA);
1092
1093 tcu::fillWithGrid(tcu::getSubregion(levelAccess, 0, layer, 0, levelAccess.getWidth(), 1, 1), de::max(1, baseCellSize>>level), colorA, colorB);
1094 }
1095 }
1096
1097 // Compute LOD.
1098 float dudx = (m_lookupSpec.maxCoord[0]-m_lookupSpec.minCoord[0])*proj*(float)m_textureSpec.width / (float)viewportSize[0];
1099 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f);
1100
1101 // Append to texture list.
1102 m_textures.push_back(TextureBindingSp(new TextureBinding(texture1DArray.release(), m_textureSpec.sampler)));
1103 break;
1104 }
1105
1106 case TEXTURETYPE_CUBE_ARRAY:
1107 {
1108 float layerStep = 1.0f / (float)(m_textureSpec.depth/6);
1109 float levelStep = isAutoLod ? 0.0f : 1.0f / (float)(de::max(1, m_textureSpec.numLevels-1)*(m_textureSpec.depth/6));
1110 Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
1111 Vec4 cBias = fmtInfo.valueMin;
1112 Vec4 cCorner = cBias + cScale*0.5f;
1113 int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
1114 de::MovePtr<tcu::TextureCubeArray> textureCubeArray;
1115
1116 DE_ASSERT(m_textureSpec.width == m_textureSpec.height);
1117 DE_ASSERT(m_textureSpec.depth % 6 == 0);
1118
1119 textureCubeArray = de::MovePtr<tcu::TextureCubeArray>(new tcu::TextureCubeArray(texFmt, m_textureSpec.width, m_textureSpec.depth));
1120
1121 for (int level = 0; level < m_textureSpec.numLevels; level++)
1122 {
1123 float fA = float(level)*levelStep;
1124 float fB = 1.0f-fA;
1125 Vec2 f (fA, fB);
1126
1127 textureCubeArray->allocLevel(level);
1128 tcu::PixelBufferAccess levelAccess = textureCubeArray->getLevel(level);
1129
1130 for (int layer = 0; layer < m_textureSpec.depth/6; layer++)
1131 {
1132 float layerCorr = 1.0f-(float)layer*layerStep;
1133
1134 for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
1135 {
1136 const IVec4& swzA = texCubeSwz[face];
1137 IVec4 swzB = 1-swzA;
1138 Vec4 colorA = cBias + cScale*f.swizzle(swzA[0], swzA[1], swzA[2], swzA[3])*layerCorr;
1139 Vec4 colorB = cBias + cScale*f.swizzle(swzB[0], swzB[1], swzB[2], swzB[3])*layerCorr;
1140
1141 {
1142 const tcu::PixelBufferAccess access = tcu::getSubregion(levelAccess, 0, 0, (layer*6)+face, levelAccess.getWidth(), levelAccess.getHeight(), 1);
1143 const int lastPix = access.getWidth()-1;
1144
1145 tcu::fillWithGrid(access, de::max(1, baseCellSize>>level), colorA, colorB);
1146
1147 // Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering
1148 access.setPixel(cCorner, 0, 0);
1149 access.setPixel(cCorner, 0, lastPix);
1150 access.setPixel(cCorner, lastPix, 0);
1151 access.setPixel(cCorner, lastPix, lastPix);
1152 }
1153 }
1154 }
1155 }
1156
1157 // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
1158 DE_ASSERT(de::abs(m_lookupSpec.minCoord[2] - m_lookupSpec.maxCoord[2]) < 0.005);
1159 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]));
1160 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]));
1161
1162 tcu::CubeFaceFloatCoords c00 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
1163 tcu::CubeFaceFloatCoords c10 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.maxCoord[0]*proj, m_lookupSpec.minCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
1164 tcu::CubeFaceFloatCoords c01 = tcu::getCubeFaceCoords(Vec3(m_lookupSpec.minCoord[0]*proj, m_lookupSpec.maxCoord[1]*proj, m_lookupSpec.minCoord[2]*proj));
1165 float dudx = (c10.s - c00.s)*(float)m_textureSpec.width / (float)viewportSize[0];
1166 float dvdy = (c01.t - c00.t)*(float)m_textureSpec.height / (float)viewportSize[1];
1167 lookupParams.lod = computeLodFromDerivates(DEFAULT_LOD_MODE, dudx, 0.0f, 0.0f, dvdy);
1168
1169 // Append to texture list.
1170 m_textures.push_back(TextureBindingSp(new TextureBinding(textureCubeArray.release(), m_textureSpec.sampler)));
1171 break;
1172 }
1173
1174 default:
1175 DE_ASSERT(DE_FALSE);
1176 }
1177
1178 // Set lookup scale & bias
1179 lookupParams.scale = fmtInfo.lookupScale;
1180 lookupParams.bias = fmtInfo.lookupBias;
1181 lookupParams.offset = m_lookupSpec.offset;
1182 lookupParams.lodClamp = m_lookupSpec.lodClamp;
1183
1184 // \todo [dirnerakos] Avoid const cast somehow
1185 const_cast<TexLookupParams&>(m_lookupParams) = lookupParams;
1186 }
1187
1188 class ShaderTextureFunctionCase : public ShaderRenderCase
1189 {
1190 public:
1191 ShaderTextureFunctionCase (tcu::TestContext& testCtx,
1192 const std::string& name,
1193 const std::string& desc,
1194 const TextureLookupSpec& lookup,
1195 const TextureSpec& texture,
1196 TexEvalFunc evalFunc,
1197 bool isVertexCase);
1198 virtual ~ShaderTextureFunctionCase (void);
1199
1200 virtual TestInstance* createInstance (Context& context) const;
1201 virtual void checkSupport (Context& context) const;
1202
1203 protected:
1204 const TextureLookupSpec m_lookupSpec;
1205 const TextureSpec m_textureSpec;
1206 const TexLookupParams m_lookupParams;
1207
1208 void initShaderSources (void);
1209 };
1210
ShaderTextureFunctionCase(tcu::TestContext & testCtx,const std::string & name,const std::string & desc,const TextureLookupSpec & lookup,const TextureSpec & texture,TexEvalFunc evalFunc,bool isVertexCase)1211 ShaderTextureFunctionCase::ShaderTextureFunctionCase (tcu::TestContext& testCtx,
1212 const std::string& name,
1213 const std::string& desc,
1214 const TextureLookupSpec& lookup,
1215 const TextureSpec& texture,
1216 TexEvalFunc evalFunc,
1217 bool isVertexCase)
1218 : ShaderRenderCase (testCtx, name, desc, isVertexCase, new TexLookupEvaluator(evalFunc, m_lookupParams), NULL, NULL)
1219 , m_lookupSpec (lookup)
1220 , m_textureSpec (texture)
1221 {
1222 initShaderSources();
1223 }
1224
~ShaderTextureFunctionCase(void)1225 ShaderTextureFunctionCase::~ShaderTextureFunctionCase (void)
1226 {
1227 }
1228
createInstance(Context & context) const1229 TestInstance* ShaderTextureFunctionCase::createInstance (Context& context) const
1230 {
1231 DE_ASSERT(m_evaluator != DE_NULL);
1232 DE_ASSERT(m_uniformSetup != DE_NULL);
1233 return new ShaderTextureFunctionInstance(context, m_isVertexCase, *m_evaluator, *m_uniformSetup, m_lookupSpec, m_textureSpec, m_lookupParams);
1234 }
1235
checkSupport(Context & context) const1236 void ShaderTextureFunctionCase::checkSupport(Context& context) const
1237 {
1238 checkMutableComparisonSamplersSupport(context, m_textureSpec);
1239 }
1240
initShaderSources(void)1241 void ShaderTextureFunctionCase::initShaderSources (void)
1242 {
1243 Function function = m_lookupSpec.function;
1244 bool isVtxCase = m_isVertexCase;
1245 bool isProj = functionHasProj(function);
1246 bool isGrad = functionHasGrad(function);
1247 bool isShadow = m_textureSpec.sampler.compare != tcu::Sampler::COMPAREMODE_NONE;
1248 bool is2DProj4 = !isShadow && m_textureSpec.type == TEXTURETYPE_2D && (function == FUNCTION_TEXTUREPROJ || function == FUNCTION_TEXTUREPROJLOD || function == FUNCTION_TEXTUREPROJGRAD);
1249 bool is1DProj4 = !isShadow && m_textureSpec.type == TEXTURETYPE_1D && (function == FUNCTION_TEXTUREPROJ || function == FUNCTION_TEXTUREPROJLOD || function == FUNCTION_TEXTUREPROJGRAD);
1250 bool isIntCoord = function == FUNCTION_TEXELFETCH;
1251 bool hasLodBias = functionHasLod(m_lookupSpec.function) || m_lookupSpec.useBias;
1252 int texCoordComps = m_textureSpec.type == TEXTURETYPE_1D ? 1 :
1253 m_textureSpec.type == TEXTURETYPE_1D_ARRAY || m_textureSpec.type == TEXTURETYPE_2D ? 2 :
1254 m_textureSpec.type == TEXTURETYPE_CUBE_ARRAY ? 4 :
1255 3;
1256 int extraCoordComps = (isProj ? (is2DProj4 ? 2 : (is1DProj4 ? 3 : 1)) : 0) + (isShadow ? (m_textureSpec.type == TEXTURETYPE_1D ? 2 : 1) : 0);
1257 const bool isCubeArrayShadow = isShadow && m_textureSpec.type == TEXTURETYPE_CUBE_ARRAY;
1258 glu::DataType coordType = glu::getDataTypeFloatVec(isCubeArrayShadow ? 4 : texCoordComps+extraCoordComps);
1259 glu::Precision coordPrec = glu::PRECISION_HIGHP;
1260 const char* coordTypeName = glu::getDataTypeName(coordType);
1261 const char* coordPrecName = glu::getPrecisionName(coordPrec);
1262 tcu::TextureFormat texFmt = glu::mapGLInternalFormat(m_textureSpec.format);
1263 glu::DataType samplerType = glu::TYPE_LAST;
1264 glu::DataType gradType = m_textureSpec.type == TEXTURETYPE_1D || m_textureSpec.type == TEXTURETYPE_1D_ARRAY ? glu::TYPE_FLOAT :
1265 m_textureSpec.type == TEXTURETYPE_3D || m_textureSpec.type == TEXTURETYPE_CUBE_MAP || m_textureSpec.type == TEXTURETYPE_CUBE_ARRAY ? glu::TYPE_FLOAT_VEC3 :
1266 glu::TYPE_FLOAT_VEC2;
1267 const char* gradTypeName = glu::getDataTypeName(gradType);
1268 const char* baseFuncName = DE_NULL;
1269
1270 DE_ASSERT(!isGrad || !hasLodBias);
1271
1272 switch (m_textureSpec.type)
1273 {
1274 case TEXTURETYPE_2D: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_SHADOW : glu::getSampler2DType(texFmt); break;
1275 case TEXTURETYPE_CUBE_MAP: samplerType = isShadow ? glu::TYPE_SAMPLER_CUBE_SHADOW : glu::getSamplerCubeType(texFmt); break;
1276 case TEXTURETYPE_2D_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_ARRAY_SHADOW : glu::getSampler2DArrayType(texFmt); break;
1277 case TEXTURETYPE_3D: DE_ASSERT(!isShadow); samplerType = glu::getSampler3DType(texFmt); break;
1278 case TEXTURETYPE_1D: samplerType = isShadow ? glu::TYPE_SAMPLER_1D_SHADOW : glu::getSampler1DType(texFmt); break;
1279 case TEXTURETYPE_1D_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_1D_ARRAY_SHADOW : glu::getSampler1DArrayType(texFmt); break;
1280 case TEXTURETYPE_CUBE_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_CUBE_ARRAY_SHADOW : glu::getSamplerCubeArrayType(texFmt); break;
1281 default:
1282 DE_ASSERT(DE_FALSE);
1283 }
1284
1285 switch (m_lookupSpec.function)
1286 {
1287 case FUNCTION_TEXTURE: baseFuncName = "texture"; break;
1288 case FUNCTION_TEXTUREPROJ: baseFuncName = "textureProj"; break;
1289 case FUNCTION_TEXTUREPROJ2: baseFuncName = "textureProj"; break;
1290 case FUNCTION_TEXTUREPROJ3: baseFuncName = "textureProj"; break;
1291 case FUNCTION_TEXTURELOD: baseFuncName = "textureLod"; break;
1292 case FUNCTION_TEXTUREPROJLOD: baseFuncName = "textureProjLod"; break;
1293 case FUNCTION_TEXTUREPROJLOD2: baseFuncName = "textureProjLod"; break;
1294 case FUNCTION_TEXTUREPROJLOD3: baseFuncName = "textureProjLod"; break;
1295 case FUNCTION_TEXTUREGRAD: baseFuncName = "textureGrad"; break;
1296 case FUNCTION_TEXTUREPROJGRAD: baseFuncName = "textureProjGrad"; break;
1297 case FUNCTION_TEXTUREPROJGRAD2: baseFuncName = "textureProjGrad"; break;
1298 case FUNCTION_TEXTUREPROJGRAD3: baseFuncName = "textureProjGrad"; break;
1299 case FUNCTION_TEXELFETCH: baseFuncName = "texelFetch"; break;
1300 default:
1301 DE_ASSERT(DE_FALSE);
1302 }
1303
1304 std::ostringstream vert;
1305 std::ostringstream frag;
1306 std::ostringstream& op = isVtxCase ? vert : frag;
1307
1308 vert << "#version 450 core\n"
1309 << "layout(location = 0) in highp vec4 a_position;\n"
1310 << "layout(location = 4) in " << coordPrecName << " " << coordTypeName << " a_in0;\n";
1311
1312 if (isGrad)
1313 {
1314 vert << "layout(location = 5) in " << coordPrecName << " " << gradTypeName << " a_in1;\n";
1315 vert << "layout(location = 6) in " << coordPrecName << " " << gradTypeName << " a_in2;\n";
1316 }
1317 else if (hasLodBias)
1318 vert << "layout(location = 5) in " << coordPrecName << " float a_in1;\n";
1319
1320 frag << "#version 450 core\n";
1321
1322 if (m_lookupSpec.useClamp)
1323 frag << "#extension GL_ARB_sparse_texture_clamp : require\n";
1324
1325 frag << "layout(location = 0) out mediump vec4 o_color;\n";
1326
1327 if (isVtxCase)
1328 {
1329 vert << "layout(location = 0) out mediump vec4 v_color;\n";
1330 frag << "layout(location = 0) in mediump vec4 v_color;\n";
1331 }
1332 else
1333 {
1334 vert << "layout(location = 0) out " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
1335 frag << "layout(location = 0) in " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
1336
1337 if (isGrad)
1338 {
1339 vert << "layout(location = 1) out " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
1340 vert << "layout(location = 2) out " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
1341 frag << "layout(location = 1) in " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
1342 frag << "layout(location = 2) in " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
1343 }
1344 else if (hasLodBias)
1345 {
1346 vert << "layout(location = 1) out " << coordPrecName << " float v_lodBias;\n";
1347 frag << "layout(location = 1) in " << coordPrecName << " float v_lodBias;\n";
1348 }
1349 }
1350
1351 // Uniforms
1352 op << "layout(set = 0, binding = 0) uniform highp " << glu::getDataTypeName(samplerType) << " u_sampler;\n"
1353 << "layout(set = 0, binding = 1) uniform buf0 { highp vec4 u_scale; };\n"
1354 << "layout(set = 0, binding = 2) uniform buf1 { highp vec4 u_bias; };\n";
1355
1356 vert << "out gl_PerVertex {\n"
1357 << "\tvec4 gl_Position;\n"
1358 << "};\n";
1359
1360 vert << "\nvoid main()\n{\n"
1361 << "\tgl_Position = a_position;\n";
1362 frag << "\nvoid main()\n{\n";
1363
1364 if (isVtxCase)
1365 vert << "\tv_color = ";
1366 else
1367 frag << "\to_color = ";
1368
1369 // Op.
1370 {
1371 const char* texCoord = isVtxCase ? "a_in0" : "v_texCoord";
1372 const char* gradX = isVtxCase ? "a_in1" : "v_gradX";
1373 const char* gradY = isVtxCase ? "a_in2" : "v_gradY";
1374 const char* lodBias = isVtxCase ? "a_in1" : "v_lodBias";
1375
1376 op << "vec4(" << baseFuncName;
1377 if (m_lookupSpec.useOffset)
1378 op << "Offset";
1379 if (m_lookupSpec.useClamp)
1380 op << "ClampARB";
1381 op << "(u_sampler, ";
1382
1383 if (isIntCoord)
1384 op << glu::getDataTypeName(glu::getDataTypeIntVec(texCoordComps+extraCoordComps)) << "(";
1385
1386 op << texCoord;
1387
1388 if (isIntCoord)
1389 op << ")";
1390
1391 if (isGrad)
1392 op << ", " << gradX << ", " << gradY;
1393
1394 if (functionHasLod(function))
1395 {
1396 if (isIntCoord)
1397 op << ", int(" << lodBias << ")";
1398 else
1399 op << ", " << lodBias;
1400 }
1401
1402 if (m_lookupSpec.useOffset)
1403 {
1404 int offsetComps = m_textureSpec.type == TEXTURETYPE_1D || m_textureSpec.type == TEXTURETYPE_1D_ARRAY ? 1 :
1405 m_textureSpec.type == TEXTURETYPE_3D ? 3 : 2;
1406
1407 op << ", " << glu::getDataTypeName(glu::getDataTypeIntVec(offsetComps)) << "(";
1408 for (int ndx = 0; ndx < offsetComps; ndx++)
1409 {
1410 if (ndx != 0)
1411 op << ", ";
1412 op << m_lookupSpec.offset[ndx];
1413 }
1414 op << ")";
1415 }
1416
1417 if (m_lookupSpec.useClamp)
1418 op << ", float(" << m_lookupSpec.lodClamp << ")";
1419
1420 if (isCubeArrayShadow && m_lookupSpec.function == FUNCTION_TEXTURE)
1421 op << ", " << texCoord << ".w";
1422
1423 if (m_lookupSpec.useBias)
1424 op << ", " << lodBias;
1425
1426 op << ")";
1427
1428 if (isShadow)
1429 op << ", 0.0, 0.0, 1.0)";
1430 else
1431 op << ")*u_scale + u_bias";
1432
1433 op << ";\n";
1434 }
1435
1436 if (isVtxCase)
1437 frag << "\to_color = v_color;\n";
1438 else
1439 {
1440 vert << "\tv_texCoord = a_in0;\n";
1441
1442 if (isGrad)
1443 {
1444 vert << "\tv_gradX = a_in1;\n";
1445 vert << "\tv_gradY = a_in2;\n";
1446 }
1447 else if (hasLodBias)
1448 vert << "\tv_lodBias = a_in1;\n";
1449 }
1450
1451 vert << "}\n";
1452 frag << "}\n";
1453
1454 m_vertShaderSource = vert.str();
1455 m_fragShaderSource = frag.str();
1456 }
1457
1458 enum QueryFunction
1459 {
1460 QUERYFUNCTION_TEXTURESIZE = 0,
1461 QUERYFUNCTION_TEXTURESIZEMS,
1462 QUERYFUNCTION_TEXTUREQUERYLOD,
1463 QUERYFUNCTION_TEXTUREQUERYLEVELS,
1464 QUERYFUNCTION_TEXTURESAMPLES,
1465
1466 QUERYFUNCTION_LAST
1467 };
1468
1469 // test mode used to alter test behaviour
1470 using TestMode = deUint32;
1471
1472 enum QueryLodTestModes
1473 {
1474 QLODTM_DEFAULT = 0, // uv coords have different values
1475 QLODTM_ZERO_UV_WIDTH // all uv coords are 0; there were implementations that incorrectly returned 0 in that case instead of -22 or less
1476 };
1477
1478 class TextureQueryInstance : public ShaderRenderCaseInstance
1479 {
1480 public:
1481 TextureQueryInstance (Context& context,
1482 const bool isVertexCase,
1483 const TextureSpec& textureSpec);
1484 virtual ~TextureQueryInstance (void);
1485
1486 protected:
1487 virtual void setupDefaultInputs (void);
1488 virtual void setupUniforms (const tcu::Vec4&);
1489
1490 void render (void);
1491
1492 protected:
1493 const TextureSpec& m_textureSpec;
1494 };
1495
TextureQueryInstance(Context & context,const bool isVertexCase,const TextureSpec & textureSpec)1496 TextureQueryInstance::TextureQueryInstance (Context& context,
1497 const bool isVertexCase,
1498 const TextureSpec& textureSpec)
1499 : ShaderRenderCaseInstance (context, isVertexCase, DE_NULL, DE_NULL, DE_NULL)
1500 , m_textureSpec (textureSpec)
1501 {
1502 m_colorFormat = vk::VK_FORMAT_R32G32B32A32_SFLOAT;
1503
1504 checkDeviceFeatures(m_context, m_textureSpec.type);
1505 }
1506
~TextureQueryInstance(void)1507 TextureQueryInstance::~TextureQueryInstance (void)
1508 {
1509 }
1510
setupDefaultInputs(void)1511 void TextureQueryInstance::setupDefaultInputs (void)
1512 {
1513 const deUint32 numVertices = 4;
1514 const float positions[] =
1515 {
1516 -1.0f, -1.0f, 0.0f, 1.0f,
1517 -1.0f, 1.0f, 0.0f, 1.0f,
1518 1.0f, -1.0f, 0.0f, 1.0f,
1519 1.0f, 1.0f, 0.0f, 1.0f
1520 };
1521
1522 addAttribute(0u, vk::VK_FORMAT_R32G32B32A32_SFLOAT, 4 * (deUint32)sizeof(float), numVertices, positions);
1523 }
1524
setupUniforms(const tcu::Vec4 &)1525 void TextureQueryInstance::setupUniforms (const tcu::Vec4&)
1526 {
1527 useSampler(0u, 0u);
1528 }
1529
render(void)1530 void TextureQueryInstance::render (void)
1531 {
1532 const deUint32 numVertices = 4;
1533 const deUint32 numTriangles = 2;
1534 const deUint16 indices[6] = { 0, 1, 2, 2, 1, 3 };
1535
1536 ShaderRenderCaseInstance::setup();
1537
1538 ShaderRenderCaseInstance::render(numVertices, numTriangles, indices);
1539 }
1540
getMaxTextureSize(TextureType type,const tcu::IVec3 & textureSize)1541 static int getMaxTextureSize (TextureType type, const tcu::IVec3& textureSize)
1542 {
1543 int maxSize = 0;
1544
1545 switch (type)
1546 {
1547 case TEXTURETYPE_1D:
1548 case TEXTURETYPE_1D_ARRAY:
1549 maxSize = textureSize.x();
1550 break;
1551
1552 case TEXTURETYPE_2D:
1553 case TEXTURETYPE_2D_ARRAY:
1554 case TEXTURETYPE_CUBE_MAP:
1555 case TEXTURETYPE_CUBE_ARRAY:
1556 maxSize = de::max(textureSize.x(), textureSize.y());
1557 break;
1558
1559 case TEXTURETYPE_3D:
1560 maxSize = de::max(textureSize.x(), de::max(textureSize.y(), textureSize.z()));
1561 break;
1562
1563 default:
1564 DE_ASSERT(false);
1565 }
1566
1567 return maxSize;
1568 }
1569
getTextureSizeString(TextureType type,const tcu::IVec3 & textureSize)1570 static std::string getTextureSizeString (TextureType type, const tcu::IVec3& textureSize)
1571 {
1572 std::ostringstream str;
1573
1574 switch (type)
1575 {
1576 case TEXTURETYPE_1D:
1577 str << textureSize.x() << "x1";
1578 break;
1579
1580 case TEXTURETYPE_2D:
1581 case TEXTURETYPE_CUBE_MAP:
1582 str << textureSize.x() << "x" << textureSize.y();
1583 break;
1584
1585 case TEXTURETYPE_3D:
1586 str << textureSize.x() << "x" << textureSize.y() << "x" << textureSize.z();
1587 break;
1588
1589 case TEXTURETYPE_1D_ARRAY:
1590 str << textureSize.x() << "x1 with " << textureSize.z() << " layer(s)";
1591 break;
1592
1593 case TEXTURETYPE_2D_ARRAY:
1594 case TEXTURETYPE_CUBE_ARRAY:
1595 str << textureSize.x() << "x" << textureSize.y() << " with " << textureSize.z() << " layers(s)";
1596 break;
1597
1598 default:
1599 DE_ASSERT(false);
1600 break;
1601 }
1602
1603 return str.str();
1604 }
1605
isValidCase(TextureType type,const tcu::IVec3 & textureSize,int lodBase)1606 static bool isValidCase (TextureType type, const tcu::IVec3& textureSize, int lodBase)
1607 {
1608 const bool isSquare = textureSize.x() == textureSize.y();
1609 const bool isCubeArray = isSquare && (textureSize.z() % 6) == 0;
1610 const int maxSize = getMaxTextureSize(type, textureSize);
1611 const bool isBaseValid = (maxSize >> lodBase) != 0;
1612
1613 if (!isBaseValid)
1614 return false;
1615 if (type == TEXTURETYPE_CUBE_MAP && !isSquare)
1616 return false;
1617 if (type == TEXTURETYPE_CUBE_ARRAY && !isCubeArray)
1618 return false;
1619
1620 return true;
1621 }
1622
createEmptyTexture(deUint32 format,TextureType type,const tcu::IVec3 & textureSize,int numLevels,int lodBase,const tcu::Sampler & sampler)1623 static TextureBindingSp createEmptyTexture (deUint32 format,
1624 TextureType type,
1625 const tcu::IVec3& textureSize,
1626 int numLevels,
1627 int lodBase,
1628 const tcu::Sampler& sampler)
1629 {
1630 const tcu::TextureFormat texFmt = glu::mapGLInternalFormat(format);
1631 const TextureBinding::Parameters params (lodBase);
1632 TextureBindingSp textureBinding;
1633
1634 switch (type)
1635 {
1636
1637 case TEXTURETYPE_1D:
1638 {
1639 de::MovePtr<tcu::Texture1D> texture (new tcu::Texture1D(texFmt, textureSize.x()));
1640
1641 for (int level = 0; level < numLevels; level++)
1642 texture->allocLevel(level);
1643
1644 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1645 break;
1646 }
1647
1648 case TEXTURETYPE_2D:
1649 {
1650 de::MovePtr<tcu::Texture2D> texture (new tcu::Texture2D(texFmt, textureSize.x(), textureSize.y()));
1651
1652 for (int level = 0; level < numLevels; level++)
1653 texture->allocLevel(level);
1654
1655 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1656 break;
1657 }
1658
1659 case TEXTURETYPE_3D:
1660 {
1661 de::MovePtr<tcu::Texture3D> texture (new tcu::Texture3D(texFmt, textureSize.x(), textureSize.y(), textureSize.z()));
1662
1663 for (int level = 0; level < numLevels; level++)
1664 texture->allocLevel(level);
1665
1666 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1667 break;
1668 }
1669
1670 case TEXTURETYPE_CUBE_MAP:
1671 {
1672 de::MovePtr<tcu::TextureCube> texture (new tcu::TextureCube(texFmt, textureSize.x()));
1673
1674 for (int level = 0; level < numLevels; level++)
1675 for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
1676 texture->allocLevel((tcu::CubeFace)face, level);
1677
1678 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1679 break;
1680 }
1681
1682 case TEXTURETYPE_1D_ARRAY:
1683 {
1684 de::MovePtr<tcu::Texture1DArray> texture (new tcu::Texture1DArray(texFmt, textureSize.x(), textureSize.z()));
1685
1686 for (int level = 0; level < numLevels; level++)
1687 texture->allocLevel(level);
1688
1689 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1690 break;
1691 }
1692
1693 case TEXTURETYPE_2D_ARRAY:
1694 {
1695 de::MovePtr<tcu::Texture2DArray> texture (new tcu::Texture2DArray(texFmt, textureSize.x(), textureSize.y(), textureSize.z()));
1696
1697 for (int level = 0; level < numLevels; level++)
1698 texture->allocLevel(level);
1699
1700 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1701 break;
1702 }
1703
1704 case TEXTURETYPE_CUBE_ARRAY:
1705 {
1706 de::MovePtr<tcu::TextureCubeArray> texture (new tcu::TextureCubeArray(texFmt, textureSize.x(), textureSize.z()));
1707
1708 for (int level = 0; level < numLevels; level++)
1709 texture->allocLevel(level);
1710
1711 textureBinding = TextureBindingSp(new TextureBinding(texture.release(), sampler));
1712 break;
1713 }
1714
1715 default:
1716 DE_ASSERT(false);
1717 break;
1718 }
1719
1720 textureBinding->setParameters(params);
1721 return textureBinding;
1722 }
1723
getTextureSizeFuncResultType(TextureType textureType)1724 static inline glu::DataType getTextureSizeFuncResultType (TextureType textureType)
1725 {
1726 switch (textureType)
1727 {
1728 case TEXTURETYPE_1D:
1729 return glu::TYPE_INT;
1730
1731 case TEXTURETYPE_2D:
1732 case TEXTURETYPE_CUBE_MAP:
1733 case TEXTURETYPE_1D_ARRAY:
1734 return glu::TYPE_INT_VEC2;
1735
1736 case TEXTURETYPE_3D:
1737 case TEXTURETYPE_2D_ARRAY:
1738 case TEXTURETYPE_CUBE_ARRAY:
1739 return glu::TYPE_INT_VEC3;
1740
1741 default:
1742 DE_ASSERT(false);
1743 return glu::TYPE_LAST;
1744 }
1745 }
1746
1747 class TextureSizeInstance : public TextureQueryInstance
1748 {
1749 public:
1750 TextureSizeInstance (Context& context,
1751 const bool isVertexCase,
1752 const TextureSpec& textureSpec);
1753 virtual ~TextureSizeInstance (void);
1754
1755 virtual tcu::TestStatus iterate (void);
1756
1757 protected:
1758 virtual void setupUniforms (const tcu::Vec4& constCoords);
1759
1760 private:
1761 struct TestSize
1762 {
1763 tcu::IVec3 textureSize;
1764 int lod;
1765 int lodBase;
1766 tcu::IVec3 expectedSize;
1767 };
1768
1769 void initTexture (void);
1770 bool testTextureSize (void);
1771
1772 TestSize m_testSize;
1773 tcu::IVec3 m_expectedSize;
1774 int m_iterationCounter;
1775 };
1776
TextureSizeInstance(Context & context,const bool isVertexCase,const TextureSpec & textureSpec)1777 TextureSizeInstance::TextureSizeInstance (Context& context,
1778 const bool isVertexCase,
1779 const TextureSpec& textureSpec)
1780 : TextureQueryInstance (context, isVertexCase, textureSpec)
1781 , m_testSize ()
1782 , m_expectedSize ()
1783 , m_iterationCounter (0)
1784 {
1785 deMemset(&m_testSize, 0, sizeof(TestSize));
1786
1787 m_renderSize = tcu::UVec2(1, 1);
1788 }
1789
~TextureSizeInstance(void)1790 TextureSizeInstance::~TextureSizeInstance (void)
1791 {
1792 }
1793
setupUniforms(const tcu::Vec4 & constCoords)1794 void TextureSizeInstance::setupUniforms (const tcu::Vec4& constCoords)
1795 {
1796 TextureQueryInstance::setupUniforms(constCoords);
1797 addUniform(1u, vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, sizeof(int), &m_testSize.lod);
1798 }
1799
initTexture(void)1800 void TextureSizeInstance::initTexture (void)
1801 {
1802 tcu::TestLog& log = m_context.getTestContext().getLog();
1803 const int numLevels = deLog2Floor32(getMaxTextureSize(m_textureSpec.type, m_testSize.textureSize)) + 1;
1804 TextureBindingSp textureBinding;
1805
1806 log << tcu::TestLog::Message << "Testing image size " << getTextureSizeString(m_textureSpec.type, m_testSize.textureSize) << tcu::TestLog::EndMessage;
1807 log << tcu::TestLog::Message << "Lod: " << m_testSize.lod << ", base level: " << m_testSize.lodBase << tcu::TestLog::EndMessage;
1808
1809 switch (m_textureSpec.type)
1810 {
1811 case TEXTURETYPE_3D:
1812 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << "x" << m_testSize.expectedSize.z() << tcu::TestLog::EndMessage;
1813 break;
1814
1815 case TEXTURETYPE_2D:
1816 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << tcu::TestLog::EndMessage;
1817 break;
1818
1819 case TEXTURETYPE_CUBE_MAP:
1820 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << tcu::TestLog::EndMessage;
1821 break;
1822
1823 case TEXTURETYPE_2D_ARRAY:
1824 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << "x" << m_testSize.expectedSize.y() << " and " << m_testSize.textureSize.z() << " layer(s)" << tcu::TestLog::EndMessage;
1825 break;
1826
1827 case TEXTURETYPE_CUBE_ARRAY:
1828 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;
1829 break;
1830
1831 case TEXTURETYPE_1D:
1832 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << tcu::TestLog::EndMessage;
1833 break;
1834
1835 case TEXTURETYPE_1D_ARRAY:
1836 log << tcu::TestLog::Message << "Expecting: " << m_testSize.expectedSize.x() << " and " << m_testSize.textureSize.z() << " layer(s)" << tcu::TestLog::EndMessage;
1837 break;
1838
1839 default:
1840 DE_ASSERT(false);
1841 break;
1842 }
1843
1844 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, m_testSize.textureSize, numLevels, m_testSize.lodBase, m_textureSpec.sampler);
1845
1846 m_textures.clear();
1847 m_textures.push_back(textureBinding);
1848 }
1849
iterate(void)1850 tcu::TestStatus TextureSizeInstance::iterate (void)
1851 {
1852 const TestSize testSizes[] =
1853 {
1854 { tcu::IVec3(1, 2, 1), 0, 0, tcu::IVec3(1, 2, 1) },
1855 { tcu::IVec3(1, 2, 1), 1, 0, tcu::IVec3(1, 1, 1) },
1856
1857 { tcu::IVec3(1, 3, 2), 0, 0, tcu::IVec3(1, 3, 2) },
1858 { tcu::IVec3(1, 3, 2), 1, 0, tcu::IVec3(1, 1, 1) },
1859
1860 { tcu::IVec3(100, 31, 18), 0, 0, tcu::IVec3(100, 31, 18) },
1861 { tcu::IVec3(100, 31, 18), 1, 0, tcu::IVec3(50, 15, 9) },
1862 { tcu::IVec3(100, 31, 18), 2, 0, tcu::IVec3(25, 7, 4) },
1863 { tcu::IVec3(100, 31, 18), 3, 0, tcu::IVec3(12, 3, 2) },
1864 { tcu::IVec3(100, 31, 18), 4, 0, tcu::IVec3(6, 1, 1) },
1865 { tcu::IVec3(100, 31, 18), 5, 0, tcu::IVec3(3, 1, 1) },
1866 { tcu::IVec3(100, 31, 18), 6, 0, tcu::IVec3(1, 1, 1) },
1867
1868 { tcu::IVec3(100, 128, 32), 0, 0, tcu::IVec3(100, 128, 32) },
1869 { tcu::IVec3(100, 128, 32), 1, 0, tcu::IVec3(50, 64, 16) },
1870 { tcu::IVec3(100, 128, 32), 2, 0, tcu::IVec3(25, 32, 8) },
1871 { tcu::IVec3(100, 128, 32), 3, 0, tcu::IVec3(12, 16, 4) },
1872 { tcu::IVec3(100, 128, 32), 4, 0, tcu::IVec3(6, 8, 2) },
1873 { tcu::IVec3(100, 128, 32), 5, 0, tcu::IVec3(3, 4, 1) },
1874 { tcu::IVec3(100, 128, 32), 6, 0, tcu::IVec3(1, 2, 1) },
1875 { tcu::IVec3(100, 128, 32), 7, 0, tcu::IVec3(1, 1, 1) },
1876
1877 // pow 2
1878 { tcu::IVec3(128, 64, 32), 0, 0, tcu::IVec3(128, 64, 32) },
1879 { tcu::IVec3(128, 64, 32), 1, 0, tcu::IVec3(64, 32, 16) },
1880 { tcu::IVec3(128, 64, 32), 2, 0, tcu::IVec3(32, 16, 8) },
1881 { tcu::IVec3(128, 64, 32), 3, 0, tcu::IVec3(16, 8, 4) },
1882 { tcu::IVec3(128, 64, 32), 4, 0, tcu::IVec3(8, 4, 2) },
1883 { tcu::IVec3(128, 64, 32), 5, 0, tcu::IVec3(4, 2, 1) },
1884 { tcu::IVec3(128, 64, 32), 6, 0, tcu::IVec3(2, 1, 1) },
1885 { tcu::IVec3(128, 64, 32), 7, 0, tcu::IVec3(1, 1, 1) },
1886
1887 // w == h
1888 { tcu::IVec3(1, 1, 1), 0, 0, tcu::IVec3(1, 1, 1) },
1889 { tcu::IVec3(64, 64, 64), 0, 0, tcu::IVec3(64, 64, 64) },
1890 { tcu::IVec3(64, 64, 64), 1, 0, tcu::IVec3(32, 32, 32) },
1891 { tcu::IVec3(64, 64, 64), 2, 0, tcu::IVec3(16, 16, 16) },
1892 { tcu::IVec3(64, 64, 64), 3, 0, tcu::IVec3(8, 8, 8) },
1893 { tcu::IVec3(64, 64, 64), 4, 0, tcu::IVec3(4, 4, 4) },
1894
1895 // with lod base
1896 { tcu::IVec3(100, 31, 18), 3, 1, tcu::IVec3(6, 1, 1) },
1897 { tcu::IVec3(128, 64, 32), 3, 1, tcu::IVec3(8, 4, 2) },
1898 { tcu::IVec3(64, 64, 64), 1, 1, tcu::IVec3(16, 16, 16) },
1899
1900 { tcu::IVec3(100, 31, 18), 1, 2, tcu::IVec3(12, 3, 2) },
1901 { tcu::IVec3(100, 31, 18), 2, 2, tcu::IVec3(6, 1, 1) },
1902 { tcu::IVec3(100, 31, 18), 1, 4, tcu::IVec3(3, 1, 1) },
1903
1904 // out-of-range mip levels
1905 { tcu::IVec3(1, 3, 2), -7, 0, tcu::IVec3(0, 0, 0) },
1906 { tcu::IVec3(1, 3, 2), 106, 0, tcu::IVec3(0, 0, 0) },
1907 { tcu::IVec3(100, 31, 18), 7, 0, tcu::IVec3(0, 0, 0) },
1908 { tcu::IVec3(32, 32, 12), 6, 0, tcu::IVec3(0, 0, 0) },
1909 { tcu::IVec3(32, 32, 12), -9, 0, tcu::IVec3(0, 0, 0) },
1910 { tcu::IVec3(32, 32, 12), 4396, 0, tcu::IVec3(0, 0, 0) },
1911
1912 // w == h and d % 6 == 0 (for cube array)
1913 { tcu::IVec3(1, 1, 6), 0, 0, tcu::IVec3(1, 1, 6) },
1914 { tcu::IVec3(32, 32, 12), 0, 0, tcu::IVec3(32, 32, 12) },
1915 { tcu::IVec3(32, 32, 12), 0, 1, tcu::IVec3(16, 16, 6) },
1916 { tcu::IVec3(32, 32, 12), 1, 0, tcu::IVec3(16, 16, 6) },
1917 { tcu::IVec3(32, 32, 12), 2, 0, tcu::IVec3(8, 8, 3) },
1918 { tcu::IVec3(32, 32, 12), 3, 0, tcu::IVec3(4, 4, 1) },
1919 { tcu::IVec3(32, 32, 12), 4, 0, tcu::IVec3(2, 2, 1) },
1920 { tcu::IVec3(32, 32, 12), 5, 0, tcu::IVec3(1, 1, 1) },
1921 };
1922 const int lastIterationIndex = DE_LENGTH_OF_ARRAY(testSizes) + 1;
1923
1924 m_iterationCounter++;
1925
1926 if (m_iterationCounter == lastIterationIndex)
1927 return tcu::TestStatus::pass("Pass");
1928 else
1929 {
1930 // set current test size
1931 m_testSize = testSizes[m_iterationCounter - 1];
1932
1933 if (!testTextureSize())
1934 return tcu::TestStatus::fail("Got unexpected result");
1935
1936 return tcu::TestStatus::incomplete();
1937 }
1938 }
1939
testTextureSize(void)1940 bool TextureSizeInstance::testTextureSize (void)
1941 {
1942 tcu::TestLog& log = m_context.getTestContext().getLog();
1943 bool success = true;
1944
1945 // skip incompatible cases
1946 if (!isValidCase(m_textureSpec.type, m_testSize.textureSize, m_testSize.lodBase))
1947 return true;
1948
1949 // setup texture
1950 initTexture();
1951
1952 // determine expected texture size
1953 switch (m_textureSpec.type)
1954 {
1955 case TEXTURETYPE_1D:
1956 case TEXTURETYPE_2D:
1957 case TEXTURETYPE_3D:
1958 case TEXTURETYPE_CUBE_MAP:
1959 m_expectedSize = m_testSize.expectedSize;
1960 break;
1961
1962 case TEXTURETYPE_1D_ARRAY:
1963 m_expectedSize = tcu::IVec3(m_testSize.expectedSize.x(), m_testSize.textureSize.z(), 0);
1964 break;
1965
1966 case TEXTURETYPE_2D_ARRAY:
1967 m_expectedSize = tcu::IVec3(m_testSize.expectedSize.x(), m_testSize.expectedSize.y(), m_testSize.textureSize.z());
1968 break;
1969
1970 case TEXTURETYPE_CUBE_ARRAY:
1971 m_expectedSize = tcu::IVec3(m_testSize.expectedSize.x(), m_testSize.expectedSize.y(), m_testSize.textureSize.z() / 6);
1972 break;
1973
1974 default:
1975 DE_ASSERT(false);
1976 break;
1977 }
1978
1979 // render
1980 TextureQueryInstance::render();
1981
1982 // test
1983 {
1984 const tcu::TextureLevel& result = getResultImage();
1985 tcu::IVec4 output = result.getAccess().getPixelInt(0, 0);
1986 const int resultComponents = glu::getDataTypeScalarSize(getTextureSizeFuncResultType(m_textureSpec.type));
1987
1988 for (int ndx = 0; ndx < resultComponents; ndx++)
1989 {
1990 // We test all levels, but only compare results for valid LoDs. The others give
1991 // undefined values.
1992 const int maxSize = getMaxTextureSize(m_textureSpec.type, m_testSize.textureSize);
1993 const bool isLodValid = (maxSize >> (m_testSize.lod + m_testSize.lodBase)) != 0;
1994 if (isLodValid && output[ndx] != m_expectedSize[ndx])
1995 {
1996 success = false;
1997 break;
1998 }
1999 }
2000
2001 if (success)
2002 {
2003 // success
2004 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2005 }
2006 else
2007 {
2008 // failure
2009 std::stringstream resultSizeStr;
2010 switch (resultComponents)
2011 {
2012 case 1:
2013 resultSizeStr << output[0];
2014 break;
2015 case 2:
2016 resultSizeStr << output.toWidth<2>();
2017 break;
2018 case 3:
2019 resultSizeStr << output.toWidth<3>();
2020 break;
2021 default:
2022 DE_ASSERT(false);
2023 break;
2024 }
2025 log << tcu::TestLog::Message << "Result: " << resultSizeStr.str() << tcu::TestLog::EndMessage;
2026 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2027 }
2028 }
2029
2030 log << tcu::TestLog::Message << tcu::TestLog::EndMessage;
2031
2032 return success;
2033 }
2034
getVkImageType(TextureType type)2035 static vk::VkImageType getVkImageType (TextureType type)
2036 {
2037 switch (type)
2038 {
2039 case TEXTURETYPE_1D:
2040 case TEXTURETYPE_1D_ARRAY:
2041 return vk::VK_IMAGE_TYPE_1D;
2042
2043 case TEXTURETYPE_2D:
2044 case TEXTURETYPE_2D_ARRAY:
2045 case TEXTURETYPE_CUBE_MAP:
2046 case TEXTURETYPE_CUBE_ARRAY:
2047 return vk::VK_IMAGE_TYPE_2D;
2048
2049 case TEXTURETYPE_3D:
2050 return vk::VK_IMAGE_TYPE_3D;
2051
2052 default:
2053 DE_ASSERT(false);
2054 return (vk::VkImageType)0;
2055 }
2056 }
2057
2058 class TextureSizeMSInstance : public TextureQueryInstance
2059 {
2060 public:
2061 TextureSizeMSInstance (Context& context,
2062 const bool isVertexCase,
2063 const TextureSpec& textureSpec);
2064 virtual ~TextureSizeMSInstance (void);
2065
2066 virtual tcu::TestStatus iterate (void);
2067
2068 private:
2069 void initTexture (vk::VkSampleCountFlagBits samples, const tcu::IVec3 &dim);
2070 bool testSize (vk::VkSampleCountFlagBits samples, const tcu::IVec3 &dim);
2071
2072 unsigned m_iterationCounter;
2073 vector<vk::VkSampleCountFlagBits> m_iterations;
2074 };
2075
TextureSizeMSInstance(Context & context,const bool isVertexCase,const TextureSpec & textureSpec)2076 TextureSizeMSInstance::TextureSizeMSInstance (Context& context,
2077 const bool isVertexCase,
2078 const TextureSpec& textureSpec)
2079 : TextureQueryInstance (context, isVertexCase, textureSpec)
2080 , m_iterationCounter (0)
2081 {
2082 m_renderSize = tcu::UVec2(1, 1);
2083
2084 // determine available sample counts
2085 {
2086 const vk::VkFormat format = vk::mapTextureFormat(glu::mapGLInternalFormat(m_textureSpec.format));
2087 const vk::VkImageType imageType = getVkImageType(m_textureSpec.type);
2088 vk::VkImageFormatProperties properties;
2089
2090 if (m_context.getInstanceInterface().getPhysicalDeviceImageFormatProperties(m_context.getPhysicalDevice(),
2091 format,
2092 imageType,
2093 vk::VK_IMAGE_TILING_OPTIMAL,
2094 vk::VK_IMAGE_USAGE_SAMPLED_BIT | vk::VK_IMAGE_USAGE_TRANSFER_DST_BIT,
2095 (vk::VkImageCreateFlags)0,
2096 &properties) == vk::VK_ERROR_FORMAT_NOT_SUPPORTED)
2097 TCU_THROW(NotSupportedError, "Format not supported");
2098
2099 // NOTE: The test case initializes MS images (for all supported N of samples), runs a program
2100 // which invokes OpImageQuerySize against the image and checks the result.
2101 //
2102 // Multisample images do not support a sample count of 1, so start from 2 samples.
2103 static const vk::VkSampleCountFlagBits sampleFlags[] =
2104 {
2105 vk::VK_SAMPLE_COUNT_2_BIT,
2106 vk::VK_SAMPLE_COUNT_4_BIT,
2107 vk::VK_SAMPLE_COUNT_8_BIT,
2108 vk::VK_SAMPLE_COUNT_16_BIT,
2109 vk::VK_SAMPLE_COUNT_32_BIT,
2110 vk::VK_SAMPLE_COUNT_64_BIT
2111 };
2112
2113 for (int samplesNdx = 0; samplesNdx < DE_LENGTH_OF_ARRAY(sampleFlags); samplesNdx++)
2114 {
2115 const vk::VkSampleCountFlagBits& flag = sampleFlags[samplesNdx];
2116
2117 if ((properties.sampleCounts & flag) != 0)
2118 m_iterations.push_back(flag);
2119 }
2120
2121 if (m_iterations.empty())
2122 {
2123 // Sampled images of integer formats may support only 1 sample. Exit the test with "Not supported" in these cases.
2124 if (tcu::getTextureChannelClass(mapVkFormat(format).type) == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER ||
2125 tcu::getTextureChannelClass(mapVkFormat(format).type) == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER)
2126 {
2127 TCU_THROW(NotSupportedError, "Skipping validation of integer formats as only VK_SAMPLE_COUNT_1_BIT is supported.");
2128 }
2129
2130 DE_ASSERT(false);
2131 }
2132 }
2133 }
2134
~TextureSizeMSInstance(void)2135 TextureSizeMSInstance::~TextureSizeMSInstance (void)
2136 {
2137 }
2138
iterate(void)2139 tcu::TestStatus TextureSizeMSInstance::iterate (void)
2140 {
2141 const tcu::IVec3 testSizes[] =
2142 {
2143 tcu::IVec3(1, 1, 1),
2144 tcu::IVec3(1, 2, 1),
2145 tcu::IVec3(1, 3, 2),
2146 tcu::IVec3(1, 1, 6),
2147 tcu::IVec3(32, 32, 12),
2148 tcu::IVec3(64, 64, 64),
2149 tcu::IVec3(100, 31, 18),
2150 tcu::IVec3(100, 128, 32),
2151 tcu::IVec3(128, 64, 32),
2152 };
2153
2154 unsigned sampleIdx = m_iterationCounter / DE_LENGTH_OF_ARRAY(testSizes);
2155 unsigned dimIdx = m_iterationCounter % DE_LENGTH_OF_ARRAY(testSizes);
2156
2157 if (m_iterationCounter++ < m_iterations.size() * DE_LENGTH_OF_ARRAY(testSizes))
2158 {
2159 if (!testSize(m_iterations[sampleIdx], testSizes[dimIdx]))
2160 return tcu::TestStatus::fail("Got unexpected result");
2161
2162 return tcu::TestStatus::incomplete();
2163 }
2164 else
2165 return tcu::TestStatus::pass("Pass");
2166 }
2167
testSize(vk::VkSampleCountFlagBits samples,const tcu::IVec3 & dim)2168 bool TextureSizeMSInstance::testSize (vk::VkSampleCountFlagBits samples, const tcu::IVec3 &dim)
2169 {
2170 tcu::TestLog& log = m_context.getTestContext().getLog();
2171
2172 // setup texture
2173 initTexture(samples, dim);
2174
2175 // render
2176 TextureQueryInstance::render();
2177
2178 // test
2179 {
2180 const tcu::TextureLevel& result = getResultImage();
2181 tcu::IVec4 output = result.getAccess().getPixelInt(0, 0);
2182 const int resultComponents = glu::getDataTypeScalarSize(getTextureSizeFuncResultType(m_textureSpec.type));
2183
2184 bool success = true;
2185
2186 for (int ndx = 0; ndx < resultComponents; ndx++)
2187 {
2188 if (output[ndx] != dim[ndx])
2189 {
2190 success = false;
2191 break;
2192 }
2193 }
2194
2195 if (success)
2196 {
2197 // success
2198 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2199 return true;
2200 }
2201 else
2202 {
2203 // failure
2204 std::stringstream resultSizeStr;
2205 switch (resultComponents)
2206 {
2207 case 1:
2208 resultSizeStr << output[0];
2209 break;
2210 case 2:
2211 resultSizeStr << output.toWidth<2>();
2212 break;
2213 case 3:
2214 resultSizeStr << output.toWidth<3>();
2215 break;
2216 default:
2217 DE_ASSERT(false);
2218 break;
2219 }
2220 log << tcu::TestLog::Message << "Result: " << resultSizeStr.str() << tcu::TestLog::EndMessage;
2221 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2222 return false;
2223 }
2224 }
2225 }
2226
initTexture(vk::VkSampleCountFlagBits samples,const tcu::IVec3 & dim)2227 void TextureSizeMSInstance::initTexture (vk::VkSampleCountFlagBits samples, const tcu::IVec3 &dim)
2228 {
2229 tcu::TestLog& log = m_context.getTestContext().getLog();
2230 TextureBindingSp textureBinding;
2231
2232 DE_ASSERT(m_textureSpec.type == TEXTURETYPE_2D || m_textureSpec.type == TEXTURETYPE_2D_ARRAY);
2233
2234 log << tcu::TestLog::Message << "Image size: " << getTextureSizeString(m_textureSpec.type, dim) << ", samples: " << samples << tcu::TestLog::EndMessage;
2235
2236 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, dim, m_textureSpec.numLevels, 0 /* lodBase */, m_textureSpec.sampler);
2237
2238 m_textures.clear();
2239 m_textures.push_back(textureBinding);
2240
2241 // update samples count
2242 {
2243 DE_ASSERT(m_textures.size() == 1);
2244
2245 TextureBinding::Parameters params = m_textures[0]->getParameters();
2246
2247 params.initialization = TextureBinding::INIT_CLEAR;
2248 params.samples = samples;
2249
2250 m_textures[0]->setParameters(params);
2251 }
2252 }
2253
2254 class TextureSamplesInstance : public TextureQueryInstance
2255 {
2256 public:
2257 TextureSamplesInstance (Context& context,
2258 const bool isVertexCase,
2259 const TextureSpec& textureSpec);
2260 virtual ~TextureSamplesInstance (void);
2261
2262 virtual tcu::TestStatus iterate (void);
2263
2264 private:
2265 void initTexture (void);
2266
2267 int m_iterationCounter;
2268 vector<vk::VkSampleCountFlagBits> m_iterations;
2269 };
2270
TextureSamplesInstance(Context & context,const bool isVertexCase,const TextureSpec & textureSpec)2271 TextureSamplesInstance::TextureSamplesInstance (Context& context,
2272 const bool isVertexCase,
2273 const TextureSpec& textureSpec)
2274 : TextureQueryInstance (context, isVertexCase, textureSpec)
2275 , m_iterationCounter (0)
2276 {
2277 m_renderSize = tcu::UVec2(1, 1);
2278
2279 // determine available sample counts
2280 {
2281 const vk::VkFormat format = vk::mapTextureFormat(glu::mapGLInternalFormat(m_textureSpec.format));
2282 const vk::VkImageType imageType = getVkImageType(m_textureSpec.type);
2283 vk::VkImageFormatProperties properties;
2284
2285 if (m_context.getInstanceInterface().getPhysicalDeviceImageFormatProperties(m_context.getPhysicalDevice(),
2286 format,
2287 imageType,
2288 vk::VK_IMAGE_TILING_OPTIMAL,
2289 vk::VK_IMAGE_USAGE_SAMPLED_BIT | vk::VK_IMAGE_USAGE_TRANSFER_DST_BIT,
2290 (vk::VkImageCreateFlags)0,
2291 &properties) == vk::VK_ERROR_FORMAT_NOT_SUPPORTED)
2292 TCU_THROW(NotSupportedError, "Format not supported");
2293
2294 // NOTE: The test case initializes MS images (for all supported N of samples), runs a program
2295 // which invokes OpImageQuerySamples against the image and checks the result.
2296 //
2297 // Now, in the SPIR-V spec for the very operation we have the following language:
2298 //
2299 // OpImageQuerySamples
2300 // Query the number of samples available per texel fetch in a multisample image.
2301 // Result Type must be a scalar integer type.
2302 // The result is the number of samples.
2303 // Image must be an object whose type is OpTypeImage.
2304 // Its Dim operand must be one of 2D and **MS of 1(multisampled).
2305 //
2306 // "MS of 1" implies the image must not be single-sample, meaning we must exclude
2307 // VK_SAMPLE_COUNT_1_BIT in the sampleFlags array below, and may have to skip further testing.
2308 static const vk::VkSampleCountFlagBits sampleFlags[] =
2309 {
2310 vk::VK_SAMPLE_COUNT_2_BIT,
2311 vk::VK_SAMPLE_COUNT_4_BIT,
2312 vk::VK_SAMPLE_COUNT_8_BIT,
2313 vk::VK_SAMPLE_COUNT_16_BIT,
2314 vk::VK_SAMPLE_COUNT_32_BIT,
2315 vk::VK_SAMPLE_COUNT_64_BIT
2316 };
2317
2318 for (int samplesNdx = 0; samplesNdx < DE_LENGTH_OF_ARRAY(sampleFlags); samplesNdx++)
2319 {
2320 const vk::VkSampleCountFlagBits& flag = sampleFlags[samplesNdx];
2321
2322 if ((properties.sampleCounts & flag) != 0)
2323 m_iterations.push_back(flag);
2324 }
2325
2326 if (m_iterations.empty())
2327 {
2328 // Sampled images of integer formats may support only 1 sample. Exit the test with "Not supported" in these cases.
2329 if (tcu::getTextureChannelClass(mapVkFormat(format).type) == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER ||
2330 tcu::getTextureChannelClass(mapVkFormat(format).type) == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER)
2331 {
2332 TCU_THROW(NotSupportedError, "Skipping validation of integer formats as only VK_SAMPLE_COUNT_1_BIT is supported.");
2333 }
2334
2335 DE_ASSERT(false);
2336 }
2337 }
2338
2339 // setup texture
2340 initTexture();
2341 }
2342
~TextureSamplesInstance(void)2343 TextureSamplesInstance::~TextureSamplesInstance (void)
2344 {
2345 }
2346
iterate(void)2347 tcu::TestStatus TextureSamplesInstance::iterate (void)
2348 {
2349 tcu::TestLog& log = m_context.getTestContext().getLog();
2350
2351 // update samples count
2352 {
2353 DE_ASSERT(m_textures.size() == 1);
2354
2355 TextureBinding::Parameters params = m_textures[0]->getParameters();
2356
2357 params.initialization = TextureBinding::INIT_CLEAR;
2358 params.samples = m_iterations[m_iterationCounter];
2359 log << tcu::TestLog::Message << "Expected samples: " << m_iterations[m_iterationCounter] << tcu::TestLog::EndMessage;
2360
2361 m_textures[0]->setParameters(params);
2362 }
2363
2364 // render
2365 TextureQueryInstance::render();
2366
2367 // test
2368 {
2369 const tcu::TextureLevel& result = getResultImage();
2370 tcu::IVec4 output = result.getAccess().getPixelInt(0, 0);
2371
2372 if (output.x() == (int)m_iterations[m_iterationCounter])
2373 {
2374 // success
2375 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2376 }
2377 else
2378 {
2379 // failure
2380 log << tcu::TestLog::Message << "Result: " << output.x() << tcu::TestLog::EndMessage;
2381 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2382 return tcu::TestStatus::fail("Got unexpected result");
2383 }
2384
2385 m_iterationCounter++;
2386 if (m_iterationCounter == (int)m_iterations.size())
2387 return tcu::TestStatus::pass("Pass");
2388 else
2389 return tcu::TestStatus::incomplete();
2390 }
2391 }
2392
initTexture(void)2393 void TextureSamplesInstance::initTexture (void)
2394 {
2395 tcu::TestLog& log = m_context.getTestContext().getLog();
2396 tcu::IVec3 textureSize (m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth);
2397 TextureBindingSp textureBinding;
2398
2399 DE_ASSERT(m_textures.empty());
2400 DE_ASSERT(m_textureSpec.type == TEXTURETYPE_2D || m_textureSpec.type == TEXTURETYPE_2D_ARRAY);
2401
2402 log << tcu::TestLog::Message << "Image size: " << getTextureSizeString(m_textureSpec.type, textureSize) << tcu::TestLog::EndMessage;
2403
2404 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, textureSize, m_textureSpec.numLevels, 0 /* lodBase */, m_textureSpec.sampler);
2405
2406 m_textures.push_back(textureBinding);
2407 }
2408
2409 class TextureQueryLevelsInstance : public TextureQueryInstance
2410 {
2411 public:
2412 TextureQueryLevelsInstance (Context& context,
2413 const bool isVertexCase,
2414 const TextureSpec& textureSpec);
2415 virtual ~TextureQueryLevelsInstance (void);
2416
2417 virtual tcu::TestStatus iterate (void);
2418
2419 private:
2420 struct TestSize
2421 {
2422 tcu::IVec3 textureSize;
2423 int lodBase;
2424 };
2425
2426 void initTexture (void);
2427 bool testTextureLevels (void);
2428
2429 TestSize m_testSize;
2430 int m_levels;
2431 int m_iterationCounter;
2432 };
2433
TextureQueryLevelsInstance(Context & context,const bool isVertexCase,const TextureSpec & textureSpec)2434 TextureQueryLevelsInstance::TextureQueryLevelsInstance (Context& context,
2435 const bool isVertexCase,
2436 const TextureSpec& textureSpec)
2437 : TextureQueryInstance (context, isVertexCase, textureSpec)
2438 , m_testSize ()
2439 , m_levels (0)
2440 , m_iterationCounter (0)
2441 {
2442 deMemset(&m_testSize, 0, sizeof(TestSize));
2443
2444 m_renderSize = tcu::UVec2(1, 1);
2445 }
2446
~TextureQueryLevelsInstance(void)2447 TextureQueryLevelsInstance::~TextureQueryLevelsInstance (void)
2448 {
2449 }
2450
iterate(void)2451 tcu::TestStatus TextureQueryLevelsInstance::iterate (void)
2452 {
2453 const TestSize testSizes[] =
2454 {
2455 { tcu::IVec3(1, 2, 1), 0 },
2456 { tcu::IVec3(1, 2, 1), 1 },
2457
2458 { tcu::IVec3(1, 3, 2), 0 },
2459 { tcu::IVec3(1, 3, 2), 1 },
2460
2461 { tcu::IVec3(100, 31, 18), 0 },
2462 { tcu::IVec3(100, 31, 18), 1 },
2463 { tcu::IVec3(100, 31, 18), 2 },
2464 { tcu::IVec3(100, 31, 18), 3 },
2465 { tcu::IVec3(100, 31, 18), 4 },
2466 { tcu::IVec3(100, 31, 18), 5 },
2467 { tcu::IVec3(100, 31, 18), 6 },
2468
2469 { tcu::IVec3(100, 128, 32), 0 },
2470 { tcu::IVec3(100, 128, 32), 1 },
2471 { tcu::IVec3(100, 128, 32), 2 },
2472 { tcu::IVec3(100, 128, 32), 3 },
2473 { tcu::IVec3(100, 128, 32), 4 },
2474 { tcu::IVec3(100, 128, 32), 5 },
2475 { tcu::IVec3(100, 128, 32), 6 },
2476 { tcu::IVec3(100, 128, 32), 7 },
2477
2478 // pow 2
2479 { tcu::IVec3(128, 64, 32), 0 },
2480 { tcu::IVec3(128, 64, 32), 1 },
2481 { tcu::IVec3(128, 64, 32), 2 },
2482 { tcu::IVec3(128, 64, 32), 3 },
2483 { tcu::IVec3(128, 64, 32), 4 },
2484 { tcu::IVec3(128, 64, 32), 5 },
2485 { tcu::IVec3(128, 64, 32), 6 },
2486 { tcu::IVec3(128, 64, 32), 7 },
2487
2488 // w == h
2489 { tcu::IVec3(1, 1, 1), 0 },
2490 { tcu::IVec3(64, 64, 64), 0 },
2491 { tcu::IVec3(64, 64, 64), 1 },
2492 { tcu::IVec3(64, 64, 64), 2 },
2493 { tcu::IVec3(64, 64, 64), 3 },
2494 { tcu::IVec3(64, 64, 64), 4 },
2495 { tcu::IVec3(64, 64, 64), 5 },
2496 { tcu::IVec3(64, 64, 64), 6 },
2497
2498 // w == h and d % 6 == 0 (for cube array)
2499 { tcu::IVec3(1, 1, 6), 0 },
2500 { tcu::IVec3(32, 32, 12), 0 },
2501 { tcu::IVec3(32, 32, 12), 1 },
2502 { tcu::IVec3(32, 32, 12), 2 },
2503 { tcu::IVec3(32, 32, 12), 3 },
2504 { tcu::IVec3(32, 32, 12), 4 },
2505 { tcu::IVec3(32, 32, 12), 5 },
2506 };
2507 const int lastIterationIndex = DE_LENGTH_OF_ARRAY(testSizes) + 1;
2508
2509 m_iterationCounter++;
2510
2511 if (m_iterationCounter == lastIterationIndex)
2512 return tcu::TestStatus::pass("Pass");
2513 else
2514 {
2515 // set current test size
2516 m_testSize = testSizes[m_iterationCounter - 1];
2517
2518 if (!testTextureLevels())
2519 return tcu::TestStatus::fail("Got unexpected result");
2520
2521 return tcu::TestStatus::incomplete();
2522 }
2523 }
2524
testTextureLevels(void)2525 bool TextureQueryLevelsInstance::testTextureLevels (void)
2526 {
2527 tcu::TestLog& log = m_context.getTestContext().getLog();
2528 bool success = true;
2529
2530 // skip incompatible cases
2531 if (!isValidCase(m_textureSpec.type, m_testSize.textureSize, m_testSize.lodBase))
2532 return true;
2533
2534 // setup texture
2535 initTexture();
2536
2537 // calculate accessible levels
2538 {
2539 const int mipLevels = deLog2Floor32(getMaxTextureSize(m_textureSpec.type, m_testSize.textureSize)) + 1;
2540
2541 m_levels = mipLevels - m_testSize.lodBase;
2542 DE_ASSERT(m_levels > 0);
2543
2544 log << tcu::TestLog::Message << "Expected levels: " << m_levels << tcu::TestLog::EndMessage;
2545 }
2546
2547 // render
2548 TextureQueryInstance::render();
2549
2550 // test
2551 {
2552 const tcu::TextureLevel& result = getResultImage();
2553 tcu::IVec4 output = result.getAccess().getPixelInt(0, 0);
2554
2555 if (output.x() == m_levels)
2556 {
2557 // success
2558 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2559 }
2560 else
2561 {
2562 // failure
2563 log << tcu::TestLog::Message << "Result: " << output.x() << tcu::TestLog::EndMessage;
2564 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2565 success = false;
2566 }
2567 }
2568
2569 log << tcu::TestLog::Message << tcu::TestLog::EndMessage;
2570
2571 return success;
2572 }
2573
initTexture(void)2574 void TextureQueryLevelsInstance::initTexture (void)
2575 {
2576 tcu::TestLog& log = m_context.getTestContext().getLog();
2577 int numLevels = m_testSize.lodBase + 1;
2578 TextureBindingSp textureBinding;
2579
2580 log << tcu::TestLog::Message << "Image size: " << getTextureSizeString(m_textureSpec.type, m_testSize.textureSize) << tcu::TestLog::EndMessage;
2581 log << tcu::TestLog::Message << "Base level: " << m_testSize.lodBase << tcu::TestLog::EndMessage;
2582
2583 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, m_testSize.textureSize, numLevels, m_testSize.lodBase, m_textureSpec.sampler);
2584
2585 m_textures.clear();
2586 m_textures.push_back(textureBinding);
2587 }
2588
getQueryLodFuncTextCoordComps(TextureType type)2589 static int getQueryLodFuncTextCoordComps (TextureType type)
2590 {
2591 switch (type)
2592 {
2593 case TEXTURETYPE_1D:
2594 case TEXTURETYPE_1D_ARRAY:
2595 return 1;
2596
2597 case TEXTURETYPE_2D:
2598 case TEXTURETYPE_2D_ARRAY:
2599 return 2;
2600
2601 case TEXTURETYPE_3D:
2602 case TEXTURETYPE_CUBE_MAP:
2603 case TEXTURETYPE_CUBE_ARRAY:
2604 return 3;
2605
2606 default:
2607 DE_ASSERT(false);
2608 return 0;
2609 }
2610 }
2611
2612 class TextureQueryLodInstance : public TextureQueryInstance
2613 {
2614 public:
2615 TextureQueryLodInstance (Context& context,
2616 const bool isVertexCase,
2617 const TextureSpec& textureSpec,
2618 const TestMode mode);
2619 virtual ~TextureQueryLodInstance (void);
2620
2621 virtual tcu::TestStatus iterate (void);
2622
2623 protected:
2624 virtual void setupDefaultInputs (void);
2625
2626 private:
2627 void initTexture (void);
2628 float computeLevelFromLod (float computedLod) const;
2629 vector<float> computeQuadTexCoord (void) const;
2630
2631 const TestMode m_mode;
2632 tcu::Vec4 m_minCoord;
2633 tcu::Vec4 m_maxCoord;
2634 tcu::Vec2 m_lodBounds;
2635 tcu::Vec2 m_levelBounds;
2636 };
2637
TextureQueryLodInstance(Context & context,const bool isVertexCase,const TextureSpec & textureSpec,const TestMode mode)2638 TextureQueryLodInstance::TextureQueryLodInstance (Context& context,
2639 const bool isVertexCase,
2640 const TextureSpec& textureSpec,
2641 const TestMode mode)
2642 : TextureQueryInstance (context, isVertexCase, textureSpec)
2643 , m_mode (mode)
2644 , m_minCoord ()
2645 , m_maxCoord ()
2646 , m_lodBounds ()
2647 , m_levelBounds ()
2648 {
2649 // setup texture
2650 initTexture();
2651
2652 if (m_mode == QLODTM_DEFAULT)
2653 {
2654 const tcu::UVec2& viewportSize = getViewportSize();
2655 const float lodEps = (1.0f / float(1u << m_context.getDeviceProperties().limits.mipmapPrecisionBits)) + 0.008f;
2656
2657 // init min/max coords and calculate lod and accessed level
2658 switch (m_textureSpec.type)
2659 {
2660 case TEXTURETYPE_1D:
2661 case TEXTURETYPE_1D_ARRAY:
2662 {
2663 m_minCoord = Vec4(-0.2f, 0.0f, 0.0f, 0.0f);
2664 m_maxCoord = Vec4( 1.5f, 0.0f, 0.0f, 0.0f);
2665
2666 const float dudx = (m_maxCoord[0]-m_minCoord[0])*(float)m_textureSpec.width / (float)viewportSize[0];
2667
2668 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f)-lodEps;
2669 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f)+lodEps;
2670 break;
2671 }
2672
2673 case TEXTURETYPE_2D:
2674 case TEXTURETYPE_2D_ARRAY:
2675 {
2676 m_minCoord = Vec4(-0.2f, -0.4f, 0.0f, 0.0f);
2677 m_maxCoord = Vec4( 1.5f, 2.3f, 0.0f, 0.0f);
2678
2679 const float dudx = (m_maxCoord[0]-m_minCoord[0])*(float)m_textureSpec.width / (float)viewportSize[0];
2680 const float dvdy = (m_maxCoord[1]-m_minCoord[1])*(float)m_textureSpec.height / (float)viewportSize[1];
2681
2682 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f, 0.0f, dvdy)-lodEps;
2683 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f, 0.0f, dvdy)+lodEps;
2684 break;
2685 }
2686
2687 case TEXTURETYPE_CUBE_MAP:
2688 case TEXTURETYPE_CUBE_ARRAY:
2689 {
2690 m_minCoord = Vec4(-1.0f, -1.0f, 1.01f, 0.0f);
2691 m_maxCoord = Vec4( 1.0f, 1.0f, 1.01f, 0.0f);
2692
2693 // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
2694 DE_ASSERT(de::abs(m_minCoord[2] - m_maxCoord[2]) < 0.005);
2695 DE_ASSERT(de::abs(m_minCoord[0]) < de::abs(m_minCoord[2]) && de::abs(m_maxCoord[0]) < de::abs(m_minCoord[2]));
2696 DE_ASSERT(de::abs(m_minCoord[1]) < de::abs(m_minCoord[2]) && de::abs(m_maxCoord[1]) < de::abs(m_minCoord[2]));
2697
2698 tcu::CubeFaceFloatCoords c00 = tcu::getCubeFaceCoords(Vec3(m_minCoord[0], m_minCoord[1], m_minCoord[2]));
2699 tcu::CubeFaceFloatCoords c10 = tcu::getCubeFaceCoords(Vec3(m_maxCoord[0], m_minCoord[1], m_minCoord[2]));
2700 tcu::CubeFaceFloatCoords c01 = tcu::getCubeFaceCoords(Vec3(m_minCoord[0], m_maxCoord[1], m_minCoord[2]));
2701 float dudx = (c10.s - c00.s)*(float)m_textureSpec.width / (float)viewportSize[0];
2702 float dvdy = (c01.t - c00.t)*(float)m_textureSpec.height / (float)viewportSize[1];
2703
2704 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f, 0.0f, dvdy)-lodEps;
2705 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f, 0.0f, dvdy)+lodEps;
2706 break;
2707 }
2708
2709 case TEXTURETYPE_3D:
2710 {
2711 m_minCoord = Vec4(-1.2f, -1.4f, 0.1f, 0.0f);
2712 m_maxCoord = Vec4( 1.5f, 2.3f, 2.3f, 0.0f);
2713
2714 const float dudx = (m_maxCoord[0]-m_minCoord[0])*(float)m_textureSpec.width / (float)viewportSize[0];
2715 const float dvdy = (m_maxCoord[1]-m_minCoord[1])*(float)m_textureSpec.height / (float)viewportSize[1];
2716 const float dwdx = (m_maxCoord[2]-m_minCoord[2])*0.5f*(float)m_textureSpec.depth / (float)viewportSize[0];
2717 const float dwdy = (m_maxCoord[2]-m_minCoord[2])*0.5f*(float)m_textureSpec.depth / (float)viewportSize[1];
2718
2719 m_lodBounds[0] = computeLodFromDerivates(LODMODE_MIN_BOUND, dudx, 0.0f, dwdx, 0.0f, dvdy, dwdy)-lodEps;
2720 m_lodBounds[1] = computeLodFromDerivates(LODMODE_MAX_BOUND, dudx, 0.0f, dwdx, 0.0f, dvdy, dwdy)+lodEps;
2721 break;
2722 }
2723
2724 default:
2725 DE_ASSERT(false);
2726 break;
2727 }
2728
2729 m_levelBounds[0] = computeLevelFromLod(m_lodBounds[0]);
2730 m_levelBounds[1] = computeLevelFromLod(m_lodBounds[1]);
2731
2732 return;
2733 }
2734
2735 if (m_mode == QLODTM_ZERO_UV_WIDTH)
2736 {
2737 // setup same texture coordinates that will result in pmax
2738 // beeing 0 and as a result lambda being -inf; on most
2739 // implementations lambda is computed as fixed-point, so
2740 // infinities can't be returned, instead -22 or less
2741 // should be returned
2742
2743 m_minCoord = Vec4(0.0f, 0.0f, 1.0f, 0.0f);
2744 m_maxCoord = Vec4(0.0f, 0.0f, 1.0f, 0.0f);
2745
2746 m_lodBounds[0] = -std::numeric_limits<float>::infinity();
2747 m_lodBounds[1] = -22.0f;
2748 m_levelBounds[0] = 0.0f;
2749 m_levelBounds[1] = 0.0f;
2750
2751 return;
2752 }
2753
2754 DE_ASSERT(false);
2755 }
2756
~TextureQueryLodInstance(void)2757 TextureQueryLodInstance::~TextureQueryLodInstance (void)
2758 {
2759 }
2760
iterate(void)2761 tcu::TestStatus TextureQueryLodInstance::iterate (void)
2762 {
2763 tcu::TestLog& log = m_context.getTestContext().getLog();
2764
2765 log << tcu::TestLog::Message << "Expected: level in range " << m_levelBounds << ", lod in range " << m_lodBounds << tcu::TestLog::EndMessage;
2766
2767 // render
2768 TextureQueryInstance::render();
2769
2770 // test
2771 {
2772 const tcu::TextureLevel& result = getResultImage();
2773 const tcu::Vec4 output = result.getAccess().getPixel(0, 0);
2774 const float resLevel = output.x();
2775 const float resLod = output.y();
2776
2777 if (de::inRange(resLevel, m_levelBounds[0], m_levelBounds[1]) && de::inRange(resLod, m_lodBounds[0], m_lodBounds[1]))
2778 {
2779 // success
2780 log << tcu::TestLog::Message << "Passed" << tcu::TestLog::EndMessage;
2781 return tcu::TestStatus::pass("Pass");
2782 }
2783 else
2784 {
2785 // failure
2786 log << tcu::TestLog::Message << "Result: level: " << resLevel << ", lod: " << resLod << tcu::TestLog::EndMessage;
2787 log << tcu::TestLog::Message << "Failed" << tcu::TestLog::EndMessage;
2788 return tcu::TestStatus::fail("Got unexpected result");
2789 }
2790 }
2791 }
2792
setupDefaultInputs(void)2793 void TextureQueryLodInstance::setupDefaultInputs (void)
2794 {
2795 TextureQueryInstance::setupDefaultInputs();
2796
2797 const deUint32 numVertices = 4;
2798 const vector<float> texCoord = computeQuadTexCoord();
2799 const int texCoordComps = getQueryLodFuncTextCoordComps(m_textureSpec.type);
2800 const vk::VkFormat coordFormats[] =
2801 {
2802 vk::VK_FORMAT_R32_SFLOAT,
2803 vk::VK_FORMAT_R32G32_SFLOAT,
2804 vk::VK_FORMAT_R32G32B32_SFLOAT
2805 };
2806
2807 DE_ASSERT(de::inRange(texCoordComps, 1, 3));
2808 DE_ASSERT((int)texCoord.size() == texCoordComps * 4);
2809
2810 addAttribute(1u, coordFormats[texCoordComps - 1], (deUint32)(texCoordComps * sizeof(float)), numVertices, texCoord.data());
2811 }
2812
initTexture(void)2813 void TextureQueryLodInstance::initTexture (void)
2814 {
2815 tcu::TestLog& log = m_context.getTestContext().getLog();
2816 tcu::IVec3 textureSize (m_textureSpec.width, m_textureSpec.height, m_textureSpec.depth);
2817 TextureBindingSp textureBinding;
2818
2819 DE_ASSERT(m_textures.empty());
2820
2821 log << tcu::TestLog::Message << "Image size: " << getTextureSizeString(m_textureSpec.type, textureSize) << tcu::TestLog::EndMessage;
2822
2823 textureBinding = createEmptyTexture(m_textureSpec.format, m_textureSpec.type, textureSize, m_textureSpec.numLevels, 0 /* lodBase */, m_textureSpec.sampler);
2824
2825 m_textures.push_back(textureBinding);
2826 }
2827
computeLevelFromLod(float computedLod) const2828 float TextureQueryLodInstance::computeLevelFromLod (float computedLod) const
2829 {
2830 const int maxAccessibleLevel = m_textureSpec.numLevels - 1;
2831
2832 // Clamp the computed LOD to the range of accessible levels.
2833 computedLod = deFloatClamp(computedLod, 0.0f, (float)maxAccessibleLevel);
2834
2835 // Return a value according to the min filter.
2836 switch (m_textureSpec.sampler.minFilter)
2837 {
2838 case tcu::Sampler::LINEAR:
2839 case tcu::Sampler::NEAREST:
2840 return 0.0f;
2841
2842 case tcu::Sampler::NEAREST_MIPMAP_NEAREST:
2843 case tcu::Sampler::LINEAR_MIPMAP_NEAREST:
2844 return deFloatClamp(deFloatCeil(computedLod + 0.5f) - 1.0f, 0.0f, (float)maxAccessibleLevel);
2845
2846 case tcu::Sampler::NEAREST_MIPMAP_LINEAR:
2847 case tcu::Sampler::LINEAR_MIPMAP_LINEAR:
2848 return computedLod;
2849
2850 default:
2851 DE_ASSERT(false);
2852 return 0.0f;
2853 }
2854 }
2855
computeQuadTexCoord(void) const2856 vector<float> TextureQueryLodInstance::computeQuadTexCoord (void) const
2857 {
2858 vector<float> res;
2859 tcu::Mat4 coordTransMat;
2860
2861 {
2862 Vec4 s = m_maxCoord - m_minCoord;
2863 Vec4 b = m_minCoord;
2864
2865 float baseCoordTrans[] =
2866 {
2867 s.x(), 0.0f, 0.f, b.x(),
2868 0.f, s.y(), 0.f, b.y(),
2869 s.z()/2.f, -s.z()/2.f, 0.f, s.z()/2.f + b.z(),
2870 -s.w()/2.f, s.w()/2.f, 0.f, s.w()/2.f + b.w()
2871 };
2872
2873 coordTransMat = tcu::Mat4(baseCoordTrans);
2874 }
2875
2876 const int texCoordComps = getQueryLodFuncTextCoordComps(m_textureSpec.type);
2877 Vec4 coords[4] =
2878 {
2879 coordTransMat * tcu::Vec4(0, 0, 0, 1),
2880 coordTransMat * tcu::Vec4(0, 1, 0, 1),
2881 coordTransMat * tcu::Vec4(1, 0, 0, 1),
2882 coordTransMat * tcu::Vec4(1, 1, 0, 1)
2883 };
2884
2885 res.resize(4 * texCoordComps);
2886
2887 for (int ndx = 0; ndx < 4; ndx++)
2888 deMemcpy(&res[ndx * texCoordComps], coords[ndx].getPtr(), texCoordComps * sizeof(float));
2889
2890 return res;
2891 }
2892
2893 class TextureQueryCase : public ShaderRenderCase
2894 {
2895 public:
2896 TextureQueryCase (tcu::TestContext& testCtx,
2897 const std::string& name,
2898 const std::string& desc,
2899 const std::string& samplerType,
2900 const TextureSpec& texture,
2901 bool isVertexCase,
2902 QueryFunction function,
2903 TestMode mode = 0);
2904 virtual ~TextureQueryCase (void);
2905
2906 virtual TestInstance* createInstance (Context& context) const;
2907 virtual void checkSupport (Context& context) const;
2908
2909 protected:
2910 void initShaderSources (void);
2911
2912 const std::string m_samplerTypeStr;
2913 const TextureSpec m_textureSpec;
2914 const QueryFunction m_function;
2915 const TestMode m_mode;
2916 };
2917
TextureQueryCase(tcu::TestContext & testCtx,const std::string & name,const std::string & desc,const std::string & samplerType,const TextureSpec & texture,bool isVertexCase,QueryFunction function,TestMode mode)2918 TextureQueryCase::TextureQueryCase (tcu::TestContext& testCtx,
2919 const std::string& name,
2920 const std::string& desc,
2921 const std::string& samplerType,
2922 const TextureSpec& texture,
2923 bool isVertexCase,
2924 QueryFunction function,
2925 TestMode mode)
2926 : ShaderRenderCase (testCtx, name, desc, isVertexCase, (ShaderEvaluator*)DE_NULL, DE_NULL, DE_NULL)
2927 , m_samplerTypeStr (samplerType)
2928 , m_textureSpec (texture)
2929 , m_function (function)
2930 , m_mode (mode)
2931 {
2932 initShaderSources();
2933 }
2934
~TextureQueryCase(void)2935 TextureQueryCase::~TextureQueryCase (void)
2936 {
2937 }
2938
createInstance(Context & context) const2939 TestInstance* TextureQueryCase::createInstance (Context& context) const
2940 {
2941 switch (m_function)
2942 {
2943 case QUERYFUNCTION_TEXTURESIZE: return new TextureSizeInstance(context, m_isVertexCase, m_textureSpec);
2944 case QUERYFUNCTION_TEXTURESIZEMS: return new TextureSizeMSInstance(context, m_isVertexCase, m_textureSpec);
2945 case QUERYFUNCTION_TEXTUREQUERYLOD: return new TextureQueryLodInstance(context, m_isVertexCase, m_textureSpec, m_mode);
2946 case QUERYFUNCTION_TEXTUREQUERYLEVELS: return new TextureQueryLevelsInstance(context, m_isVertexCase, m_textureSpec);
2947 case QUERYFUNCTION_TEXTURESAMPLES: return new TextureSamplesInstance(context, m_isVertexCase, m_textureSpec);
2948 default:
2949 DE_ASSERT(false);
2950 return DE_NULL;
2951 }
2952 }
2953
checkSupport(Context & context) const2954 void TextureQueryCase::checkSupport(Context& context) const
2955 {
2956 checkMutableComparisonSamplersSupport(context, m_textureSpec);
2957 }
2958
initShaderSources(void)2959 void TextureQueryCase::initShaderSources (void)
2960 {
2961 std::ostringstream vert;
2962 std::ostringstream frag;
2963 std::ostringstream& op = m_isVertexCase ? vert : frag;
2964
2965 DE_ASSERT(m_function != QUERYFUNCTION_TEXTUREQUERYLOD || !m_isVertexCase);
2966
2967 vert << "#version 450 core\n"
2968 << "layout(location = 0) in highp vec4 a_position;\n";
2969
2970 frag << "#version 450 core\n"
2971 << "layout(location = 0) out mediump vec4 o_color;\n";
2972
2973 if (m_isVertexCase)
2974 {
2975 vert << "layout(location = 0) out mediump vec4 v_color;\n";
2976 frag << "layout(location = 0) in mediump vec4 v_color;\n";
2977 }
2978
2979 if (m_function == QUERYFUNCTION_TEXTUREQUERYLOD)
2980 {
2981 const int texCoordComps = getQueryLodFuncTextCoordComps(m_textureSpec.type);
2982 const char* coordTypeName = glu::getDataTypeName(glu::getDataTypeFloatVec(texCoordComps));
2983
2984 vert << "layout (location = 1) in highp " << coordTypeName << " a_texCoord;\n";
2985 vert << "layout (location = 0) out highp " << coordTypeName << " v_texCoord;\n";
2986 frag << "layout (location = 0) in highp " << coordTypeName << " v_texCoord;\n";
2987 }
2988
2989 // uniforms
2990 op << "layout(set = 0, binding = 0) uniform highp " << m_samplerTypeStr << " u_sampler;\n";
2991 if (m_function == QUERYFUNCTION_TEXTURESIZE)
2992 op << "layout(set = 0, binding = 1) uniform buf0 { highp int u_lod; };\n";
2993
2994 vert << "out gl_PerVertex {\n"
2995 << "\tvec4 gl_Position;\n"
2996 << "};\n";
2997
2998 vert << "\nvoid main()\n{\n"
2999 << "\tgl_Position = a_position;\n";
3000 frag << "\nvoid main()\n{\n";
3001
3002 if (m_isVertexCase)
3003 vert << "\tv_color = ";
3004 else
3005 frag << "\to_color = ";
3006
3007 // op
3008 {
3009 op << "vec4(";
3010
3011 switch (m_function)
3012 {
3013 case QUERYFUNCTION_TEXTURESIZE:
3014 {
3015 const int resultComponents = glu::getDataTypeScalarSize(getTextureSizeFuncResultType(m_textureSpec.type));
3016
3017 op << "textureSize(u_sampler, u_lod)";
3018 for (int ndx = 0; ndx < 3 - resultComponents; ndx++)
3019 op << ", 0.0";
3020 op << ", 1.0";
3021
3022 break;
3023 }
3024
3025 case QUERYFUNCTION_TEXTURESIZEMS:
3026 {
3027 const int resultComponents = glu::getDataTypeScalarSize(getTextureSizeFuncResultType(m_textureSpec.type));
3028
3029 op << "textureSize(u_sampler)";
3030 for (int ndx = 0; ndx < 3 - resultComponents; ndx++)
3031 op << ", 0.0";
3032 op << ", 1.0";
3033
3034 break;
3035 }
3036
3037 case QUERYFUNCTION_TEXTUREQUERYLOD:
3038 op << "textureQueryLod(u_sampler, v_texCoord), 0.0, 1.0";
3039 break;
3040
3041 case QUERYFUNCTION_TEXTUREQUERYLEVELS:
3042 op << "textureQueryLevels(u_sampler), 0.0, 0.0, 1.0";
3043 break;
3044
3045 case QUERYFUNCTION_TEXTURESAMPLES:
3046 op << "textureSamples(u_sampler), 0.0, 0.0, 1.0";
3047 break;
3048
3049 default:
3050 DE_ASSERT(false);
3051 break;
3052 }
3053
3054 op << ");\n";
3055 }
3056
3057 if (m_isVertexCase)
3058 frag << "\to_color = v_color;\n";
3059
3060 if (m_function == QUERYFUNCTION_TEXTUREQUERYLOD)
3061 vert << "\tv_texCoord = a_texCoord;\n";
3062
3063 vert << "}\n";
3064 frag << "}\n";
3065
3066 m_vertShaderSource = vert.str();
3067 m_fragShaderSource = frag.str();
3068 }
3069
3070 class ShaderTextureFunctionTests : public tcu::TestCaseGroup
3071 {
3072 public:
3073 ShaderTextureFunctionTests (tcu::TestContext& context);
3074 virtual ~ShaderTextureFunctionTests (void);
3075 virtual void init (void);
3076
3077 private:
3078 ShaderTextureFunctionTests (const ShaderTextureFunctionTests&); // not allowed!
3079 ShaderTextureFunctionTests& operator= (const ShaderTextureFunctionTests&); // not allowed!
3080 };
3081
ShaderTextureFunctionTests(tcu::TestContext & context)3082 ShaderTextureFunctionTests::ShaderTextureFunctionTests (tcu::TestContext& context)
3083 : TestCaseGroup(context, "texture_functions", "Texture Access Function Tests")
3084 {
3085 }
3086
~ShaderTextureFunctionTests(void)3087 ShaderTextureFunctionTests::~ShaderTextureFunctionTests (void)
3088 {
3089 }
3090
3091 enum CaseFlags
3092 {
3093 VERTEX = (1<<0),
3094 FRAGMENT = (1<<1),
3095 BOTH = VERTEX|FRAGMENT
3096 };
3097
3098 struct TexFuncCaseSpec
3099 {
3100 const char* name;
3101 TextureLookupSpec lookupSpec;
3102 TextureSpec texSpec;
3103 TexEvalFunc evalFunc;
3104 deUint32 flags;
3105 };
3106
3107 #define CASE_SPEC(NAME, FUNC, MINCOORD, MAXCOORD, USEBIAS, MINLOD, MAXLOD, USEOFFSET, OFFSET, TEXSPEC, EVALFUNC, FLAGS) \
3108 { #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, false, 0.0f), TEXSPEC, EVALFUNC, FLAGS }
3109 #define GRAD_CASE_SPEC(NAME, FUNC, MINCOORD, MAXCOORD, MINDX, MAXDX, MINDY, MAXDY, USEOFFSET, OFFSET, TEXSPEC, EVALFUNC, FLAGS) \
3110 { #NAME, TextureLookupSpec(FUNC, MINCOORD, MAXCOORD, false, 0.0f, 0.0f, MINDX, MAXDX, MINDY, MAXDY, USEOFFSET, OFFSET, false, 0.0f), TEXSPEC, EVALFUNC, FLAGS }
3111 #define CLAMP_CASE_SPEC(NAME, FUNC, MINCOORD, MAXCOORD, USEBIAS, MINLOD, MAXLOD, USEOFFSET, OFFSET, LODCLAMP, TEXSPEC, EVALFUNC, FLAGS) \
3112 { #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, true, LODCLAMP), TEXSPEC, EVALFUNC, FLAGS }
3113 #define GRADCLAMP_CASE_SPEC(NAME, FUNC, MINCOORD, MAXCOORD, MINDX, MAXDX, MINDY, MAXDY, USEOFFSET, OFFSET, LODCLAMP, TEXSPEC, EVALFUNC, FLAGS) \
3114 { #NAME, TextureLookupSpec(FUNC, MINCOORD, MAXCOORD, false, 0.0f, 0.0f, MINDX, MAXDX, MINDY, MAXDY, USEOFFSET, OFFSET, true, LODCLAMP), TEXSPEC, EVALFUNC, FLAGS }
3115
3116 class SparseShaderTextureFunctionInstance : public ShaderTextureFunctionInstance
3117 {
3118 public:
3119 SparseShaderTextureFunctionInstance (Context& context,
3120 const bool isVertexCase,
3121 const ShaderEvaluator& evaluator,
3122 const UniformSetup& uniformSetup,
3123 const TextureLookupSpec& lookupSpec,
3124 const TextureSpec& textureSpec,
3125 const TexLookupParams& lookupParams,
3126 const ImageBackingMode imageBackingMode = IMAGE_BACKING_MODE_SPARSE);
3127 virtual ~SparseShaderTextureFunctionInstance (void);
3128 };
3129
SparseShaderTextureFunctionInstance(Context & context,const bool isVertexCase,const ShaderEvaluator & evaluator,const UniformSetup & uniformSetup,const TextureLookupSpec & lookupSpec,const TextureSpec & textureSpec,const TexLookupParams & lookupParams,const ImageBackingMode imageBackingMode)3130 SparseShaderTextureFunctionInstance::SparseShaderTextureFunctionInstance (Context& context,
3131 const bool isVertexCase,
3132 const ShaderEvaluator& evaluator,
3133 const UniformSetup& uniformSetup,
3134 const TextureLookupSpec& lookupSpec,
3135 const TextureSpec& textureSpec,
3136 const TexLookupParams& lookupParams,
3137 const ImageBackingMode imageBackingMode)
3138 : ShaderTextureFunctionInstance (context, isVertexCase, evaluator, uniformSetup, lookupSpec, textureSpec, lookupParams, imageBackingMode)
3139 {
3140 if (lookupSpec.useClamp)
3141 {
3142 const vk::VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
3143
3144 if (!deviceFeatures.shaderResourceMinLod)
3145 TCU_THROW(NotSupportedError, "ShaderResourceMinLod feature not supported.");
3146 }
3147 }
3148
~SparseShaderTextureFunctionInstance(void)3149 SparseShaderTextureFunctionInstance::~SparseShaderTextureFunctionInstance (void)
3150 {
3151 }
3152
3153 class SparseShaderTextureFunctionCase : public ShaderTextureFunctionCase
3154 {
3155 public:
3156 SparseShaderTextureFunctionCase (tcu::TestContext& testCtx,
3157 const std::string& name,
3158 const std::string& desc,
3159 const TextureLookupSpec& lookup,
3160 const TextureSpec& texture,
3161 TexEvalFunc evalFunc,
3162 bool isVertexCase);
3163
3164 virtual ~SparseShaderTextureFunctionCase (void);
3165
3166 virtual TestInstance* createInstance (Context& context) const;
3167 virtual void checkSupport (Context& context) const;
3168 protected:
3169 void initShaderSources (void);
3170 };
3171
SparseShaderTextureFunctionCase(tcu::TestContext & testCtx,const std::string & name,const std::string & desc,const TextureLookupSpec & lookup,const TextureSpec & texture,TexEvalFunc evalFunc,bool isVertexCase)3172 SparseShaderTextureFunctionCase::SparseShaderTextureFunctionCase (tcu::TestContext& testCtx,
3173 const std::string& name,
3174 const std::string& desc,
3175 const TextureLookupSpec& lookup,
3176 const TextureSpec& texture,
3177 TexEvalFunc evalFunc,
3178 bool isVertexCase)
3179 : ShaderTextureFunctionCase (testCtx, name, desc, lookup, texture, evalFunc, isVertexCase)
3180 {
3181 initShaderSources();
3182 }
3183
initShaderSources(void)3184 void SparseShaderTextureFunctionCase::initShaderSources (void)
3185 {
3186 const Function function = m_lookupSpec.function;
3187 const bool isVtxCase = m_isVertexCase;
3188 const bool isProj = functionHasProj(function);
3189 const bool isGrad = functionHasGrad(function);
3190 const bool isShadow = m_textureSpec.sampler.compare != tcu::Sampler::COMPAREMODE_NONE;
3191 const bool is2DProj4 = !isShadow && m_textureSpec.type == TEXTURETYPE_2D && (function == FUNCTION_TEXTUREPROJ || function == FUNCTION_TEXTUREPROJLOD || function == FUNCTION_TEXTUREPROJGRAD);
3192 const bool isIntCoord = function == FUNCTION_TEXELFETCH;
3193 const bool hasLodBias = functionHasLod(m_lookupSpec.function) || m_lookupSpec.useBias;
3194 const int texCoordComps = m_textureSpec.type == TEXTURETYPE_2D ? 2 : 3;
3195 const int extraCoordComps = (isProj ? (is2DProj4 ? 2 : 1) : 0) + (isShadow ? 1 : 0);
3196 const glu::DataType coordType = glu::getDataTypeFloatVec(texCoordComps+extraCoordComps);
3197 const glu::Precision coordPrec = glu::PRECISION_HIGHP;
3198 const char* coordTypeName = glu::getDataTypeName(coordType);
3199 const char* coordPrecName = glu::getPrecisionName(coordPrec);
3200 const tcu::TextureFormat texFmt = glu::mapGLInternalFormat(m_textureSpec.format);
3201 glu::DataType samplerType = glu::TYPE_LAST;
3202 const glu::DataType gradType = (m_textureSpec.type == TEXTURETYPE_CUBE_MAP || m_textureSpec.type == TEXTURETYPE_3D) ? glu::TYPE_FLOAT_VEC3 : glu::TYPE_FLOAT_VEC2;
3203 const char* gradTypeName = glu::getDataTypeName(gradType);
3204 const char* baseFuncName = DE_NULL;
3205
3206 DE_ASSERT(!isGrad || !hasLodBias);
3207
3208 switch (m_textureSpec.type)
3209 {
3210 case TEXTURETYPE_2D: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_SHADOW : glu::getSampler2DType(texFmt); break;
3211 case TEXTURETYPE_CUBE_MAP: samplerType = isShadow ? glu::TYPE_SAMPLER_CUBE_SHADOW : glu::getSamplerCubeType(texFmt); break;
3212 case TEXTURETYPE_2D_ARRAY: samplerType = isShadow ? glu::TYPE_SAMPLER_2D_ARRAY_SHADOW : glu::getSampler2DArrayType(texFmt); break;
3213 case TEXTURETYPE_3D: DE_ASSERT(!isShadow); samplerType = glu::getSampler3DType(texFmt); break;
3214 default:
3215 DE_ASSERT(DE_FALSE);
3216 }
3217
3218 // Not supported cases
3219 switch (m_lookupSpec.function)
3220 {
3221 case FUNCTION_TEXTURE: baseFuncName = "sparseTexture"; break;
3222 case FUNCTION_TEXTURELOD: baseFuncName = "sparseTextureLod"; break;
3223 case FUNCTION_TEXTUREGRAD: baseFuncName = "sparseTextureGrad"; break;
3224 case FUNCTION_TEXELFETCH: baseFuncName = "sparseTexelFetch"; break;
3225 default:
3226 DE_ASSERT(DE_FALSE);
3227 }
3228
3229 std::ostringstream vert;
3230 std::ostringstream frag;
3231 std::ostringstream& op = isVtxCase ? vert : frag;
3232
3233 vert << "#version 450\n"
3234 << "#extension GL_ARB_sparse_texture2 : require\n"
3235 << "layout(location = 0) in highp vec4 a_position;\n"
3236 << "layout(location = 4) in " << coordPrecName << " " << coordTypeName << " a_in0;\n";
3237
3238 if (isGrad)
3239 {
3240 vert << "layout(location = 5) in " << coordPrecName << " " << gradTypeName << " a_in1;\n";
3241 vert << "layout(location = 6) in " << coordPrecName << " " << gradTypeName << " a_in2;\n";
3242 }
3243 else if (hasLodBias)
3244 vert << "layout(location = 5) in " << coordPrecName << " float a_in1;\n";
3245
3246 frag << "#version 450\n"
3247 << "#extension GL_ARB_sparse_texture2 : require\n";
3248
3249 if (m_lookupSpec.useClamp)
3250 frag << "#extension GL_ARB_sparse_texture_clamp : require\n";
3251
3252 frag << "layout(location = 0) out mediump vec4 o_color;\n";
3253
3254 if (isVtxCase)
3255 {
3256 vert << "layout(location = 0) out mediump vec4 v_color;\n";
3257 frag << "layout(location = 0) in mediump vec4 v_color;\n";
3258 }
3259 else
3260 {
3261 vert << "layout(location = 0) out " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
3262 frag << "layout(location = 0) in " << coordPrecName << " " << coordTypeName << " v_texCoord;\n";
3263
3264 if (isGrad)
3265 {
3266 vert << "layout(location = 1) out " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
3267 vert << "layout(location = 2) out " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
3268 frag << "layout(location = 1) in " << coordPrecName << " " << gradTypeName << " v_gradX;\n";
3269 frag << "layout(location = 2) in " << coordPrecName << " " << gradTypeName << " v_gradY;\n";
3270 }
3271 else if (hasLodBias)
3272 {
3273 vert << "layout(location = 1) out " << coordPrecName << " float v_lodBias;\n";
3274 frag << "layout(location = 1) in " << coordPrecName << " float v_lodBias;\n";
3275 }
3276 }
3277
3278 // Uniforms
3279 op << "layout(set = 0, binding = 0) uniform highp " << glu::getDataTypeName(samplerType) << " u_sampler;\n"
3280 << "layout(set = 0, binding = 1) uniform buf0 { highp vec4 u_scale; };\n"
3281 << "layout(set = 0, binding = 2) uniform buf1 { highp vec4 u_bias; };\n";
3282
3283 vert << "out gl_PerVertex {\n"
3284 << " vec4 gl_Position;\n"
3285 << "};\n";
3286 vert << "\nvoid main()\n{\n"
3287 << "\tgl_Position = a_position;\n";
3288 frag << "\nvoid main()\n{\n";
3289
3290 // Op.
3291 {
3292 // Texel declaration
3293 if (isShadow)
3294 op << "\tfloat texel;\n";
3295 else
3296 op << "\tvec4 texel;\n";
3297
3298 const char* const texCoord = isVtxCase ? "a_in0" : "v_texCoord";
3299 const char* const gradX = isVtxCase ? "a_in1" : "v_gradX";
3300 const char* const gradY = isVtxCase ? "a_in2" : "v_gradY";
3301 const char* const lodBias = isVtxCase ? "a_in1" : "v_lodBias";
3302
3303 op << "\tint success = " << baseFuncName;
3304
3305 if (m_lookupSpec.useOffset)
3306 op << "Offset";
3307
3308 if (m_lookupSpec.useClamp)
3309 op << "Clamp";
3310
3311 op << "ARB(u_sampler, ";
3312
3313 if (isIntCoord)
3314 op << "ivec" << (texCoordComps+extraCoordComps) << "(";
3315
3316 op << texCoord;
3317
3318 if (isIntCoord)
3319 op << ")";
3320
3321 if (isGrad)
3322 op << ", " << gradX << ", " << gradY;
3323
3324 if (functionHasLod(function))
3325 {
3326 if (isIntCoord)
3327 op << ", int(" << lodBias << ")";
3328 else
3329 op << ", " << lodBias;
3330 }
3331
3332 if (m_lookupSpec.useOffset)
3333 {
3334 int offsetComps = m_textureSpec.type == TEXTURETYPE_3D ? 3 : 2;
3335
3336 op << ", ivec" << offsetComps << "(";
3337 for (int ndx = 0; ndx < offsetComps; ndx++)
3338 {
3339 if (ndx != 0)
3340 op << ", ";
3341 op << m_lookupSpec.offset[ndx];
3342 }
3343 op << ")";
3344 }
3345
3346 if (m_lookupSpec.useClamp)
3347 op << ", float(" << m_lookupSpec.lodClamp << ")";
3348
3349 op << ", texel";
3350
3351 if (m_lookupSpec.useBias)
3352 op << ", " << lodBias;
3353
3354 op << ");\n";
3355
3356 // Check sparse validity, and handle each case
3357 op << "\tif (sparseTexelsResidentARB(success))\n";
3358
3359 if (isVtxCase)
3360 vert << "\t\tv_color = ";
3361 else
3362 frag << "\t\to_color = ";
3363
3364 if (isShadow)
3365 op << "vec4(texel, 0.0, 0.0, 1.0);\n";
3366 else
3367 op << "vec4(texel * u_scale + u_bias);\n";
3368
3369 op << "\telse\n";
3370
3371 // This color differs from the used colors
3372 if (isVtxCase)
3373 vert << "\t\tv_color = vec4(0.54117647058, 0.16862745098, 0.8862745098, 1.0);\n";
3374 else
3375 frag << "\t\to_color = vec4(0.54117647058, 0.16862745098, 0.8862745098, 1.0);\n";
3376 }
3377
3378 if (isVtxCase)
3379 frag << "\to_color = v_color;\n";
3380 else
3381 {
3382 vert << "\tv_texCoord = a_in0;\n";
3383
3384 if (isGrad)
3385 {
3386 vert << "\tv_gradX = a_in1;\n";
3387 vert << "\tv_gradY = a_in2;\n";
3388 }
3389 else if (hasLodBias)
3390 vert << "\tv_lodBias = a_in1;\n";
3391 }
3392
3393 vert << "}\n";
3394 frag << "}\n";
3395
3396 m_vertShaderSource = vert.str();
3397 m_fragShaderSource = frag.str();
3398 }
3399
~SparseShaderTextureFunctionCase()3400 SparseShaderTextureFunctionCase::~SparseShaderTextureFunctionCase ()
3401 {
3402 }
3403
createInstance(Context & context) const3404 TestInstance* SparseShaderTextureFunctionCase::createInstance (Context& context) const
3405 {
3406 DE_ASSERT(m_evaluator != DE_NULL);
3407 DE_ASSERT(m_uniformSetup != DE_NULL);
3408 return new SparseShaderTextureFunctionInstance(context, m_isVertexCase, *m_evaluator, *m_uniformSetup, m_lookupSpec, m_textureSpec, m_lookupParams);
3409 }
3410
checkSupport(Context & context) const3411 void SparseShaderTextureFunctionCase::checkSupport(Context& context) const
3412 {
3413 checkMutableComparisonSamplersSupport(context, m_textureSpec);
3414 }
3415
createCaseGroup(tcu::TestCaseGroup * parent,const char * groupName,const char * groupDesc,const TexFuncCaseSpec * cases,int numCases)3416 static void createCaseGroup (tcu::TestCaseGroup* parent, const char* groupName, const char* groupDesc, const TexFuncCaseSpec* cases, int numCases)
3417 {
3418 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(parent->getTestContext(), groupName, groupDesc));
3419
3420 for (int ndx = 0; ndx < numCases; ndx++)
3421 {
3422 std::string name = cases[ndx].name;
3423 bool sparseSupported = !functionHasProj(cases[ndx].lookupSpec.function) &&
3424 TEXTURETYPE_1D != cases[ndx].texSpec.type &&
3425 TEXTURETYPE_1D_ARRAY != cases[ndx].texSpec.type &&
3426 TEXTURETYPE_CUBE_ARRAY != cases[ndx].texSpec.type;
3427
3428 if (cases[ndx].flags & VERTEX)
3429 {
3430 if (sparseSupported)
3431 group->addChild(new SparseShaderTextureFunctionCase(parent->getTestContext(), ("sparse_" + name + "_vertex"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, true ));
3432
3433 group->addChild(new ShaderTextureFunctionCase(parent->getTestContext(), (name + "_vertex"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, true ));
3434 }
3435
3436 if (cases[ndx].flags & FRAGMENT)
3437 {
3438 if (sparseSupported)
3439 group->addChild(new SparseShaderTextureFunctionCase(parent->getTestContext(), ("sparse_" + name + "_fragment"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, false));
3440
3441 group->addChild(new ShaderTextureFunctionCase(parent->getTestContext(), (name + "_fragment"), "", cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, false));
3442 }
3443 }
3444
3445 parent->addChild(group.release());
3446 }
3447
init(void)3448 void ShaderTextureFunctionTests::init (void)
3449 {
3450 // Samplers
3451 static const tcu::Sampler samplerNearestNoMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3452 tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
3453 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3454 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3455 static const tcu::Sampler samplerLinearNoMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3456 tcu::Sampler::LINEAR, tcu::Sampler::LINEAR,
3457 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3458 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3459 static const tcu::Sampler samplerNearestMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3460 tcu::Sampler::NEAREST_MIPMAP_NEAREST, tcu::Sampler::NEAREST,
3461 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3462 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3463 static const tcu::Sampler samplerLinearMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3464 tcu::Sampler::LINEAR_MIPMAP_NEAREST, tcu::Sampler::LINEAR,
3465 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3466 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3467
3468 static const tcu::Sampler samplerShadowNoMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3469 tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
3470 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_LESS,
3471 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3472 static const tcu::Sampler samplerShadowMipmap (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3473 tcu::Sampler::NEAREST_MIPMAP_NEAREST, tcu::Sampler::NEAREST,
3474 0.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_LESS,
3475 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3476
3477 static const tcu::Sampler samplerTexelFetch (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
3478 tcu::Sampler::NEAREST_MIPMAP_NEAREST, tcu::Sampler::NEAREST,
3479 00.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
3480 0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
3481
3482 // Default textures.
3483 // Type Format W H D L Sampler
3484 static const TextureSpec tex2DFixed (TEXTURETYPE_2D, GL_RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
3485 static const TextureSpec tex2DFloat (TEXTURETYPE_2D, GL_RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
3486 static const TextureSpec tex2DInt (TEXTURETYPE_2D, GL_RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
3487 static const TextureSpec tex2DUint (TEXTURETYPE_2D, GL_RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
3488 static const TextureSpec tex2DMipmapFixed (TEXTURETYPE_2D, GL_RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
3489 static const TextureSpec tex2DMipmapFloat (TEXTURETYPE_2D, GL_RGBA16F, 256, 256, 1, 9, samplerLinearMipmap);
3490 static const TextureSpec tex2DMipmapInt (TEXTURETYPE_2D, GL_RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
3491 static const TextureSpec tex2DMipmapUint (TEXTURETYPE_2D, GL_RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
3492
3493 static const TextureSpec tex2DShadow (TEXTURETYPE_2D, GL_DEPTH_COMPONENT16, 256, 256, 1, 1, samplerShadowNoMipmap);
3494 static const TextureSpec tex2DMipmapShadow (TEXTURETYPE_2D, GL_DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
3495
3496 static const TextureSpec tex2DTexelFetchFixed (TEXTURETYPE_2D, GL_RGBA8, 256, 256, 1, 9, samplerTexelFetch);
3497 static const TextureSpec tex2DTexelFetchFloat (TEXTURETYPE_2D, GL_RGBA16F, 256, 256, 1, 9, samplerTexelFetch);
3498 static const TextureSpec tex2DTexelFetchInt (TEXTURETYPE_2D, GL_RGBA8I, 256, 256, 1, 9, samplerTexelFetch);
3499 static const TextureSpec tex2DTexelFetchUint (TEXTURETYPE_2D, GL_RGBA8UI, 256, 256, 1, 9, samplerTexelFetch);
3500
3501 static const TextureSpec texCubeFixed (TEXTURETYPE_CUBE_MAP, GL_RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
3502 static const TextureSpec texCubeFloat (TEXTURETYPE_CUBE_MAP, GL_RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
3503 static const TextureSpec texCubeInt (TEXTURETYPE_CUBE_MAP, GL_RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
3504 static const TextureSpec texCubeUint (TEXTURETYPE_CUBE_MAP, GL_RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
3505 static const TextureSpec texCubeMipmapFixed (TEXTURETYPE_CUBE_MAP, GL_RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
3506 static const TextureSpec texCubeMipmapFloat (TEXTURETYPE_CUBE_MAP, GL_RGBA16F, 128, 128, 1, 8, samplerLinearMipmap);
3507 static const TextureSpec texCubeMipmapInt (TEXTURETYPE_CUBE_MAP, GL_RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
3508 static const TextureSpec texCubeMipmapUint (TEXTURETYPE_CUBE_MAP, GL_RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
3509
3510 static const TextureSpec texCubeShadow (TEXTURETYPE_CUBE_MAP, GL_DEPTH_COMPONENT16, 256, 256, 1, 1, samplerShadowNoMipmap);
3511 static const TextureSpec texCubeMipmapShadow (TEXTURETYPE_CUBE_MAP, GL_DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
3512
3513 static const TextureSpec tex2DArrayFixed (TEXTURETYPE_2D_ARRAY, GL_RGBA8, 128, 128, 4, 1, samplerLinearNoMipmap);
3514 static const TextureSpec tex2DArrayFloat (TEXTURETYPE_2D_ARRAY, GL_RGBA16F, 128, 128, 4, 1, samplerLinearNoMipmap);
3515 static const TextureSpec tex2DArrayInt (TEXTURETYPE_2D_ARRAY, GL_RGBA8I, 128, 128, 4, 1, samplerNearestNoMipmap);
3516 static const TextureSpec tex2DArrayUint (TEXTURETYPE_2D_ARRAY, GL_RGBA8UI, 128, 128, 4, 1, samplerNearestNoMipmap);
3517 static const TextureSpec tex2DArrayMipmapFixed (TEXTURETYPE_2D_ARRAY, GL_RGBA8, 128, 128, 4, 8, samplerLinearMipmap);
3518 static const TextureSpec tex2DArrayMipmapFloat (TEXTURETYPE_2D_ARRAY, GL_RGBA16F, 128, 128, 4, 8, samplerLinearMipmap);
3519 static const TextureSpec tex2DArrayMipmapInt (TEXTURETYPE_2D_ARRAY, GL_RGBA8I, 128, 128, 4, 8, samplerNearestMipmap);
3520 static const TextureSpec tex2DArrayMipmapUint (TEXTURETYPE_2D_ARRAY, GL_RGBA8UI, 128, 128, 4, 8, samplerNearestMipmap);
3521
3522 static const TextureSpec tex2DArrayShadow (TEXTURETYPE_2D_ARRAY, GL_DEPTH_COMPONENT16, 128, 128, 4, 1, samplerShadowNoMipmap);
3523 static const TextureSpec tex2DArrayMipmapShadow (TEXTURETYPE_2D_ARRAY, GL_DEPTH_COMPONENT16, 128, 128, 4, 8, samplerShadowMipmap);
3524
3525 static const TextureSpec tex2DArrayTexelFetchFixed (TEXTURETYPE_2D_ARRAY, GL_RGBA8, 128, 128, 4, 8, samplerTexelFetch);
3526 static const TextureSpec tex2DArrayTexelFetchFloat (TEXTURETYPE_2D_ARRAY, GL_RGBA16F, 128, 128, 4, 8, samplerTexelFetch);
3527 static const TextureSpec tex2DArrayTexelFetchInt (TEXTURETYPE_2D_ARRAY, GL_RGBA8I, 128, 128, 4, 8, samplerTexelFetch);
3528 static const TextureSpec tex2DArrayTexelFetchUint (TEXTURETYPE_2D_ARRAY, GL_RGBA8UI, 128, 128, 4, 8, samplerTexelFetch);
3529
3530 static const TextureSpec tex3DFixed (TEXTURETYPE_3D, GL_RGBA8, 64, 32, 32, 1, samplerLinearNoMipmap);
3531 static const TextureSpec tex3DFloat (TEXTURETYPE_3D, GL_RGBA16F, 64, 32, 32, 1, samplerLinearNoMipmap);
3532 static const TextureSpec tex3DInt (TEXTURETYPE_3D, GL_RGBA8I, 64, 32, 32, 1, samplerNearestNoMipmap);
3533 static const TextureSpec tex3DUint (TEXTURETYPE_3D, GL_RGBA8UI, 64, 32, 32, 1, samplerNearestNoMipmap);
3534 static const TextureSpec tex3DMipmapFixed (TEXTURETYPE_3D, GL_RGBA8, 64, 32, 32, 7, samplerLinearMipmap);
3535 static const TextureSpec tex3DMipmapFloat (TEXTURETYPE_3D, GL_RGBA16F, 64, 32, 32, 7, samplerLinearMipmap);
3536 static const TextureSpec tex3DMipmapInt (TEXTURETYPE_3D, GL_RGBA8I, 64, 32, 32, 7, samplerNearestMipmap);
3537 static const TextureSpec tex3DMipmapUint (TEXTURETYPE_3D, GL_RGBA8UI, 64, 32, 32, 7, samplerNearestMipmap);
3538
3539 static const TextureSpec tex3DTexelFetchFixed (TEXTURETYPE_3D, GL_RGBA8, 64, 32, 32, 7, samplerTexelFetch);
3540 static const TextureSpec tex3DTexelFetchFloat (TEXTURETYPE_3D, GL_RGBA16F, 64, 32, 32, 7, samplerTexelFetch);
3541 static const TextureSpec tex3DTexelFetchInt (TEXTURETYPE_3D, GL_RGBA8I, 64, 32, 32, 7, samplerTexelFetch);
3542 static const TextureSpec tex3DTexelFetchUint (TEXTURETYPE_3D, GL_RGBA8UI, 64, 32, 32, 7, samplerTexelFetch);
3543
3544 static const TextureSpec tex1DFixed (TEXTURETYPE_1D, GL_RGBA8, 256, 1, 1, 1, samplerLinearNoMipmap);
3545 static const TextureSpec tex1DFloat (TEXTURETYPE_1D, GL_RGBA16F, 256, 1, 1, 1, samplerLinearNoMipmap);
3546 static const TextureSpec tex1DInt (TEXTURETYPE_1D, GL_RGBA8I, 256, 1, 1, 1, samplerNearestNoMipmap);
3547 static const TextureSpec tex1DUint (TEXTURETYPE_1D, GL_RGBA8UI, 256, 1, 1, 1, samplerNearestNoMipmap);
3548 static const TextureSpec tex1DMipmapFixed (TEXTURETYPE_1D, GL_RGBA8, 256, 1, 1, 9, samplerLinearMipmap);
3549 static const TextureSpec tex1DMipmapFloat (TEXTURETYPE_1D, GL_RGBA16F, 256, 1, 1, 9, samplerLinearMipmap);
3550 static const TextureSpec tex1DMipmapInt (TEXTURETYPE_1D, GL_RGBA8I, 256, 1, 1, 9, samplerNearestMipmap);
3551 static const TextureSpec tex1DMipmapUint (TEXTURETYPE_1D, GL_RGBA8UI, 256, 1, 1, 9, samplerNearestMipmap);
3552
3553 static const TextureSpec tex1DShadow (TEXTURETYPE_1D, GL_DEPTH_COMPONENT16, 256, 1, 1, 1, samplerShadowNoMipmap);
3554 static const TextureSpec tex1DMipmapShadow (TEXTURETYPE_1D, GL_DEPTH_COMPONENT16, 256, 1, 1, 9, samplerShadowMipmap);
3555
3556 static const TextureSpec tex1DTexelFetchFixed (TEXTURETYPE_1D, GL_RGBA8, 256, 1, 1, 9, samplerTexelFetch);
3557 static const TextureSpec tex1DTexelFetchFloat (TEXTURETYPE_1D, GL_RGBA16F, 256, 1, 1, 9, samplerTexelFetch);
3558 static const TextureSpec tex1DTexelFetchInt (TEXTURETYPE_1D, GL_RGBA8I, 256, 1, 1, 9, samplerTexelFetch);
3559 static const TextureSpec tex1DTexelFetchUint (TEXTURETYPE_1D, GL_RGBA8UI, 256, 1, 1, 9, samplerTexelFetch);
3560
3561 static const TextureSpec tex1DArrayFixed (TEXTURETYPE_1D_ARRAY, GL_RGBA8, 256, 1, 4, 1, samplerLinearNoMipmap);
3562 static const TextureSpec tex1DArrayFloat (TEXTURETYPE_1D_ARRAY, GL_RGBA16F, 256, 1, 4, 1, samplerLinearNoMipmap);
3563 static const TextureSpec tex1DArrayInt (TEXTURETYPE_1D_ARRAY, GL_RGBA8I, 256, 1, 4, 1, samplerNearestNoMipmap);
3564 static const TextureSpec tex1DArrayUint (TEXTURETYPE_1D_ARRAY, GL_RGBA8UI, 256, 1, 4, 1, samplerNearestNoMipmap);
3565 static const TextureSpec tex1DArrayMipmapFixed (TEXTURETYPE_1D_ARRAY, GL_RGBA8, 256, 1, 4, 9, samplerLinearMipmap);
3566 static const TextureSpec tex1DArrayMipmapFloat (TEXTURETYPE_1D_ARRAY, GL_RGBA16F, 256, 1, 4, 9, samplerLinearMipmap);
3567 static const TextureSpec tex1DArrayMipmapInt (TEXTURETYPE_1D_ARRAY, GL_RGBA8I, 256, 1, 4, 9, samplerNearestMipmap);
3568 static const TextureSpec tex1DArrayMipmapUint (TEXTURETYPE_1D_ARRAY, GL_RGBA8UI, 256, 1, 4, 9, samplerNearestMipmap);
3569
3570 static const TextureSpec tex1DArrayShadow (TEXTURETYPE_1D_ARRAY, GL_DEPTH_COMPONENT16, 256, 1, 4, 1, samplerShadowNoMipmap);
3571 static const TextureSpec tex1DArrayMipmapShadow (TEXTURETYPE_1D_ARRAY, GL_DEPTH_COMPONENT16, 256, 1, 4, 9, samplerShadowMipmap);
3572
3573 static const TextureSpec tex1DArrayTexelFetchFixed (TEXTURETYPE_1D_ARRAY, GL_RGBA8, 256, 1, 4, 9, samplerTexelFetch);
3574 static const TextureSpec tex1DArrayTexelFetchFloat (TEXTURETYPE_1D_ARRAY, GL_RGBA16F, 256, 1, 4, 9, samplerTexelFetch);
3575 static const TextureSpec tex1DArrayTexelFetchInt (TEXTURETYPE_1D_ARRAY, GL_RGBA8I, 256, 1, 4, 9, samplerTexelFetch);
3576 static const TextureSpec tex1DArrayTexelFetchUint (TEXTURETYPE_1D_ARRAY, GL_RGBA8UI, 256, 1, 4, 9, samplerTexelFetch);
3577
3578 static const TextureSpec texCubeArrayFixed (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8, 64, 64, 12, 1, samplerLinearNoMipmap);
3579 static const TextureSpec texCubeArrayFloat (TEXTURETYPE_CUBE_ARRAY, GL_RGBA16F, 64, 64, 12, 1, samplerLinearNoMipmap);
3580 static const TextureSpec texCubeArrayInt (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8I, 64, 64, 12, 1, samplerNearestNoMipmap);
3581 static const TextureSpec texCubeArrayUint (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8UI, 64, 64, 12, 1, samplerNearestNoMipmap);
3582 static const TextureSpec texCubeArrayMipmapFixed (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8, 64, 64, 12, 7, samplerLinearMipmap);
3583 static const TextureSpec texCubeArrayMipmapFloat (TEXTURETYPE_CUBE_ARRAY, GL_RGBA16F, 64, 64, 12, 7, samplerLinearMipmap);
3584 static const TextureSpec texCubeArrayMipmapInt (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8I, 64, 64, 12, 7, samplerNearestMipmap);
3585 static const TextureSpec texCubeArrayMipmapUint (TEXTURETYPE_CUBE_ARRAY, GL_RGBA8UI, 64, 64, 12, 7, samplerNearestMipmap);
3586
3587 static const TextureSpec texCubeArrayShadow (TEXTURETYPE_CUBE_ARRAY, GL_DEPTH_COMPONENT16, 64, 64, 12, 1, samplerShadowNoMipmap);
3588 static const TextureSpec texCubeArrayMipmapShadow (TEXTURETYPE_CUBE_ARRAY, GL_DEPTH_COMPONENT16, 64, 64, 12, 7, samplerShadowMipmap);
3589
3590 // texture() cases
3591 static const TexFuncCaseSpec textureCases[] =
3592 {
3593 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3594 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),
3595 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),
3596 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),
3597 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),
3598 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),
3599 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),
3600 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),
3601 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),
3602
3603 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),
3604 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),
3605 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),
3606 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),
3607
3608 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),
3609 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),
3610 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),
3611 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),
3612 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),
3613 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),
3614 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),
3615 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),
3616
3617 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),
3618 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),
3619 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),
3620 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),
3621
3622 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),
3623 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),
3624 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),
3625 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),
3626 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),
3627 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),
3628 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),
3629 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),
3630
3631 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),
3632 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),
3633 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),
3634 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),
3635
3636 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),
3637 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),
3638 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),
3639 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),
3640 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),
3641 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),
3642 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),
3643 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),
3644
3645 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),
3646 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),
3647 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),
3648 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),
3649
3650 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),
3651 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),
3652 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),
3653 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),
3654 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),
3655 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),
3656 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),
3657 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),
3658
3659 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),
3660 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),
3661 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),
3662 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),
3663
3664 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),
3665 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),
3666 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),
3667 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),
3668 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),
3669 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),
3670 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),
3671 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),
3672
3673 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),
3674 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),
3675 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),
3676 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),
3677
3678 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),
3679 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),
3680 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),
3681 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),
3682 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),
3683 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),
3684 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),
3685 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),
3686
3687 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),
3688 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),
3689 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),
3690 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),
3691
3692 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),
3693 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),
3694 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),
3695
3696 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),
3697 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),
3698 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),
3699
3700 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),
3701 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),
3702
3703 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),
3704 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),
3705 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),
3706
3707 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),
3708 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),
3709 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),
3710
3711 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),
3712 };
3713 createCaseGroup(this, "texture", "texture() Tests", textureCases, DE_LENGTH_OF_ARRAY(textureCases));
3714
3715 // textureClampARB() cases
3716 static const TexFuncCaseSpec textureClampARBCases[] =
3717 {
3718 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset LodClamp Format EvalFunc Flags
3719 CLAMP_CASE_SPEC(sampler2d_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 5.0f, tex2DMipmapFixed, evalTexture2DBiasClamp, FRAGMENT),
3720 CLAMP_CASE_SPEC(sampler2d_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 5.0f, tex2DMipmapFloat, evalTexture2DBiasClamp, FRAGMENT),
3721 CLAMP_CASE_SPEC(isampler2d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex2DMipmapInt, evalTexture2DBiasClamp, FRAGMENT),
3722 CLAMP_CASE_SPEC(usampler2d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex2DMipmapUint, evalTexture2DBiasClamp, FRAGMENT),
3723
3724 CLAMP_CASE_SPEC(samplercube_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 1.01f, 0.0f), Vec4(1.0f, 1.0f, 1.01f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 4.0f, texCubeMipmapFixed, evalTextureCubeBiasClamp, FRAGMENT),
3725 CLAMP_CASE_SPEC(samplercube_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 1.01f, 0.0f), Vec4(1.0f, 1.0f, 1.01f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 4.0f, texCubeMipmapFloat, evalTextureCubeBiasClamp, FRAGMENT),
3726 CLAMP_CASE_SPEC(isamplercube_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 6.01f, 0.0f), Vec4(6.0f, 6.0f, 6.01f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 6.0f, texCubeMipmapInt, evalTextureCubeBiasClamp, FRAGMENT),
3727 CLAMP_CASE_SPEC(usamplercube_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 6.01f, 0.0f), Vec4(6.0f, 6.0f, 6.01f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 6.0f, texCubeMipmapUint, evalTextureCubeBiasClamp, FRAGMENT),
3728
3729 CLAMP_CASE_SPEC(sampler2darray_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 5.0f, tex2DArrayMipmapFixed, evalTexture2DArrayBiasClamp, FRAGMENT),
3730 CLAMP_CASE_SPEC(sampler2darray_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 5.0f, tex2DArrayMipmapFloat, evalTexture2DArrayBiasClamp, FRAGMENT),
3731 CLAMP_CASE_SPEC(isampler2darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex2DArrayMipmapInt, evalTexture2DArrayBiasClamp, FRAGMENT),
3732 CLAMP_CASE_SPEC(usampler2darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex2DArrayMipmapUint, evalTexture2DArrayBiasClamp, FRAGMENT),
3733
3734 CLAMP_CASE_SPEC(sampler3d_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, -10.0f, 10.0f, false, IVec3(0), 0.0f, tex3DMipmapFixed, evalTexture3DBiasClamp, FRAGMENT),
3735 CLAMP_CASE_SPEC(sampler3d_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, -10.0f, 10.0f, false, IVec3(0), 0.0f, tex3DMipmapFloat, evalTexture3DBiasClamp, FRAGMENT),
3736 CLAMP_CASE_SPEC(isampler3d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, 0.0f, 8.0f, false, IVec3(0), 5.0f, tex3DMipmapInt, evalTexture3DBiasClamp, FRAGMENT),
3737 CLAMP_CASE_SPEC(usampler3d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, 0.0f, 8.0f, false, IVec3(0), 5.0f, tex3DMipmapUint, evalTexture3DBiasClamp, FRAGMENT),
3738
3739 CLAMP_CASE_SPEC(sampler1d_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 0.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 4.0f, tex1DMipmapFixed, evalTexture1DBiasClamp, FRAGMENT),
3740 CLAMP_CASE_SPEC(sampler1d_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 0.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 4.0f, tex1DMipmapFloat, evalTexture1DBiasClamp, FRAGMENT),
3741 CLAMP_CASE_SPEC(isampler1d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 0.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex1DMipmapInt, evalTexture1DBiasClamp, FRAGMENT),
3742 CLAMP_CASE_SPEC(usampler1d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 0.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex1DMipmapUint, evalTexture1DBiasClamp, FRAGMENT),
3743
3744 CLAMP_CASE_SPEC(sampler1darray_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 4.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 5.0f, tex1DArrayMipmapFixed, evalTexture1DArrayBiasClamp, FRAGMENT),
3745 CLAMP_CASE_SPEC(sampler1darray_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 4.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 5.0f, tex1DArrayMipmapFloat, evalTexture1DArrayBiasClamp, FRAGMENT),
3746 CLAMP_CASE_SPEC(isampler1darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 4.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex1DArrayMipmapInt, evalTexture1DArrayBiasClamp, FRAGMENT),
3747 CLAMP_CASE_SPEC(usampler1darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 4.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, false, IVec3(0), 7.0f, tex1DArrayMipmapUint, evalTexture1DArrayBiasClamp, FRAGMENT),
3748
3749 CLAMP_CASE_SPEC(samplercubearray_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 1.01f, 0.0f), Vec4(1.0f, 1.0f, 1.01f, 2.0f), true, 0.0f, 5.0f, false, IVec3(0), 3.0f, texCubeArrayMipmapFixed, evalTextureCubeArrayBiasClamp, FRAGMENT),
3750 CLAMP_CASE_SPEC(samplercubearray_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 1.01f, 0.0f), Vec4(1.0f, 1.0f, 1.01f, 2.0f), true, 0.0f, 5.0f, false, IVec3(0), 3.0f, texCubeArrayMipmapFloat, evalTextureCubeArrayBiasClamp, FRAGMENT),
3751 CLAMP_CASE_SPEC(isamplercubearray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 6.01f, 0.0f), Vec4(6.0f, 6.0f, 6.01f, 2.0f), true, 2.0f, 5.0f, false, IVec3(0), 4.0f, texCubeArrayMipmapInt, evalTextureCubeArrayBiasClamp, FRAGMENT),
3752 CLAMP_CASE_SPEC(usamplercubearray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 6.01f, 0.0f), Vec4(6.0f, 6.0f, 6.01f, 2.0f), true, 2.0f, 5.0f, false, IVec3(0), 4.0f, texCubeArrayMipmapUint, evalTextureCubeArrayBiasClamp, FRAGMENT),
3753
3754 CLAMP_CASE_SPEC(sampler2dshadow_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 1.0f, 1.0f, 1.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 7.0f, tex2DMipmapShadow, evalTexture2DShadowBiasClamp, FRAGMENT),
3755 CLAMP_CASE_SPEC(samplercubeshadow_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 1.01f, 0.0f), Vec4( 1.0f, 1.0f, 1.01f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 7.0f, texCubeMipmapShadow, evalTextureCubeShadowBiasClamp, FRAGMENT),
3756 CLAMP_CASE_SPEC(sampler1dshadow_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 1.0f, 0.0f, 1.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 7.0f, tex1DMipmapShadow, evalTexture1DShadowBiasClamp, FRAGMENT),
3757 CLAMP_CASE_SPEC(sampler1darrayshadow_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 1.0f, 4.0f, 1.0f, 0.0f), true, 0.0f, 5.0f, false, IVec3(0), 7.0f, tex1DArrayMipmapShadow, evalTexture1DArrayShadowBiasClamp, FRAGMENT),
3758 };
3759 createCaseGroup(this, "textureclamp", "textureClampARB() Tests", textureClampARBCases, DE_LENGTH_OF_ARRAY(textureClampARBCases));
3760
3761 // textureOffset() cases
3762 // \note _bias variants are not using mipmap thanks to wide allowed range for LOD computation
3763 static const TexFuncCaseSpec textureOffsetCases[] =
3764 {
3765 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3766 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),
3767 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),
3768 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),
3769 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),
3770 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),
3771 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),
3772 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),
3773 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),
3774
3775 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),
3776 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),
3777 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),
3778 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),
3779
3780 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),
3781 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),
3782 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),
3783 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),
3784 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),
3785 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),
3786 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),
3787 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),
3788
3789 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),
3790 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),
3791 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),
3792 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),
3793
3794 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),
3795 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),
3796 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),
3797 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),
3798 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),
3799 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),
3800 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),
3801 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),
3802
3803 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),
3804 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),
3805 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),
3806 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),
3807
3808 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),
3809 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),
3810 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),
3811 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),
3812 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),
3813 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),
3814 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),
3815 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),
3816
3817 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),
3818 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),
3819 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),
3820 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),
3821
3822 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),
3823 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),
3824 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),
3825 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),
3826 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),
3827 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),
3828 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),
3829 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),
3830
3831 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),
3832 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),
3833 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),
3834 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),
3835
3836 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),
3837 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),
3838 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),
3839 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),
3840 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),
3841 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),
3842 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),
3843 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),
3844 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),
3845 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),
3846 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),
3847 };
3848 createCaseGroup(this, "textureoffset", "textureOffset() Tests", textureOffsetCases, DE_LENGTH_OF_ARRAY(textureOffsetCases));
3849
3850 // textureOffsetClampARB() cases
3851 static const TexFuncCaseSpec textureOffsetClampARBCases[] =
3852 {
3853 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset LodClamp Format EvalFunc Flags
3854 CLAMP_CASE_SPEC(sampler2d_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(7, -8, 0), 5.0f, tex2DMipmapFixed, evalTexture2DOffsetBiasClamp, FRAGMENT),
3855 CLAMP_CASE_SPEC(sampler2d_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(7, -8, 0), 5.0f, tex2DMipmapFloat, evalTexture2DOffsetBiasClamp, FRAGMENT),
3856 CLAMP_CASE_SPEC(isampler2d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3(7, -8, 0), 7.0f, tex2DMipmapInt, evalTexture2DOffsetBiasClamp, FRAGMENT),
3857 CLAMP_CASE_SPEC(usampler2d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3(7, -8, 0), 7.0f, tex2DMipmapUint, evalTexture2DOffsetBiasClamp, FRAGMENT),
3858
3859 CLAMP_CASE_SPEC(sampler2darray_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(7, -8, 0), 5.0f, tex2DArrayMipmapFixed, evalTexture2DArrayOffsetBiasClamp, FRAGMENT),
3860 CLAMP_CASE_SPEC(sampler2darray_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(7, -8, 0), 5.0f, tex2DArrayMipmapFloat, evalTexture2DArrayOffsetBiasClamp, FRAGMENT),
3861 CLAMP_CASE_SPEC(isampler2darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3(7, -8, 0), 7.0f, tex2DArrayMipmapInt, evalTexture2DArrayOffsetBiasClamp, FRAGMENT),
3862 CLAMP_CASE_SPEC(usampler2darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3(7, -8, 0), 7.0f, tex2DArrayMipmapUint, evalTexture2DArrayOffsetBiasClamp, FRAGMENT),
3863
3864 CLAMP_CASE_SPEC(sampler3d_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, -12.0f, 12.0f, true, IVec3(-8, 7, 3), 2.0f, tex3DMipmapFixed, evalTexture3DOffsetBiasClamp, FRAGMENT),
3865 CLAMP_CASE_SPEC(sampler3d_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 1.0f, 4.0f, 0.0f), true, -12.0f, 12.0f, true, IVec3(-8, 7, 3), 2.0f, tex3DMipmapFloat, evalTexture3DOffsetBiasClamp, FRAGMENT),
3866 CLAMP_CASE_SPEC(isampler3d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, -5.0f, 5.0f, true, IVec3(-8, 7, 3), 1.0f, tex3DMipmapInt, evalTexture3DOffsetBiasClamp, FRAGMENT),
3867 CLAMP_CASE_SPEC(usampler3d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 6.0f, 4.0f, 0.0f), true, -5.0f, 5.0f, true, IVec3(-8, 7, 3), 1.0f, tex3DMipmapUint, evalTexture3DOffsetBiasClamp, FRAGMENT),
3868
3869 CLAMP_CASE_SPEC(sampler1d_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 0.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(-8, 0, 0), 4.0f, tex1DMipmapFixed, evalTexture1DOffsetBiasClamp, FRAGMENT),
3870 CLAMP_CASE_SPEC(sampler1d_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 0.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3( 7, 0, 0), 4.0f, tex1DMipmapFloat, evalTexture1DOffsetBiasClamp, FRAGMENT),
3871 CLAMP_CASE_SPEC(isampler1d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 0.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3(-8, 0, 0), 7.0f, tex1DMipmapInt, evalTexture1DOffsetBiasClamp, FRAGMENT),
3872 CLAMP_CASE_SPEC(usampler1d_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 0.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3( 7, 0, 0), 7.0f, tex1DMipmapUint, evalTexture1DOffsetBiasClamp, FRAGMENT),
3873
3874 CLAMP_CASE_SPEC(sampler1darray_bias_fixed, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 4.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(-8, 0, 0), 5.0f, tex1DArrayMipmapFixed, evalTexture1DArrayOffsetBiasClamp, FRAGMENT),
3875 CLAMP_CASE_SPEC(sampler1darray_bias_float, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(1.0f, 4.0f, 0.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3( 7, 0, 0), 5.0f, tex1DArrayMipmapFloat, evalTexture1DArrayOffsetBiasClamp, FRAGMENT),
3876 CLAMP_CASE_SPEC(isampler1darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 4.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3(-8, 0, 0), 7.0f, tex1DArrayMipmapInt, evalTexture1DArrayOffsetBiasClamp, FRAGMENT),
3877 CLAMP_CASE_SPEC(usampler1darray_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4(6.0f, 4.0f, 0.0f, 0.0f), true, 2.0f, 5.0f, true, IVec3( 7, 0, 0), 7.0f, tex1DArrayMipmapUint, evalTexture1DArrayOffsetBiasClamp, FRAGMENT),
3878
3879 CLAMP_CASE_SPEC(sampler2dshadow_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 1.0f, 1.0f, 1.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(-8, 7, 0), 7.0f, tex2DMipmapShadow, evalTexture2DShadowOffsetBiasClamp, FRAGMENT),
3880 CLAMP_CASE_SPEC(sampler1dshadow_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 1.0f, 0.0f, 1.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(-8, 0, 0), 7.0f, tex1DMipmapShadow, evalTexture1DShadowOffsetBiasClamp, FRAGMENT),
3881 CLAMP_CASE_SPEC(sampler1darrayshadow_bias, FUNCTION_TEXTURE, Vec4(0.0f, 0.0f, 0.0f, 0.0f), Vec4( 1.0f, 4.0f, 1.0f, 0.0f), true, 0.0f, 5.0f, true, IVec3(-8, 0, 0), 7.0f, tex1DArrayMipmapShadow, evalTexture1DArrayShadowOffsetBiasClamp, FRAGMENT),
3882 };
3883 createCaseGroup(this, "textureoffsetclamp", "textureOffsetClampARB() Tests", textureOffsetClampARBCases, DE_LENGTH_OF_ARRAY(textureOffsetClampARBCases));
3884
3885 // textureProj() cases
3886 // \note Currently uses constant divider!
3887 static const TexFuncCaseSpec textureProjCases[] =
3888 {
3889 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3890 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),
3891 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),
3892 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),
3893 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),
3894 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),
3895 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),
3896 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),
3897 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),
3898
3899 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),
3900 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),
3901 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),
3902 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),
3903
3904 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),
3905 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),
3906 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),
3907 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),
3908 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),
3909 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),
3910 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),
3911 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),
3912
3913 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),
3914 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),
3915 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),
3916 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),
3917
3918 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),
3919 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),
3920 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),
3921 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),
3922 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),
3923 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),
3924 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),
3925 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),
3926
3927 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),
3928 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),
3929 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),
3930 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),
3931
3932 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),
3933 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),
3934 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),
3935 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),
3936 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),
3937 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),
3938 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),
3939 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),
3940
3941 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),
3942 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),
3943 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),
3944 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),
3945
3946 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),
3947 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),
3948 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),
3949 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),
3950 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),
3951 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),
3952 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),
3953 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),
3954
3955 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),
3956 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),
3957 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),
3958 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),
3959
3960 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),
3961 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),
3962 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),
3963 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),
3964 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),
3965 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),
3966 };
3967 createCaseGroup(this, "textureproj", "textureProj() Tests", textureProjCases, DE_LENGTH_OF_ARRAY(textureProjCases));
3968
3969 // textureProjOffset() cases
3970 // \note Currently uses constant divider!
3971 static const TexFuncCaseSpec textureProjOffsetCases[] =
3972 {
3973 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
3974 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),
3975 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),
3976 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),
3977 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),
3978 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),
3979 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),
3980 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),
3981 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),
3982
3983 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),
3984 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),
3985 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),
3986 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),
3987
3988 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),
3989 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),
3990 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),
3991 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),
3992 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),
3993 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),
3994 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),
3995 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),
3996
3997 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),
3998 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),
3999 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),
4000 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),
4001
4002 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),
4003 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),
4004 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),
4005 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),
4006 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),
4007 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),
4008 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),
4009 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),
4010
4011 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),
4012 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),
4013 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),
4014 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),
4015
4016 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),
4017 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),
4018 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),
4019 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),
4020 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),
4021 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),
4022 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),
4023 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),
4024
4025 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),
4026 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),
4027 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),
4028 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),
4029
4030 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),
4031 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),
4032 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),
4033 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),
4034 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),
4035 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),
4036 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),
4037 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),
4038
4039 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),
4040 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),
4041 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),
4042 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),
4043
4044 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),
4045 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),
4046 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),
4047 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),
4048 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),
4049 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),
4050 };
4051 createCaseGroup(this, "textureprojoffset", "textureOffsetProj() Tests", textureProjOffsetCases, DE_LENGTH_OF_ARRAY(textureProjOffsetCases));
4052
4053 // textureLod() cases
4054 static const TexFuncCaseSpec textureLodCases[] =
4055 {
4056 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
4057 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),
4058 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),
4059 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),
4060 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),
4061
4062 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),
4063 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),
4064 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),
4065 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),
4066
4067 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),
4068 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),
4069 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),
4070 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),
4071
4072 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),
4073 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),
4074 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),
4075 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),
4076
4077 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),
4078 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),
4079 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),
4080 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),
4081
4082 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),
4083 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),
4084 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),
4085 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),
4086
4087 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),
4088 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),
4089 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),
4090 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),
4091
4092 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),
4093 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),
4094 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),
4095 };
4096 createCaseGroup(this, "texturelod", "textureLod() Tests", textureLodCases, DE_LENGTH_OF_ARRAY(textureLodCases));
4097
4098 // textureLodOffset() cases
4099 static const TexFuncCaseSpec textureLodOffsetCases[] =
4100 {
4101 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
4102 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),
4103 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),
4104 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),
4105 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),
4106
4107 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),
4108 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),
4109 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),
4110 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),
4111
4112 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),
4113 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),
4114 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),
4115 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),
4116
4117 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),
4118 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),
4119 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),
4120 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),
4121
4122 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),
4123 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),
4124 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),
4125 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),
4126
4127 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),
4128 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),
4129 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),
4130 };
4131 createCaseGroup(this, "texturelodoffset", "textureLodOffset() Tests", textureLodOffsetCases, DE_LENGTH_OF_ARRAY(textureLodOffsetCases));
4132
4133 // textureProjLod() cases
4134 static const TexFuncCaseSpec textureProjLodCases[] =
4135 {
4136 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
4137 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),
4138 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),
4139 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),
4140 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),
4141
4142 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),
4143 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),
4144 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),
4145 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),
4146
4147 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),
4148 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),
4149 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),
4150 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),
4151
4152 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),
4153 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),
4154 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),
4155 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),
4156
4157 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),
4158 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),
4159 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),
4160 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),
4161
4162 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),
4163 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),
4164 };
4165 createCaseGroup(this, "textureprojlod", "textureProjLod() Tests", textureProjLodCases, DE_LENGTH_OF_ARRAY(textureProjLodCases));
4166
4167 // textureProjLodOffset() cases
4168 static const TexFuncCaseSpec textureProjLodOffsetCases[] =
4169 {
4170 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
4171 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),
4172 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),
4173 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),
4174 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),
4175
4176 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),
4177 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),
4178 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),
4179 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),
4180
4181 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),
4182 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),
4183 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),
4184 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),
4185
4186 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),
4187 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),
4188 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),
4189 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),
4190
4191 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),
4192 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),
4193 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),
4194 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),
4195
4196 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),
4197 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),
4198 };
4199 createCaseGroup(this, "textureprojlodoffset", "textureProjLodOffset() Tests", textureProjLodOffsetCases, DE_LENGTH_OF_ARRAY(textureProjLodOffsetCases));
4200
4201 // textureGrad() cases
4202 // \note Only one of dudx, dudy, dvdx, dvdy is non-zero since spec allows approximating p from derivates by various methods.
4203 static const TexFuncCaseSpec textureGradCases[] =
4204 {
4205 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
4206 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),
4207 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),
4208 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),
4209 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),
4210
4211 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),
4212 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),
4213 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),
4214 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),
4215
4216 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),
4217 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),
4218 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),
4219 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),
4220
4221 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),
4222 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),
4223 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),
4224 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),
4225 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),
4226 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),
4227
4228 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),
4229 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),
4230 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),
4231 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),
4232
4233 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),
4234 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),
4235 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),
4236 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),
4237
4238 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),
4239 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),
4240 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),
4241 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),
4242
4243 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),
4244 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),
4245 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),
4246 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),
4247 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),
4248 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),
4249 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),
4250 };
4251 createCaseGroup(this, "texturegrad", "textureGrad() Tests", textureGradCases, DE_LENGTH_OF_ARRAY(textureGradCases));
4252
4253 // textureGradClampARB() cases
4254 static const TexFuncCaseSpec textureGradClampCases[] =
4255 {
4256 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset LodClamp Format EvalFunc Flags
4257 GRADCLAMP_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), 5.0f, tex2DMipmapFixed, evalTexture2DGradClamp, FRAGMENT),
4258 GRADCLAMP_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), 5.0f, tex2DMipmapFloat, evalTexture2DGradClamp, FRAGMENT),
4259 GRADCLAMP_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), 5.0f, tex2DMipmapInt, evalTexture2DGradClamp, FRAGMENT),
4260 GRADCLAMP_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), 5.0f, tex2DMipmapUint, evalTexture2DGradClamp, FRAGMENT),
4261
4262 GRADCLAMP_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), 5.0f, texCubeMipmapFixed, evalTextureCubeGradClamp, FRAGMENT),
4263 GRADCLAMP_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), 5.0f, texCubeMipmapFloat, evalTextureCubeGradClamp, FRAGMENT),
4264 GRADCLAMP_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), 5.0f, texCubeMipmapInt, evalTextureCubeGradClamp, FRAGMENT),
4265 GRADCLAMP_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), 5.0f, texCubeMipmapUint, evalTextureCubeGradClamp, FRAGMENT),
4266
4267 GRADCLAMP_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), 5.0f, tex2DArrayMipmapFixed, evalTexture2DArrayGradClamp, FRAGMENT),
4268 GRADCLAMP_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), 5.0f, tex2DArrayMipmapFloat, evalTexture2DArrayGradClamp, FRAGMENT),
4269 GRADCLAMP_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), 5.0f, tex2DArrayMipmapInt, evalTexture2DArrayGradClamp, FRAGMENT),
4270 GRADCLAMP_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), 5.0f, tex2DArrayMipmapUint, evalTexture2DArrayGradClamp, FRAGMENT),
4271
4272 GRADCLAMP_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), 5.0f, tex3DMipmapFixed, evalTexture3DGradClamp, FRAGMENT),
4273 GRADCLAMP_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), 5.0f, tex3DMipmapFloat, evalTexture3DGradClamp, FRAGMENT),
4274 GRADCLAMP_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), 5.0f, tex3DMipmapInt, evalTexture3DGradClamp, FRAGMENT),
4275 GRADCLAMP_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), 5.0f, tex3DMipmapUint, evalTexture3DGradClamp, FRAGMENT),
4276
4277 GRADCLAMP_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), 5.0f, tex1DMipmapFixed, evalTexture1DGradClamp, FRAGMENT),
4278 GRADCLAMP_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), 5.0f, tex1DMipmapFloat, evalTexture1DGradClamp, FRAGMENT),
4279 GRADCLAMP_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), 5.0f, tex1DMipmapInt, evalTexture1DGradClamp, FRAGMENT),
4280 GRADCLAMP_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), 5.0f, tex1DMipmapUint, evalTexture1DGradClamp, FRAGMENT),
4281
4282 GRADCLAMP_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), 5.0f, tex1DArrayMipmapFixed, evalTexture1DArrayGradClamp, FRAGMENT),
4283 GRADCLAMP_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), 5.0f, tex1DArrayMipmapFloat, evalTexture1DArrayGradClamp, FRAGMENT),
4284 GRADCLAMP_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), 5.0f, tex1DArrayMipmapInt, evalTexture1DArrayGradClamp, FRAGMENT),
4285 GRADCLAMP_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), 5.0f, tex1DArrayMipmapUint, evalTexture1DArrayGradClamp, FRAGMENT),
4286
4287 GRADCLAMP_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), 4.0f, texCubeArrayMipmapFixed, evalTextureCubeArrayGradClamp, FRAGMENT),
4288 GRADCLAMP_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), 4.0f, texCubeArrayMipmapFloat, evalTextureCubeArrayGradClamp, FRAGMENT),
4289 GRADCLAMP_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), 4.0f, texCubeArrayMipmapInt, evalTextureCubeArrayGradClamp, FRAGMENT),
4290 GRADCLAMP_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), 4.0f, texCubeArrayMipmapUint, evalTextureCubeArrayGradClamp, FRAGMENT),
4291
4292 GRADCLAMP_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), 5.0f, tex2DMipmapShadow, evalTexture2DShadowGradClamp, FRAGMENT),
4293 GRADCLAMP_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), 5.0f, texCubeMipmapShadow, evalTextureCubeShadowGradClamp, FRAGMENT),
4294 GRADCLAMP_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), 5.0f, tex2DArrayMipmapShadow, evalTexture2DArrayShadowGradClamp, FRAGMENT),
4295 GRADCLAMP_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), 5.0f, tex1DMipmapShadow, evalTexture1DShadowGradClamp, FRAGMENT),
4296 GRADCLAMP_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), 5.0f, tex1DArrayMipmapShadow, evalTexture1DArrayShadowGradClamp, FRAGMENT),
4297 };
4298 createCaseGroup(this, "texturegradclamp", "textureGradClampARB() Tests", textureGradClampCases, DE_LENGTH_OF_ARRAY(textureGradClampCases));
4299
4300 // textureGradOffset() cases
4301 static const TexFuncCaseSpec textureGradOffsetCases[] =
4302 {
4303 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
4304 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),
4305 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),
4306 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),
4307 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),
4308
4309 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),
4310 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),
4311 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),
4312 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),
4313
4314 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),
4315 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),
4316 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),
4317 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),
4318 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),
4319 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),
4320
4321 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),
4322 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),
4323 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),
4324 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),
4325
4326 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),
4327 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),
4328 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),
4329 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),
4330
4331 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),
4332 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),
4333 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),
4334 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),
4335 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),
4336 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),
4337 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),
4338 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),
4339 };
4340 createCaseGroup(this, "texturegradoffset", "textureGradOffset() Tests", textureGradOffsetCases, DE_LENGTH_OF_ARRAY(textureGradOffsetCases));
4341
4342 // textureGradOffsetClampARB() cases
4343 static const TexFuncCaseSpec textureGradOffsetClampCases[] =
4344 {
4345 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset LodClamp Format EvalFunc Flags
4346 GRADCLAMP_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), 5.0f, tex2DMipmapFixed, evalTexture2DGradOffsetClamp, FRAGMENT),
4347 GRADCLAMP_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), 5.0f, tex2DMipmapFloat, evalTexture2DGradOffsetClamp, FRAGMENT),
4348 GRADCLAMP_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), 5.0f, tex2DMipmapInt, evalTexture2DGradOffsetClamp, FRAGMENT),
4349 GRADCLAMP_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), 5.0f, tex2DMipmapUint, evalTexture2DGradOffsetClamp, FRAGMENT),
4350
4351 GRADCLAMP_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), 5.0f, tex2DArrayMipmapFixed, evalTexture2DArrayGradOffsetClamp, FRAGMENT),
4352 GRADCLAMP_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), 5.0f, tex2DArrayMipmapFloat, evalTexture2DArrayGradOffsetClamp, FRAGMENT),
4353 GRADCLAMP_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), 5.0f, tex2DArrayMipmapInt, evalTexture2DArrayGradOffsetClamp, FRAGMENT),
4354 GRADCLAMP_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), 5.0f, tex2DArrayMipmapUint, evalTexture2DArrayGradOffsetClamp, FRAGMENT),
4355
4356 GRADCLAMP_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), 5.0f, tex3DMipmapFixed, evalTexture3DGradOffsetClamp, FRAGMENT),
4357 GRADCLAMP_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), 5.0f, tex3DMipmapFloat, evalTexture3DGradOffsetClamp, FRAGMENT),
4358 GRADCLAMP_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), 5.0f, tex3DMipmapInt, evalTexture3DGradOffsetClamp, FRAGMENT),
4359 GRADCLAMP_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), 5.0f, tex3DMipmapUint, evalTexture3DGradOffsetClamp, FRAGMENT),
4360
4361 GRADCLAMP_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), 5.0f, tex1DMipmapFixed, evalTexture1DGradOffsetClamp, FRAGMENT),
4362 GRADCLAMP_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), 5.0f, tex1DMipmapFloat, evalTexture1DGradOffsetClamp, FRAGMENT),
4363 GRADCLAMP_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), 5.0f, tex1DMipmapInt, evalTexture1DGradOffsetClamp, FRAGMENT),
4364 GRADCLAMP_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), 5.0f, tex1DMipmapUint, evalTexture1DGradOffsetClamp, FRAGMENT),
4365
4366 GRADCLAMP_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), 5.0f, tex1DArrayMipmapFixed, evalTexture1DArrayGradOffsetClamp, FRAGMENT),
4367 GRADCLAMP_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), 5.0f, tex1DArrayMipmapFloat, evalTexture1DArrayGradOffsetClamp, FRAGMENT),
4368 GRADCLAMP_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), 5.0f, tex1DArrayMipmapInt, evalTexture1DArrayGradOffsetClamp, FRAGMENT),
4369 GRADCLAMP_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), 5.0f, tex1DArrayMipmapUint, evalTexture1DArrayGradOffsetClamp, FRAGMENT),
4370
4371 GRADCLAMP_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), 5.0f, tex2DMipmapShadow, evalTexture2DShadowGradOffsetClamp, FRAGMENT),
4372 GRADCLAMP_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), 5.0f, tex2DArrayMipmapShadow, evalTexture2DArrayShadowGradOffsetClamp, FRAGMENT),
4373 GRADCLAMP_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), 5.0f, tex1DMipmapShadow, evalTexture1DShadowGradOffsetClamp, FRAGMENT),
4374 GRADCLAMP_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), 5.0f, tex1DArrayMipmapShadow, evalTexture1DArrayShadowGradOffsetClamp, FRAGMENT),
4375 };
4376 createCaseGroup(this, "texturegradoffsetclamp", "textureGradOffsetClampARB() Tests", textureGradOffsetClampCases, DE_LENGTH_OF_ARRAY(textureGradOffsetClampCases));
4377
4378
4379 // textureProjGrad() cases
4380 static const TexFuncCaseSpec textureProjGradCases[] =
4381 {
4382 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
4383 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),
4384 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),
4385 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),
4386 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),
4387
4388 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),
4389 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),
4390 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),
4391 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),
4392
4393 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),
4394 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),
4395 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),
4396 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),
4397 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),
4398 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),
4399
4400 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),
4401 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),
4402 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),
4403 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),
4404
4405 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),
4406 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),
4407 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),
4408 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),
4409
4410 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),
4411 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),
4412 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),
4413 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),
4414 };
4415 createCaseGroup(this, "textureprojgrad", "textureProjGrad() Tests", textureProjGradCases, DE_LENGTH_OF_ARRAY(textureProjGradCases));
4416
4417 // textureProjGradOffset() cases
4418 static const TexFuncCaseSpec textureProjGradOffsetCases[] =
4419 {
4420 // Name Function MinCoord MaxCoord MinDx MaxDx MinDy MaxDy Offset? Offset Format EvalFunc Flags
4421 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),
4422 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),
4423 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),
4424 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),
4425
4426 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),
4427 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),
4428 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),
4429 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),
4430
4431 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),
4432 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),
4433 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),
4434 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),
4435 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),
4436 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),
4437
4438 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),
4439 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),
4440 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),
4441 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),
4442
4443 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),
4444 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),
4445 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),
4446 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),
4447
4448 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),
4449 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),
4450 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),
4451 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),
4452 };
4453 createCaseGroup(this, "textureprojgradoffset", "textureProjGradOffset() Tests", textureProjGradOffsetCases, DE_LENGTH_OF_ARRAY(textureProjGradOffsetCases));
4454
4455 // texelFetch() cases
4456 // \note Level is constant across quad
4457 static const TexFuncCaseSpec texelFetchCases[] =
4458 {
4459 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
4460 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),
4461 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),
4462 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),
4463 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),
4464
4465 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),
4466 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),
4467 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),
4468 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),
4469
4470 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),
4471 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),
4472 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),
4473 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),
4474
4475 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),
4476 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),
4477 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),
4478 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),
4479
4480 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),
4481 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),
4482 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),
4483 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),
4484 };
4485 createCaseGroup(this, "texelfetch", "texelFetch() Tests", texelFetchCases, DE_LENGTH_OF_ARRAY(texelFetchCases));
4486
4487 // texelFetchOffset() cases
4488 static const TexFuncCaseSpec texelFetchOffsetCases[] =
4489 {
4490 // Name Function MinCoord MaxCoord Bias? MinLod MaxLod Offset? Offset Format EvalFunc Flags
4491 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),
4492 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),
4493 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),
4494 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),
4495
4496 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),
4497 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),
4498 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),
4499 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),
4500
4501 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),
4502 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),
4503 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),
4504 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),
4505
4506 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),
4507 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),
4508 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),
4509 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),
4510
4511 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),
4512 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),
4513 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),
4514 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),
4515 };
4516 createCaseGroup(this, "texelfetchoffset", "texelFetchOffset() Tests", texelFetchOffsetCases, DE_LENGTH_OF_ARRAY(texelFetchOffsetCases));
4517
4518 // texture query functions
4519 {
4520 struct TexQueryFuncCaseSpec
4521 {
4522 const char* name;
4523 const char* samplerName;
4524 TextureSpec textureSpec;
4525 };
4526
4527 de::MovePtr<tcu::TestCaseGroup> queryGroup (new tcu::TestCaseGroup(m_testCtx, "query", "Texture query function tests"));
4528
4529 // textureSize() cases
4530 {
4531 const TexQueryFuncCaseSpec textureSizeCases[] =
4532 {
4533 { "sampler2d_fixed", "sampler2D", tex2DFixed },
4534 { "sampler2d_float", "sampler2D", tex2DFloat },
4535 { "isampler2d", "isampler2D", tex2DInt },
4536 { "usampler2d", "usampler2D", tex2DUint },
4537 { "sampler2dshadow", "sampler2DShadow", tex2DShadow },
4538 { "sampler3d_fixed", "sampler3D", tex3DFixed },
4539 { "sampler3d_float", "sampler3D", tex3DFloat },
4540 { "isampler3d", "isampler3D", tex3DInt },
4541 { "usampler3d", "usampler3D", tex3DUint },
4542 { "samplercube_fixed", "samplerCube", texCubeFixed },
4543 { "samplercube_float", "samplerCube", texCubeFloat },
4544 { "isamplercube", "isamplerCube", texCubeInt },
4545 { "usamplercube", "usamplerCube", texCubeUint },
4546 { "samplercubeshadow", "samplerCubeShadow", texCubeShadow },
4547 { "sampler2darray_fixed", "sampler2DArray", tex2DArrayFixed },
4548 { "sampler2darray_float", "sampler2DArray", tex2DArrayFloat },
4549 { "isampler2darray", "isampler2DArray", tex2DArrayInt },
4550 { "usampler2darray", "usampler2DArray", tex2DArrayUint },
4551 { "sampler2darrayshadow", "sampler2DArrayShadow", tex2DArrayShadow },
4552 { "samplercubearray_fixed", "samplerCubeArray", texCubeArrayFixed },
4553 { "samplercubearray_float", "samplerCubeArray", texCubeArrayFloat },
4554 { "isamplercubearray", "isamplerCubeArray", texCubeArrayInt },
4555 { "usamplercubearray", "usamplerCubeArray", texCubeArrayUint },
4556 { "samplercubearrayshadow", "samplerCubeArrayShadow", texCubeArrayShadow },
4557 { "sampler1d_fixed", "sampler1D", tex1DFixed },
4558 { "sampler1d_float", "sampler1D", tex1DFloat },
4559 { "isampler1d", "isampler1D", tex1DInt },
4560 { "usampler1d", "usampler1D", tex1DUint },
4561 { "sampler1dshadow", "sampler1DShadow", tex1DShadow },
4562 { "sampler1darray_fixed", "sampler1DArray", tex1DArrayFixed },
4563 { "sampler1darray_float", "sampler1DArray", tex1DArrayFloat },
4564 { "isampler1darray", "isampler1DArray", tex1DArrayInt },
4565 { "usampler1darray", "usampler1DArray", tex1DArrayUint },
4566 { "sampler1darrayshadow", "sampler1DArrayShadow", tex1DArrayShadow },
4567 };
4568
4569 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturesize", "textureSize() Tests"));
4570
4571 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureSizeCases); ++ndx)
4572 {
4573 const TexQueryFuncCaseSpec& caseSpec = textureSizeCases[ndx];
4574
4575 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_vertex"), "", caseSpec.samplerName, caseSpec.textureSpec, true, QUERYFUNCTION_TEXTURESIZE));
4576 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTURESIZE));
4577 }
4578
4579 queryGroup->addChild(group.release());
4580 }
4581
4582 // textureSize() cases for multisample textures
4583 {
4584 const TexQueryFuncCaseSpec textureSizeMSCases[] =
4585 {
4586 { "sampler2dms_fixed", "sampler2DMS", tex2DFixed },
4587 { "sampler2dms_float", "sampler2DMS", tex2DFloat },
4588 { "isampler2dms", "isampler2DMS", tex2DInt },
4589 { "usampler2dms", "usampler2DMS", tex2DUint },
4590 { "sampler2dmsarray_fixed", "sampler2DMSArray", tex2DArrayFixed },
4591 { "sampler2dmsarray_float", "sampler2DMSArray", tex2DArrayFloat },
4592 { "isampler2dmsarray", "isampler2DMSArray", tex2DArrayInt },
4593 { "usampler2dmsarray", "usampler2DMSArray", tex2DArrayUint },
4594 };
4595
4596 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturesizems", "textureSize() Tests for Multisample Textures"));
4597
4598 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureSizeMSCases); ++ndx)
4599 {
4600 const TexQueryFuncCaseSpec& caseSpec = textureSizeMSCases[ndx];
4601
4602 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_vertex"), "", caseSpec.samplerName, caseSpec.textureSpec, true, QUERYFUNCTION_TEXTURESIZEMS));
4603 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTURESIZEMS));
4604 }
4605
4606 queryGroup->addChild(group.release());
4607 }
4608
4609 // textureSamples() cases
4610 {
4611 const TexQueryFuncCaseSpec textureSamplesCases[] =
4612 {
4613 { "sampler2dms_fixed", "sampler2DMS", tex2DFixed },
4614 { "sampler2dms_float", "sampler2DMS", tex2DFloat },
4615 { "isampler2dms", "isampler2DMS", tex2DInt },
4616 { "usampler2dms", "usampler2DMS", tex2DUint },
4617 { "sampler2dmsarray_fixed", "sampler2DMSArray", tex2DArrayFixed },
4618 { "sampler2dmsarray_float", "sampler2DMSArray", tex2DArrayFloat },
4619 { "isampler2dmsarray", "isampler2DMSArray", tex2DArrayInt },
4620 { "usampler2dmsarray", "usampler2DMSArray", tex2DArrayUint },
4621 };
4622
4623 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturesamples", "textureSamples() Tests"));
4624
4625 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureSamplesCases); ++ndx)
4626 {
4627 const TexQueryFuncCaseSpec& caseSpec = textureSamplesCases[ndx];
4628
4629 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_vertex"), "", caseSpec.samplerName, caseSpec.textureSpec, true, QUERYFUNCTION_TEXTURESAMPLES));
4630 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTURESAMPLES));
4631 }
4632
4633 queryGroup->addChild(group.release());
4634 }
4635
4636 // textureQueryLevels() cases
4637 {
4638 const TexQueryFuncCaseSpec textureQueryLevelsCases[] =
4639 {
4640 { "sampler2d_fixed", "sampler2D", tex2DFixed },
4641 { "sampler2d_float", "sampler2D", tex2DFloat },
4642 { "isampler2d", "isampler2D", tex2DInt },
4643 { "usampler2d", "usampler2D", tex2DUint },
4644 { "sampler2dshadow", "sampler2DShadow", tex2DShadow },
4645 { "sampler3d_fixed", "sampler3D", tex3DFixed },
4646 { "sampler3d_float", "sampler3D", tex3DFloat },
4647 { "isampler3d", "isampler3D", tex3DInt },
4648 { "usampler3d", "usampler3D", tex3DUint },
4649 { "samplercube_fixed", "samplerCube", texCubeFixed },
4650 { "samplercube_float", "samplerCube", texCubeFloat },
4651 { "isamplercube", "isamplerCube", texCubeInt },
4652 { "usamplercube", "usamplerCube", texCubeUint },
4653 { "samplercubeshadow", "samplerCubeShadow", texCubeShadow },
4654 { "sampler2darray_fixed", "sampler2DArray", tex2DArrayFixed },
4655 { "sampler2darray_float", "sampler2DArray", tex2DArrayFloat },
4656 { "isampler2darray", "isampler2DArray", tex2DArrayInt },
4657 { "usampler2darray", "usampler2DArray", tex2DArrayUint },
4658 { "sampler2darrayshadow", "sampler2DArrayShadow", tex2DArrayShadow },
4659 { "samplercubearray_fixed", "samplerCubeArray", texCubeArrayFixed },
4660 { "samplercubearray_float", "samplerCubeArray", texCubeArrayFloat },
4661 { "isamplercubearray", "isamplerCubeArray", texCubeArrayInt },
4662 { "usamplercubearray", "usamplerCubeArray", texCubeArrayUint },
4663 { "samplercubearrayshadow", "samplerCubeArrayShadow", texCubeArrayShadow },
4664 { "sampler1d_fixed", "sampler1D", tex1DFixed },
4665 { "sampler1d_float", "sampler1D", tex1DFloat },
4666 { "isampler1d", "isampler1D", tex1DInt },
4667 { "usampler1d", "usampler1D", tex1DUint },
4668 { "sampler1dshadow", "sampler1DShadow", tex1DShadow },
4669 { "sampler1darray_fixed", "sampler1DArray", tex1DArrayFixed },
4670 { "sampler1darray_float", "sampler1DArray", tex1DArrayFloat },
4671 { "isampler1darray", "isampler1DArray", tex1DArrayInt },
4672 { "usampler1darray", "usampler1DArray", tex1DArrayUint },
4673 { "sampler1darrayshadow", "sampler1DArrayShadow", tex1DArrayShadow },
4674 };
4675
4676 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturequerylevels", "textureQueryLevels() Tests"));
4677
4678 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureQueryLevelsCases); ++ndx)
4679 {
4680 const TexQueryFuncCaseSpec& caseSpec = textureQueryLevelsCases[ndx];
4681
4682 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_vertex"), "", caseSpec.samplerName, caseSpec.textureSpec, true, QUERYFUNCTION_TEXTUREQUERYLEVELS));
4683 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTUREQUERYLEVELS));
4684 }
4685
4686 queryGroup->addChild(group.release());
4687 }
4688
4689 // textureQueryLod() cases
4690 {
4691 const TexQueryFuncCaseSpec textureQueryLodCases[] =
4692 {
4693 { "sampler2d_fixed", "sampler2D", tex2DMipmapFixed },
4694 { "sampler2d_float", "sampler2D", tex2DMipmapFloat },
4695 { "isampler2d", "isampler2D", tex2DMipmapInt },
4696 { "usampler2d", "usampler2D", tex2DMipmapUint },
4697 { "sampler2dshadow", "sampler2DShadow", tex2DMipmapShadow },
4698 { "sampler3d_fixed", "sampler3D", tex3DMipmapFixed },
4699 { "sampler3d_float", "sampler3D", tex3DMipmapFloat },
4700 { "isampler3d", "isampler3D", tex3DMipmapInt },
4701 { "usampler3d", "usampler3D", tex3DMipmapUint },
4702 { "samplercube_fixed", "samplerCube", texCubeMipmapFixed },
4703 { "samplercube_float", "samplerCube", texCubeMipmapFloat },
4704 { "isamplercube", "isamplerCube", texCubeMipmapInt },
4705 { "usamplercube", "usamplerCube", texCubeMipmapUint },
4706 { "samplercubeshadow", "samplerCubeShadow", texCubeMipmapShadow },
4707 { "sampler2darray_fixed", "sampler2DArray", tex2DArrayMipmapFixed },
4708 { "sampler2darray_float", "sampler2DArray", tex2DArrayMipmapFloat },
4709 { "isampler2darray", "isampler2DArray", tex2DArrayMipmapInt },
4710 { "usampler2darray", "usampler2DArray", tex2DArrayMipmapUint },
4711 { "sampler2darrayshadow", "sampler2DArrayShadow", tex2DArrayMipmapShadow },
4712 { "samplercubearray_fixed", "samplerCubeArray", texCubeArrayMipmapFixed },
4713 { "samplercubearray_float", "samplerCubeArray", texCubeArrayMipmapFloat },
4714 { "isamplercubearray", "isamplerCubeArray", texCubeArrayMipmapInt },
4715 { "usamplercubearray", "usamplerCubeArray", texCubeArrayMipmapUint },
4716 { "samplercubearrayshadow", "samplerCubeArrayShadow", texCubeArrayMipmapShadow },
4717 { "sampler1d_fixed", "sampler1D", tex1DMipmapFixed },
4718 { "sampler1d_float", "sampler1D", tex1DMipmapFloat },
4719 { "isampler1d", "isampler1D", tex1DMipmapInt },
4720 { "usampler1d", "usampler1D", tex1DMipmapUint },
4721 { "sampler1dshadow", "sampler1DShadow", tex1DMipmapShadow },
4722 { "sampler1darray_fixed", "sampler1DArray", tex1DArrayMipmapFixed },
4723 { "sampler1darray_float", "sampler1DArray", tex1DArrayMipmapFloat },
4724 { "isampler1darray", "isampler1DArray", tex1DArrayMipmapInt },
4725 { "usampler1darray", "usampler1DArray", tex1DArrayMipmapUint },
4726 { "sampler1darrayshadow", "sampler1DArrayShadow", tex1DArrayMipmapShadow },
4727 };
4728
4729 de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(m_testCtx, "texturequerylod", "textureQueryLod() Tests"));
4730
4731 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(textureQueryLodCases); ++ndx)
4732 {
4733 const TexQueryFuncCaseSpec& caseSpec = textureQueryLodCases[ndx];
4734
4735 // available only in fragment shader
4736 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTUREQUERYLOD));
4737 group->addChild(new TextureQueryCase(m_testCtx, (std::string(caseSpec.name) + "_zero_uv_width_fragment"), "", caseSpec.samplerName, caseSpec.textureSpec, false, QUERYFUNCTION_TEXTUREQUERYLOD, QLODTM_ZERO_UV_WIDTH));
4738 }
4739
4740 queryGroup->addChild(group.release());
4741 }
4742
4743 addChild(queryGroup.release());
4744 }
4745 }
4746
4747 } // anonymous
4748
createTextureFunctionTests(tcu::TestContext & testCtx)4749 tcu::TestCaseGroup* createTextureFunctionTests (tcu::TestContext& testCtx)
4750 {
4751 return new ShaderTextureFunctionTests(testCtx);
4752 }
4753
4754 } // sr
4755 } // vkt
4756