tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

es3fShaderTextureFunctionTests.js (245903B)


      1 /*-------------------------------------------------------------------------
      2 * drawElements Quality Program OpenGL ES Utilities
      3 * ------------------------------------------------
      4 *
      5 * Copyright 2014 The Android Open Source Project
      6 *
      7 * Licensed under the Apache License, Version 2.0 (the "License");
      8 * you may not use this file except in compliance with the License.
      9 * You may obtain a copy of the License at
     10 *
     11 *      http://www.apache.org/licenses/LICENSE-2.0
     12 *
     13 * Unless required by applicable law or agreed to in writing, software
     14 * distributed under the License is distributed on an "AS IS" BASIS,
     15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 * See the License for the specific language governing permissions and
     17 * limitations under the License.
     18 *
     19 */
     20 
     21 'use strict';
     22 goog.provide('functional.gles3.es3fShaderTextureFunctionTests');
     23 goog.require('framework.delibs.debase.deMath');
     24 goog.require('framework.opengl.gluTextureUtil');
     25 goog.require('framework.opengl.gluTexture');
     26 goog.require('framework.opengl.gluShaderProgram');
     27 goog.require('framework.opengl.gluShaderUtil');
     28 goog.require('framework.common.tcuMatrix');
     29 goog.require('framework.common.tcuSurface');
     30 goog.require('framework.common.tcuTestCase');
     31 goog.require('framework.common.tcuTexture');
     32 goog.require('framework.common.tcuTextureUtil');
     33 goog.require('modules.shared.glsShaderRenderCase');
     34 
     35 goog.scope(function() {
     36    var es3fShaderTextureFunctionTests = functional.gles3.es3fShaderTextureFunctionTests;
     37    var deMath = framework.delibs.debase.deMath;
     38    var tcuMatrix = framework.common.tcuMatrix;
     39    var tcuTestCase = framework.common.tcuTestCase;
     40    var tcuSurface = framework.common.tcuSurface;
     41    var tcuTexture = framework.common.tcuTexture;
     42    var tcuTextureUtil = framework.common.tcuTextureUtil;
     43    var gluTextureUtil = framework.opengl.gluTextureUtil;
     44    var gluTexture = framework.opengl.gluTexture;
     45    var gluShaderProgram = framework.opengl.gluShaderProgram;
     46    var gluShaderUtil = framework.opengl.gluShaderUtil;
     47    var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
     48 
     49    let canvasWH = 256;
     50    if (tcuTestCase.isQuickMode()) {
     51        canvasWH = 32;
     52    }
     53 
     54    /**
     55     * @enum
     56     */
     57    es3fShaderTextureFunctionTests.TexFunction = {
     58        TEXTURE: 0, //!< texture(), textureOffset()
     59        TEXTUREPROJ: 1, //!< textureProj(), textureProjOffset()
     60        TEXTUREPROJ3: 2, //!< textureProj(sampler2D, vec3)
     61        TEXTURELOD: 3, // ...
     62        TEXTUREPROJLOD: 4,
     63        TEXTUREPROJLOD3: 5, //!< textureProjLod(sampler2D, vec3)
     64        TEXTUREGRAD: 6,
     65        TEXTUREPROJGRAD: 7,
     66        TEXTUREPROJGRAD3: 8, //!< textureProjGrad(sampler2D, vec3)
     67        TEXELFETCH: 9
     68    };
     69 
     70    /**
     71     * @param {gluShaderProgram.shaderType} shaderType
     72     * @param {es3fShaderTextureFunctionTests.TexFunction} function_
     73     * @return {boolean}
     74     */
     75    es3fShaderTextureFunctionTests.functionHasAutoLod = function(shaderType, function_) {
     76        return shaderType === gluShaderProgram.shaderType.FRAGMENT &&
     77            (function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTURE ||
     78            function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ ||
     79            function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3);
     80    };
     81 
     82    /**
     83     * @param {es3fShaderTextureFunctionTests.TexFunction} function_
     84     * @return {boolean}
     85     */
     86    es3fShaderTextureFunctionTests.functionHasProj = function(function_) {
     87        return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ ||
     88           function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3 ||
     89           function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD ||
     90           function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD ||
     91           function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3 ||
     92           function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3;
     93    };
     94 
     95    /**
     96     * @param {es3fShaderTextureFunctionTests.TexFunction} function_
     97     * @return {boolean}
     98     */
     99    es3fShaderTextureFunctionTests.functionHasGrad = function(function_) {
    100        return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD ||
    101            function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD ||
    102             function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3;
    103    };
    104 
    105    /**
    106     * @param {es3fShaderTextureFunctionTests.TexFunction} function_
    107     * @return {boolean}
    108     */
    109    es3fShaderTextureFunctionTests.functionHasLod = function(function_) {
    110        return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD ||
    111               function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD ||
    112               function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3 ||
    113               function_ === es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH;
    114    };
    115 
    116    /**
    117     * @struct
    118     * @constructor
    119     * @param {es3fShaderTextureFunctionTests.TexFunction} func
    120     * @param {Array<number>} minCoord
    121     * @param {Array<number>} maxCoord
    122     * @param {boolean} useBias
    123     * @param {number} minLodBias
    124     * @param {number} maxLodBias
    125     * @param {Array<number>} minDX For *Grad* functions
    126     * @param {Array<number>} maxDX For *Grad* functions
    127     * @param {Array<number>} minDY For *Grad* functions
    128     * @param {Array<number>} maxDY For *Grad* functions
    129     * @param {boolean} useOffset
    130     * @param {Array<number>} offset
    131     */
    132    es3fShaderTextureFunctionTests.TextureLookupSpec = function(func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, minDX, maxDX, minDY, maxDY, useOffset, offset) {
    133        /** @type {es3fShaderTextureFunctionTests.TexFunction} */ this.func = func;
    134        /** @type {Array<number>} */ this.minCoord = minCoord;
    135        /** @type {Array<number>} */ this.maxCoord = maxCoord;
    136        // Bias
    137        /** @type {boolean} */ this.useBias = useBias;
    138        // Bias or Lod for *Lod* functions
    139        /** @type {number} */ this.minLodBias = minLodBias;
    140        /** @type {number} */ this.maxLodBias = maxLodBias;
    141        // For *Grad* functions
    142        /** @type {Array<number>} */ this.minDX = minDX;
    143        /** @type {Array<number>} */ this.maxDX = maxDX;
    144        /** @type {Array<number>} */ this.minDY = minDY;
    145        /** @type {Array<number>} */ this.maxDY = maxDY;
    146        /** @type {boolean} */ this.useOffset = useOffset;
    147        /** @type {Array<number>} */ this.offset = offset;
    148    };
    149 
    150    /**
    151     * @enum
    152     */
    153    es3fShaderTextureFunctionTests.TextureType = {
    154        TEXTURETYPE_2D: 0,
    155        TEXTURETYPE_CUBE_MAP: 1,
    156        TEXTURETYPE_2D_ARRAY: 2,
    157        TEXTURETYPE_3D: 3
    158    };
    159 
    160    /**
    161     * @struct
    162     * @constructor
    163     * @param {?es3fShaderTextureFunctionTests.TextureType} type
    164     * @param {number} format
    165     * @param {number} width
    166     * @param {number} height
    167     * @param {number} depth
    168     * @param {number} numLevels
    169     * @param {?tcuTexture.Sampler} sampler
    170     */
    171    es3fShaderTextureFunctionTests.TextureSpec = function(type, format, width, height, depth, numLevels, sampler) {
    172        /** @type {?es3fShaderTextureFunctionTests.TextureType} */ this.type = type; //!< Texture type (2D, cubemap, ...)
    173        /** @type {number} */ this.format = format; //!< Internal format.
    174        /** @type {number} */ this.width = width;
    175        /** @type {number} */ this.height = height;
    176        /** @type {number} */ this.depth = depth;
    177        /** @type {number} */ this.numLevels = numLevels;
    178        /** @type {?tcuTexture.Sampler} */ this.sampler = sampler;
    179    };
    180 
    181    /**
    182     * @struct
    183     * @constructor
    184     */
    185    es3fShaderTextureFunctionTests.TexLookupParams = function() {
    186        /** @type {number} */ this.lod = 0;
    187        /** @type {Array<number>} */ this.offset = [0, 0, 0];
    188        /** @type {Array<number>} */ this.scale = [1.0, 1.0, 1.0, 1.0];
    189        /** @type {Array<number>} */ this.bias = [0.0, 0.0, 0.0, 0.0];
    190    };
    191 
    192    /**
    193     * @enum
    194     */
    195    es3fShaderTextureFunctionTests.LodMode = {
    196        EXACT: 0,
    197        MIN_BOUND: 1,
    198        MAX_BOUND: 2
    199    };
    200 
    201    /** @const {es3fShaderTextureFunctionTests.LodMode} */ es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE = es3fShaderTextureFunctionTests.LodMode.EXACT;
    202 
    203    /**
    204     * @param {number} dudx
    205     * @param {number} dvdx
    206     * @param {number} dudy
    207     * @param {number} dvdy
    208     * @return {number}
    209     */
    210    es3fShaderTextureFunctionTests.computeLodFromDerivates_UV = function(dudx, dvdx, dudy, dvdy) {
    211        /** @type {es3fShaderTextureFunctionTests.LodMode} */ var mode = es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE;
    212        /** @type {number} */ var p;
    213 
    214        switch (mode) {
    215            case es3fShaderTextureFunctionTests.LodMode.EXACT:
    216                p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx), Math.sqrt(dudy * dudy + dvdy * dvdy));
    217                break;
    218 
    219            case es3fShaderTextureFunctionTests.LodMode.MIN_BOUND:
    220            case es3fShaderTextureFunctionTests.LodMode.MAX_BOUND:
    221                /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy));
    222                /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy));
    223 
    224                p = mode === es3fShaderTextureFunctionTests.LodMode.MIN_BOUND ? Math.max(mu, mv) : mu + mv;
    225                break;
    226 
    227            default:
    228                throw new Error('LOD_MODE not supported.');
    229        }
    230 
    231        return Math.log2(p);
    232    };
    233 
    234    /**
    235     * @param {number} dudx
    236     * @param {number} dvdx
    237     * @param {number} dwdx
    238     * @param {number} dudy
    239     * @param {number} dvdy
    240     * @param {number} dwdy
    241     * @return {number}
    242     */
    243    es3fShaderTextureFunctionTests.computeLodFromDerivates_UVW = function(dudx, dvdx, dwdx, dudy, dvdy, dwdy) {
    244        /** @type {es3fShaderTextureFunctionTests.LodMode} */ var mode = es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE;
    245        /** @type {number} */ var p;
    246 
    247        switch (mode) {
    248            case es3fShaderTextureFunctionTests.LodMode.EXACT:
    249                p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx + dwdx * dwdx), Math.sqrt(dudy * dudy + dvdy * dvdy + dwdy * dwdy));
    250                break;
    251 
    252            case es3fShaderTextureFunctionTests.LodMode.MIN_BOUND:
    253            case es3fShaderTextureFunctionTests.LodMode.MAX_BOUND:
    254                /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy));
    255                /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy));
    256                /** @type {number} */ var mw = Math.max(Math.abs(dwdx), Math.abs(dwdy));
    257 
    258                p = mode === es3fShaderTextureFunctionTests.LodMode.MIN_BOUND ? Math.max(mu, mv, mw) : (mu + mv + mw);
    259                break;
    260 
    261            default:
    262                throw new Error('LOD_MODE not supported.');
    263        }
    264 
    265        return Math.log2(p);
    266    };
    267 
    268    /**
    269     * [dag] Wrapper function for computeLodFromDerivates_UV or computeLodFromDerivates_UVW
    270     * @param {number} dudx
    271     * @param {number} dvdx
    272     * @param {number} dwdxOrdudy
    273     * @param {number} dudyOrdvdy
    274     * @param {number=} dvdy
    275     * @param {number=} dwdy
    276     * @return {number}
    277     */
    278    es3fShaderTextureFunctionTests.computeLodFromDerivates = function(dudx, dvdx, dwdxOrdudy, dudyOrdvdy, dvdy, dwdy) {
    279        if (arguments.length === 4)
    280            return es3fShaderTextureFunctionTests.computeLodFromDerivates_UV(dudx, dvdx, dwdxOrdudy, dudyOrdvdy);
    281        else
    282            return es3fShaderTextureFunctionTests.computeLodFromDerivates_UVW(dudx, dvdx, dwdxOrdudy, dudyOrdvdy, /** @type {number} */ (dvdy), /** @type {number} */ (dwdy));
    283    };
    284 
    285       /**
    286     * @param {glsShaderRenderCase.ShaderEvalContext} c
    287     * @return {number}
    288     */
    289    es3fShaderTextureFunctionTests.computeLodFromGrad2D = function(c) {
    290        /** @type {number} */ var w = c.textures[0].tex2D.getWidth();
    291        /** @type {number} */ var h = c.textures[0].tex2D.getHeight();
    292        return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[2][0] * w, c.in_[2][1] * h);
    293    };
    294 
    295    /**
    296     * @param {glsShaderRenderCase.ShaderEvalContext} c
    297     * @return {number}
    298     */
    299    es3fShaderTextureFunctionTests.computeLodFromGrad2DArray = function(c) {
    300        /** @type {number} */ var w = c.textures[0].tex2DArray.getWidth();
    301        /** @type {number} */ var h = c.textures[0].tex2DArray.getHeight();
    302        return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[2][0] * w, c.in_[2][1] * h);
    303    };
    304 
    305    /**
    306     * @param {glsShaderRenderCase.ShaderEvalContext} c
    307     * @return {number}
    308     */
    309    es3fShaderTextureFunctionTests.computeLodFromGrad3D = function(c) {
    310        /** @type {number} */ var w = c.textures[0].tex3D.getWidth();
    311        /** @type {number} */ var h = c.textures[0].tex3D.getHeight();
    312        /** @type {number} */ var d = c.textures[0].tex3D.getDepth();
    313        return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[1][2] * d, c.in_[2][0] * w, c.in_[2][1] * h, c.in_[2][2] * d);
    314    };
    315 
    316    /**
    317     * @param {glsShaderRenderCase.ShaderEvalContext} c
    318     * @return {number}
    319     */
    320    es3fShaderTextureFunctionTests.computeLodFromGradCube = function(c) {
    321        // \note Major axis is always -Z or +Z
    322        /** @type {number} */ var m = Math.abs(c.in_[0][2]);
    323        /** @type {number} */ var d = c.textures[0].texCube.getSize();
    324        /** @type {number} */ var s = d / (2.0 * m);
    325        /** @type {number} */ var t = d / (2.0 * m);
    326        return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * s, c.in_[1][1] * t, c.in_[2][0] * s, c.in_[2][1] * t);
    327    };
    328 
    329    /** @typedef {function(glsShaderRenderCase.ShaderEvalContext, es3fShaderTextureFunctionTests.TexLookupParams)} */ es3fShaderTextureFunctionTests.TexEvalFunc;
    330 
    331    /**
    332     * @param {glsShaderRenderCase.ShaderEvalContext} c
    333     * @param {number} s
    334     * @param {number} t
    335     * @param {number} lod
    336     * @return {Array<number>}
    337     */
    338    es3fShaderTextureFunctionTests.texture2D = function(c, s, t, lod) {
    339        return c.textures[0].tex2D.getView().sample(c.textures[0].sampler, [s, t], lod);
    340    };
    341 
    342    /**
    343     * @param {glsShaderRenderCase.ShaderEvalContext} c
    344     * @param {number} s
    345     * @param {number} t
    346     * @param {number} r
    347     * @param {number} lod
    348     * @return {Array<number>}
    349     */
    350    es3fShaderTextureFunctionTests.textureCube = function(c, s, t, r, lod) {
    351        return c.textures[0].texCube.getView().sample(c.textures[0].sampler, [s, t, r], lod);
    352    };
    353 
    354    /**
    355     * @param {glsShaderRenderCase.ShaderEvalContext} c
    356     * @param {number} s
    357     * @param {number} t
    358     * @param {number} r
    359     * @param {number} lod
    360     * @return {Array<number>}
    361     */
    362    es3fShaderTextureFunctionTests.texture2DArray = function(c, s, t, r, lod) {
    363        return c.textures[0].tex2DArray.getView().sample(c.textures[0].sampler, [s, t, r], lod);
    364    };
    365 
    366    /**
    367     * @param {glsShaderRenderCase.ShaderEvalContext} c
    368     * @param {number} s
    369     * @param {number} t
    370     * @param {number} r
    371     * @param {number} lod
    372     * @return {Array<number>}
    373     */
    374    es3fShaderTextureFunctionTests.texture3D = function(c, s, t, r, lod) {
    375        return c.textures[0].tex3D.getView().sample(c.textures[0].sampler, [s, t, r], lod);
    376    };
    377 
    378    /**
    379     * @param {glsShaderRenderCase.ShaderEvalContext} c
    380     * @param {number} ref
    381     * @param {number} s
    382     * @param {number} t
    383     * @param {number} lod
    384     * @return {number}
    385     */
    386    es3fShaderTextureFunctionTests.texture2DShadow = function(c, ref, s, t, lod) {
    387        return c.textures[0].tex2D.getView().sampleCompare(c.textures[0].sampler, ref, [s, t], lod);
    388    };
    389 
    390    /**
    391     * @param {glsShaderRenderCase.ShaderEvalContext} c
    392     * @param {number} ref
    393     * @param {number} s
    394     * @param {number} t
    395     * @param {number} r
    396     * @param {number} lod
    397     * @return {number}
    398     */
    399    es3fShaderTextureFunctionTests.textureCubeShadow = function(c, ref, s, t, r, lod) {
    400        return c.textures[0].texCube.getView().sampleCompare(c.textures[0].sampler, ref, [s, t, r], lod);
    401    };
    402 
    403    /**
    404     * @param {glsShaderRenderCase.ShaderEvalContext} c
    405     * @param {number} ref
    406     * @param {number} s
    407     * @param {number} t
    408     * @param {number} r
    409     * @param {number} lod
    410     * @return {number}
    411     */
    412    es3fShaderTextureFunctionTests.texture2DArrayShadow = function(c, ref, s, t, r, lod) {
    413        return c.textures[0].tex2DArray.getView().sampleCompare(c.textures[0].sampler, ref, [s, t, r], lod);
    414    };
    415 
    416    /**
    417     * @param {glsShaderRenderCase.ShaderEvalContext} c
    418     * @param {number} s
    419     * @param {number} t
    420     * @param {number} lod
    421     * @param {Array<number>} offset
    422     * @return {Array<number>}
    423     */
    424    es3fShaderTextureFunctionTests.texture2DOffset = function(c, s, t, lod, offset) {
    425        return c.textures[0].tex2D.getView().sampleOffset(c.textures[0].sampler, [s, t], lod, offset);
    426    };
    427 
    428    /**
    429     * @param {glsShaderRenderCase.ShaderEvalContext} c
    430     * @param {number} s
    431     * @param {number} t
    432     * @param {number} r
    433     * @param {number} lod
    434     * @param {Array<number>} offset
    435     * @return {Array<number>}
    436     */
    437    es3fShaderTextureFunctionTests.texture2DArrayOffset = function(c, s, t, r, lod, offset) {
    438        return c.textures[0].tex2DArray.getView().sampleOffset(c.textures[0].sampler, [s, t, r], lod, offset);
    439    };
    440 
    441    /**
    442     * @param {glsShaderRenderCase.ShaderEvalContext} c
    443     * @param {number} s
    444     * @param {number} t
    445     * @param {number} r
    446     * @param {number} lod
    447     * @param {Array<number>} offset
    448     * @return {Array<number>}
    449     */
    450    es3fShaderTextureFunctionTests.texture3DOffset = function(c, s, t, r, lod, offset) {
    451        return c.textures[0].tex3D.getView().sampleOffset(c.textures[0].sampler, [s, t, r], lod, offset);
    452    };
    453 
    454    /**
    455     * @param {glsShaderRenderCase.ShaderEvalContext} c
    456     * @param {number} ref
    457     * @param {number} s
    458     * @param {number} t
    459     * @param {number} lod
    460     * @param {Array<number>} offset
    461     * @return {number}
    462     */
    463    es3fShaderTextureFunctionTests.texture2DShadowOffset = function(c, ref, s, t, lod, offset) {
    464        return c.textures[0].tex2D.getView().sampleCompareOffset(c.textures[0].sampler, ref, [s, t], lod, offset);
    465    };
    466 
    467    /**
    468     * @param {glsShaderRenderCase.ShaderEvalContext} c
    469     * @param {number} ref
    470     * @param {number} s
    471     * @param {number} t
    472     * @param {number} r
    473     * @param {number} lod
    474     * @param {Array<number>} offset
    475     * @return {number}
    476     */
    477    es3fShaderTextureFunctionTests.texture2DArrayShadowOffset = function(c, ref, s, t, r, lod, offset) {
    478        return c.textures[0].tex2DArray.getView().sampleCompareOffset(c.textures[0].sampler, ref, [s, t, r], lod, offset);
    479    };
    480 
    481    // Eval functions.
    482    /**
    483     * @param {glsShaderRenderCase.ShaderEvalContext} c
    484     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    485     */
    486    es3fShaderTextureFunctionTests.evalTexture2D = function(c, p) {
    487        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], p.lod), p.scale), p.bias);
    488    };
    489 
    490    /**
    491     * @param {glsShaderRenderCase.ShaderEvalContext} c
    492     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    493     */
    494    es3fShaderTextureFunctionTests.evalTextureCube = function(c, p) {
    495        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod), p.scale), p.bias);
    496    };
    497 
    498    /**
    499     * @param {glsShaderRenderCase.ShaderEvalContext} c
    500     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    501     */
    502    es3fShaderTextureFunctionTests.evalTexture2DArray = function(c, p) {
    503        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod), p.scale), p.bias);
    504    };
    505 
    506    /**
    507     * @param {glsShaderRenderCase.ShaderEvalContext} c
    508     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    509     */
    510    es3fShaderTextureFunctionTests.evalTexture3D = function(c, p) {
    511        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod), p.scale), p.bias);
    512    };
    513 
    514 
    515    /**
    516     * @param {glsShaderRenderCase.ShaderEvalContext} c
    517     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    518     */
    519    es3fShaderTextureFunctionTests.evalTexture2DBias = function(c, p) {
    520        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0]), p.scale), p.bias);
    521    };
    522 
    523    /**
    524     * @param {glsShaderRenderCase.ShaderEvalContext} c
    525     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    526     */
    527    es3fShaderTextureFunctionTests.evalTextureCubeBias = function(c, p) {
    528        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias);
    529    };
    530 
    531    /**
    532     * @param {glsShaderRenderCase.ShaderEvalContext} c
    533     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    534     */
    535    es3fShaderTextureFunctionTests.evalTexture2DArrayBias = function(c, p) {
    536        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias);
    537    };
    538 
    539    /**
    540     * @param {glsShaderRenderCase.ShaderEvalContext} c
    541     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    542     */
    543    es3fShaderTextureFunctionTests.evalTexture3DBias = function(c, p) {
    544        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias);
    545    };
    546 
    547 
    548    /**
    549     * @param {glsShaderRenderCase.ShaderEvalContext} c
    550     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    551     */
    552    es3fShaderTextureFunctionTests.evalTexture2DProj3 = function(c, p) {
    553        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod), p.scale), p.bias);
    554    };
    555 
    556    /**
    557     * @param {glsShaderRenderCase.ShaderEvalContext} c
    558     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    559     */
    560    es3fShaderTextureFunctionTests.evalTexture2DProj3Bias = function(c, p) {
    561        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias);
    562    };
    563 
    564    /**
    565     * @param {glsShaderRenderCase.ShaderEvalContext} c
    566     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    567     */
    568    es3fShaderTextureFunctionTests.evalTexture2DProj = function(c, p) {
    569        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod), p.scale), p.bias);
    570    };
    571 
    572    /**
    573     * @param {glsShaderRenderCase.ShaderEvalContext} c
    574     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    575     */
    576    es3fShaderTextureFunctionTests.evalTexture2DProjBias = function(c, p) {
    577        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0]), p.scale), p.bias);
    578    };
    579 
    580    /**
    581     * @param {glsShaderRenderCase.ShaderEvalContext} c
    582     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    583     */
    584    es3fShaderTextureFunctionTests.evalTexture3DProj = function(c, p) {
    585        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod), p.scale), p.bias);
    586    };
    587 
    588    /**
    589     * @param {glsShaderRenderCase.ShaderEvalContext} c
    590     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    591     */
    592    es3fShaderTextureFunctionTests.evalTexture3DProjBias = function(c, p) {
    593        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod+c.in_[1][0]), p.scale), p.bias);
    594    };
    595 
    596 
    597    /**
    598     * @param {glsShaderRenderCase.ShaderEvalContext} c
    599     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    600     */
    601    es3fShaderTextureFunctionTests.evalTexture2DLod = function(c, p) {
    602        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], c.in_[1][0]), p.scale), p.bias);
    603    };
    604 
    605    /**
    606     * @param {glsShaderRenderCase.ShaderEvalContext} c
    607     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    608     */
    609    es3fShaderTextureFunctionTests.evalTextureCubeLod = function(c, p) {
    610        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0]), p.scale), p.bias);
    611    };
    612 
    613    /**
    614     * @param {glsShaderRenderCase.ShaderEvalContext} c
    615     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    616     */
    617    es3fShaderTextureFunctionTests.evalTexture2DArrayLod = function(c, p) {
    618        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0]), p.scale), p.bias);
    619    };
    620 
    621    /**
    622     * @param {glsShaderRenderCase.ShaderEvalContext} c
    623     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    624     */
    625    es3fShaderTextureFunctionTests.evalTexture3DLod = function(c, p) {
    626        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0]), p.scale), p.bias);
    627    };
    628 
    629 
    630    /**
    631     * @param {glsShaderRenderCase.ShaderEvalContext} c
    632     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    633     */
    634    es3fShaderTextureFunctionTests.evalTexture2DProjLod3 = function(c, p) {
    635        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], c.in_[1][0]), p.scale), p.bias);
    636    };
    637 
    638    /**
    639     * @param {glsShaderRenderCase.ShaderEvalContext} c
    640     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    641     */
    642    es3fShaderTextureFunctionTests.evalTexture2DProjLod = function(c, p) {
    643        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0]), p.scale), p.bias);
    644    };
    645 
    646    /**
    647     * @param {glsShaderRenderCase.ShaderEvalContext} c
    648     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    649     */
    650    es3fShaderTextureFunctionTests.evalTexture3DProjLod = function(c, p) {
    651        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], c.in_[1][0]), p.scale), p.bias);
    652    };
    653 
    654    // Offset variants
    655 
    656    /**
    657     * @param {glsShaderRenderCase.ShaderEvalContext} c
    658     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    659     */
    660    es3fShaderTextureFunctionTests.evalTexture2DOffset = function(c, p) {
    661        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    662    };
    663 
    664    /**
    665     * @param {glsShaderRenderCase.ShaderEvalContext} c
    666     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    667     */
    668    es3fShaderTextureFunctionTests.evalTexture2DArrayOffset = function(c, p) {
    669        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    670    };
    671 
    672    /**
    673     * @param {glsShaderRenderCase.ShaderEvalContext} c
    674     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    675     */
    676    es3fShaderTextureFunctionTests.evalTexture3DOffset = function(c, p) {
    677        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod, p.offset), p.scale), p.bias);
    678    };
    679 
    680 
    681    /**
    682     * @param {glsShaderRenderCase.ShaderEvalContext} c
    683     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    684     */
    685    es3fShaderTextureFunctionTests.evalTexture2DOffsetBias = function(c, p) {
    686        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    687    };
    688 
    689    /**
    690     * @param {glsShaderRenderCase.ShaderEvalContext} c
    691     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    692     */
    693    es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias = function(c, p) {
    694        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    695    };
    696 
    697    /**
    698     * @param {glsShaderRenderCase.ShaderEvalContext} c
    699     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    700     */
    701    es3fShaderTextureFunctionTests.evalTexture3DOffsetBias = function(c, p) {
    702        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0], p.offset), p.scale), p.bias);
    703    };
    704 
    705 
    706    /**
    707     * @param {glsShaderRenderCase.ShaderEvalContext} c
    708     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    709     */
    710    es3fShaderTextureFunctionTests.evalTexture2DLodOffset = function(c, p) {
    711        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    712    };
    713 
    714    /**
    715     * @param {glsShaderRenderCase.ShaderEvalContext} c
    716     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    717     */
    718    es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset = function(c, p) {
    719        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    720    };
    721 
    722    /**
    723     * @param {glsShaderRenderCase.ShaderEvalContext} c
    724     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    725     */
    726    es3fShaderTextureFunctionTests.evalTexture3DLodOffset = function(c, p) {
    727        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0], p.offset), p.scale), p.bias);
    728    };
    729 
    730 
    731    /**
    732     * @param {glsShaderRenderCase.ShaderEvalContext} c
    733     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    734     */
    735    es3fShaderTextureFunctionTests.evalTexture2DProj3Offset = function(c, p) {
    736        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    737    };
    738 
    739    /**
    740     * @param {glsShaderRenderCase.ShaderEvalContext} c
    741     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    742     */
    743    es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias = function(c, p) {
    744        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    745    };
    746 
    747    /**
    748     * @param {glsShaderRenderCase.ShaderEvalContext} c
    749     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    750     */
    751    es3fShaderTextureFunctionTests.evalTexture2DProjOffset = function(c, p) {
    752        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    753    };
    754 
    755    /**
    756     * @param {glsShaderRenderCase.ShaderEvalContext} c
    757     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    758     */
    759    es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias = function(c, p) {
    760        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    761    };
    762 
    763    /**
    764     * @param {glsShaderRenderCase.ShaderEvalContext} c
    765     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    766     */
    767    es3fShaderTextureFunctionTests.evalTexture3DProjOffset = function(c, p) {
    768        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod, p.offset), p.scale), p.bias);
    769    };
    770 
    771    /**
    772     * @param {glsShaderRenderCase.ShaderEvalContext} c
    773     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    774     */
    775    es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias = function(c, p) {
    776        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod+c.in_[1][0], p.offset), p.scale), p.bias);
    777    };
    778 
    779 
    780    /**
    781     * @param {glsShaderRenderCase.ShaderEvalContext} c
    782     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    783     */
    784    es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset = function(c, p) {
    785        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    786    };
    787 
    788    /**
    789     * @param {glsShaderRenderCase.ShaderEvalContext} c
    790     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    791     */
    792    es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset = function(c, p) {
    793        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    794    };
    795 
    796    /**
    797     * @param {glsShaderRenderCase.ShaderEvalContext} c
    798     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    799     */
    800    es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset = function(c, p) {
    801        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], c.in_[1][0], p.offset), p.scale), p.bias);
    802    };
    803 
    804    // Shadow variants
    805 
    806    /**
    807     * @param {glsShaderRenderCase.ShaderEvalContext} c
    808     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    809     */
    810    es3fShaderTextureFunctionTests.evalTexture2DShadow = function(c, p) {
    811        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod);
    812    };
    813    /**
    814     * @param {glsShaderRenderCase.ShaderEvalContext} c
    815     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    816     */
    817    es3fShaderTextureFunctionTests.evalTexture2DShadowBias = function(c, p) {
    818        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0]);
    819    };
    820 
    821    /**
    822     * @param {glsShaderRenderCase.ShaderEvalContext} c
    823     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    824     */
    825    es3fShaderTextureFunctionTests.evalTextureCubeShadow = function(c, p) {
    826        c.color[0] = es3fShaderTextureFunctionTests.textureCubeShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod);
    827    };
    828    /**
    829     * @param {glsShaderRenderCase.ShaderEvalContext} c
    830     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    831     */
    832    es3fShaderTextureFunctionTests.evalTextureCubeShadowBias = function(c, p) {
    833        c.color[0] = es3fShaderTextureFunctionTests.textureCubeShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]);
    834    };
    835 
    836    /**
    837     * @param {glsShaderRenderCase.ShaderEvalContext} c
    838     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    839     */
    840    es3fShaderTextureFunctionTests.evalTexture2DArrayShadow = function(c, p) {
    841        c.color[0] = es3fShaderTextureFunctionTests.texture2DArrayShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod);
    842    };
    843 
    844    /**
    845     * @param {glsShaderRenderCase.ShaderEvalContext} c
    846     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    847     */
    848    es3fShaderTextureFunctionTests.evalTexture2DShadowLod = function(c, p) {
    849        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], c.in_[1][0]);
    850    };
    851    /**
    852     * @param {glsShaderRenderCase.ShaderEvalContext} c
    853     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    854     */
    855    es3fShaderTextureFunctionTests.evalTexture2DShadowLodOffset = function(c, p) {
    856        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], c.in_[1][0], deMath.swizzle(p.offset, [0,1]));
    857    };
    858 
    859    /**
    860     * @param {glsShaderRenderCase.ShaderEvalContext} c
    861     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    862     */
    863    es3fShaderTextureFunctionTests.evalTexture2DShadowProj = function(c, p) {
    864        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod);
    865    };
    866    /**
    867     * @param {glsShaderRenderCase.ShaderEvalContext} c
    868     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    869     */
    870    es3fShaderTextureFunctionTests.evalTexture2DShadowProjBias = function(c, p) {
    871        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0]);
    872    };
    873 
    874    /**
    875     * @param {glsShaderRenderCase.ShaderEvalContext} c
    876     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    877     */
    878    es3fShaderTextureFunctionTests.evalTexture2DShadowProjLod = function(c, p) {
    879        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0]);
    880    };
    881    /**
    882     * @param {glsShaderRenderCase.ShaderEvalContext} c
    883     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    884     */
    885    es3fShaderTextureFunctionTests.evalTexture2DShadowProjLodOffset = function(c, p) {
    886        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0], deMath.swizzle(p.offset, [0,1]));
    887    };
    888 
    889    /**
    890     * @param {glsShaderRenderCase.ShaderEvalContext} c
    891     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    892     */
    893    es3fShaderTextureFunctionTests.evalTexture2DShadowOffset = function(c, p) {
    894        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod, deMath.swizzle(p.offset, [0,1]));
    895    };
    896    /**
    897     * @param {glsShaderRenderCase.ShaderEvalContext} c
    898     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    899     */
    900    es3fShaderTextureFunctionTests.evalTexture2DShadowOffsetBias = function(c, p) {
    901        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1]));
    902    };
    903 
    904    /**
    905     * @param {glsShaderRenderCase.ShaderEvalContext} c
    906     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    907     */
    908    es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffset = function(c, p) {
    909        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod, deMath.swizzle(p.offset, [0,1]));
    910    };
    911    /**
    912     * @param {glsShaderRenderCase.ShaderEvalContext} c
    913     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    914     */
    915    es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffsetBias = function(c, p) {
    916        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1]));
    917    };
    918 
    919    // Gradient variarts
    920 
    921    /**
    922     * @param {glsShaderRenderCase.ShaderEvalContext} c
    923     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    924     */
    925    es3fShaderTextureFunctionTests.evalTexture2DGrad = function(c, p) {
    926        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)), p.scale), p.bias);
    927    };
    928 
    929    /**
    930     * @param {glsShaderRenderCase.ShaderEvalContext} c
    931     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    932     */
    933    es3fShaderTextureFunctionTests.evalTextureCubeGrad = function(c, p) {
    934        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGradCube(c)), p.scale), p.bias);
    935    };
    936 
    937    /**
    938     * @param {glsShaderRenderCase.ShaderEvalContext} c
    939     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    940     */
    941    es3fShaderTextureFunctionTests.evalTexture2DArrayGrad = function(c, p) {
    942        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c)), p.scale), p.bias);
    943    };
    944 
    945    /**
    946     * @param {glsShaderRenderCase.ShaderEvalContext} c
    947     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    948     */
    949    es3fShaderTextureFunctionTests.evalTexture3DGrad = function(c, p) {
    950        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c)), p.scale), p.bias);
    951    };
    952 
    953 
    954    /**
    955     * @param {glsShaderRenderCase.ShaderEvalContext} c
    956     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    957     */
    958    es3fShaderTextureFunctionTests.evalTexture2DShadowGrad = function(c, p) {
    959        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c));
    960    };
    961 
    962    /**
    963     * @param {glsShaderRenderCase.ShaderEvalContext} c
    964     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    965     */
    966    es3fShaderTextureFunctionTests.evalTextureCubeShadowGrad = function(c, p) {
    967        c.color[0] = es3fShaderTextureFunctionTests.textureCubeShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGradCube(c));
    968    };
    969 
    970    /**
    971     * @param {glsShaderRenderCase.ShaderEvalContext} c
    972     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    973     */
    974    es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGrad = function(c, p) {
    975        c.color[0] = es3fShaderTextureFunctionTests.texture2DArrayShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c));
    976    };
    977 
    978 
    979    /**
    980     * @param {glsShaderRenderCase.ShaderEvalContext} c
    981     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    982     */
    983    es3fShaderTextureFunctionTests.evalTexture2DGradOffset = function(c, p) {
    984        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    985    };
    986 
    987    /**
    988     * @param {glsShaderRenderCase.ShaderEvalContext} c
    989     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    990     */
    991    es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset = function(c, p) {
    992        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
    993    };
    994 
    995    /**
    996     * @param {glsShaderRenderCase.ShaderEvalContext} c
    997     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
    998     */
    999    es3fShaderTextureFunctionTests.evalTexture3DGradOffset = function(c, p) {
   1000        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c), p.offset), p.scale), p.bias);
   1001    };
   1002 
   1003 
   1004    /**
   1005     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1006     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1007     */
   1008    es3fShaderTextureFunctionTests.evalTexture2DShadowGradOffset = function(c, p) {
   1009        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1]));
   1010    };
   1011 
   1012    /**
   1013     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1014     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1015     */
   1016    es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGradOffset = function(c, p) {
   1017        c.color[0] = es3fShaderTextureFunctionTests.texture2DArrayShadowOffset(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c), deMath.swizzle(p.offset, [0,1]));
   1018    };
   1019 
   1020 
   1021    /**
   1022     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1023     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1024     */
   1025    es3fShaderTextureFunctionTests.evalTexture2DShadowProjGrad = function(c, p) {
   1026        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c));
   1027    };
   1028 
   1029    /**
   1030     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1031     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1032     */
   1033    es3fShaderTextureFunctionTests.evalTexture2DShadowProjGradOffset = function(c, p) {
   1034        c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1]));
   1035    };
   1036 
   1037 
   1038    /**
   1039     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1040     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1041     */
   1042    es3fShaderTextureFunctionTests.evalTexture2DProjGrad3 = function(c, p) {
   1043        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)), p.scale), p.bias);
   1044    };
   1045 
   1046    /**
   1047     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1048     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1049     */
   1050    es3fShaderTextureFunctionTests.evalTexture2DProjGrad = function(c, p) {
   1051        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)), p.scale), p.bias);
   1052    };
   1053 
   1054    /**
   1055     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1056     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1057     */
   1058    es3fShaderTextureFunctionTests.evalTexture3DProjGrad = function(c, p) {
   1059        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c)), p.scale), p.bias);
   1060    };
   1061 
   1062 
   1063    /**
   1064     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1065     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1066     */
   1067    es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset = function(c, p) {
   1068        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
   1069    };
   1070 
   1071    /**
   1072     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1073     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1074     */
   1075    es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset = function(c, p) {
   1076        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias);
   1077    };
   1078 
   1079    /**
   1080     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1081     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1082     */
   1083    es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset = function(c, p) {
   1084        c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c), p.offset), p.scale), p.bias);
   1085    };
   1086 
   1087    // Texel fetch variants
   1088    /**
   1089     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1090     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1091     */
   1092    es3fShaderTextureFunctionTests.evalTexelFetch2D = function(c, p) {
   1093        /** @type {number} */ var x    = Math.trunc(c.in_[0][0]) + p.offset[0];
   1094        /** @type {number} */ var y    = Math.trunc(c.in_[0][1]) + p.offset[1];
   1095        /** @type {number} */ var lod = Math.trunc(c.in_[1][0]);
   1096        c.color = deMath.add(deMath.multiply(c.textures[0].tex2D.getLevel(lod).getPixel(x, y), p.scale), p.bias);
   1097    };
   1098 
   1099    /**
   1100     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1101     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1102     */
   1103    es3fShaderTextureFunctionTests.evalTexelFetch2DArray = function(c, p) {
   1104        /** @type {number} */ var x    = Math.trunc(c.in_[0][0]) + p.offset[0];
   1105        /** @type {number} */ var y    = Math.trunc(c.in_[0][1]) + p.offset[1];
   1106        /** @type {number} */ var l    = Math.trunc(c.in_[0][2]);
   1107        /** @type {number} */ var lod = Math.trunc(c.in_[1][0]);
   1108        c.color = deMath.add(deMath.multiply(c.textures[0].tex2DArray.getLevel(lod).getPixel(x, y, l), p.scale), p.bias);
   1109    };
   1110 
   1111    /**
   1112     * @param {glsShaderRenderCase.ShaderEvalContext} c
   1113     * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
   1114     */
   1115    es3fShaderTextureFunctionTests.evalTexelFetch3D = function(c, p) {
   1116        /** @type {number} */ var x    = Math.trunc(c.in_[0][0]) + p.offset[0];
   1117        /** @type {number} */ var y    = Math.trunc(c.in_[0][1]) + p.offset[1];
   1118        /** @type {number} */ var z    = Math.trunc(c.in_[0][2]) + p.offset[2];
   1119        /** @type {number} */ var lod = Math.trunc(c.in_[1][0]);
   1120        c.color = deMath.add(deMath.multiply(c.textures[0].tex3D.getLevel(lod).getPixel(x, y, z), p.scale), p.bias);
   1121    };
   1122 
   1123    /**
   1124     * @constructor
   1125     * @extends {glsShaderRenderCase.ShaderEvaluator}
   1126     * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
   1127     * @param {es3fShaderTextureFunctionTests.TexLookupParams} lookupParams
   1128     */
   1129    es3fShaderTextureFunctionTests.TexLookupEvaluator = function(evalFunc, lookupParams) {
   1130        /** @type {es3fShaderTextureFunctionTests.TexEvalFunc} */ this.m_evalFunc = evalFunc;
   1131        /** @type {es3fShaderTextureFunctionTests.TexLookupParams} */ this.m_lookupParams = lookupParams;
   1132    };
   1133 
   1134    es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype = Object.create(glsShaderRenderCase.ShaderEvaluator.prototype);
   1135    es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype.constructor = es3fShaderTextureFunctionTests.TexLookupEvaluator;
   1136 
   1137    /**
   1138     * @param  {glsShaderRenderCase.ShaderEvalContext} ctx
   1139     */
   1140    es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype.evaluate = function(ctx) {
   1141        this.m_evalFunc(ctx, this.m_lookupParams);
   1142    };
   1143 
   1144    /**
   1145     * @constructor
   1146     * @extends {glsShaderRenderCase.ShaderRenderCase}
   1147     * @param {string} name
   1148     * @param {string} desc
   1149     * @param {es3fShaderTextureFunctionTests.TextureLookupSpec} lookup
   1150     * @param {es3fShaderTextureFunctionTests.TextureSpec} texture
   1151     * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
   1152     * @param {boolean} isVertexCase
   1153     */
   1154    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase = function(name, desc, lookup, texture, evalFunc, isVertexCase) {
   1155        glsShaderRenderCase.ShaderRenderCase.call(this, name, desc, isVertexCase);
   1156 
   1157        /** @type {es3fShaderTextureFunctionTests.TextureLookupSpec} */ this.m_lookupSpec = lookup;
   1158        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.m_textureSpec = texture;
   1159        /** @type {es3fShaderTextureFunctionTests.TexLookupParams} */ this.m_lookupParams = new es3fShaderTextureFunctionTests.TexLookupParams();
   1160        /** @type {es3fShaderTextureFunctionTests.TexLookupEvaluator} */ this.m_evaluator = new es3fShaderTextureFunctionTests.TexLookupEvaluator(evalFunc, this.m_lookupParams);
   1161 
   1162        /** @type {gluTexture.Texture2D} */ this.m_texture2D = null;
   1163        /** @type {gluTexture.TextureCube} */ this.m_textureCube = null;
   1164        /** @type {gluTexture.Texture2DArray} */ this.m_texture2DArray = null;
   1165        /** @type {gluTexture.Texture3D} */ this.m_texture3D = null;
   1166    };
   1167 
   1168    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
   1169    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.constructor = es3fShaderTextureFunctionTests.ShaderTextureFunctionCase;
   1170 
   1171    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.init = function() {
   1172 
   1173        // Base coord scale & bias
   1174        /** @type {(Array<number>|number)} */ var s = deMath.subtract(this.m_lookupSpec.maxCoord, this.m_lookupSpec.minCoord);
   1175        /** @type {(Array<number>|number)} */ var b = this.m_lookupSpec.minCoord;
   1176 
   1177        /** @type {Array<number>} */ var baseCoordTrans = [
   1178            s[0], 0.0, 0.0, b[0],
   1179            0.0, s[1], 0., b[1],
   1180            s[2]/2.0, -s[2]/2.0, 0.0, s[2]/2.0 + b[2],
   1181            -s[3]/2.0, s[3]/2.0, 0.0, s[3]/2.0 + b[3]
   1182        ];
   1183        this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, baseCoordTrans));
   1184 
   1185        /** @type {boolean} */ var hasLodBias = es3fShaderTextureFunctionTests.functionHasLod(this.m_lookupSpec.func) || this.m_lookupSpec.useBias;
   1186        /** @type {boolean} */ var isGrad = es3fShaderTextureFunctionTests.functionHasGrad(this.m_lookupSpec.func);
   1187        assertMsgOptions(!isGrad || !hasLodBias, 'Assert Error. expected: isGrad || hasLodBias === false', false, true);
   1188 
   1189        if (hasLodBias) {
   1190            s = this.m_lookupSpec.maxLodBias - this.m_lookupSpec.minLodBias;
   1191            b = this.m_lookupSpec.minLodBias;
   1192            /** @type {Array<number>} */ var lodCoordTrans = [
   1193                s/2.0, s/2.0, 0.0, b,
   1194                0.0, 0.0, 0.0, 0.0,
   1195                0.0, 0.0, 0.0, 0.0,
   1196                0.0, 0.0, 0.0, 0.0
   1197            ];
   1198 
   1199            this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, lodCoordTrans));
   1200        }
   1201        else if (isGrad) {
   1202            /** @type {Array<number>} */ var sx = deMath.subtract(this.m_lookupSpec.maxDX, this.m_lookupSpec.minDX);
   1203            /** @type {Array<number>} */ var sy = deMath.subtract(this.m_lookupSpec.maxDY, this.m_lookupSpec.minDY);
   1204            /** @type {Array<number>} */ var gradDxTrans = [
   1205                sx[0]/2.0, sx[0]/2.0, 0.0, this.m_lookupSpec.minDX[0],
   1206                sx[1]/2.0, sx[1]/2.0, 0.0, this.m_lookupSpec.minDX[1],
   1207                sx[2]/2.0, sx[2]/2.0, 0.0, this.m_lookupSpec.minDX[2],
   1208                0.0, 0.0, 0.0, 0.0
   1209            ];
   1210            /** @type {Array<number>} */ var gradDyTrans = [
   1211                -sy[0]/2.0, -sy[0]/2.0, 0.0, this.m_lookupSpec.maxDY[0],
   1212                -sy[1]/2.0, -sy[1]/2.0, 0.0, this.m_lookupSpec.maxDY[1],
   1213                -sy[2]/2.0, -sy[2]/2.0, 0.0, this.m_lookupSpec.maxDY[2],
   1214                0.0, 0.0, 0.0, 0.0
   1215             ];
   1216 
   1217            this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, gradDxTrans));
   1218            this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, gradDyTrans));
   1219        }
   1220 
   1221        this.initShaderSources();
   1222        this.initTexture();
   1223 
   1224        this.postinit();
   1225 
   1226    };
   1227 
   1228    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.initTexture = function() {
   1229        /** @type {Array<Array<number>>} */ var texCubeSwz = [
   1230            [0, 0, 1, 1],
   1231            [1, 1, 0, 0],
   1232            [0, 1, 0, 1],
   1233            [1, 0, 1, 0],
   1234            [0, 1, 1, 0],
   1235            [1, 0, 0, 1]
   1236        ];
   1237 
   1238        assertMsgOptions(texCubeSwz.length === 6, 'Cube should have 6 faces.', false, true);
   1239 
   1240        /** @type {number} */ var levelStep;
   1241        /** @type {Array<number>} */ var cScale;
   1242        /** @type {Array<number>} */ var cBias;
   1243        /** @type {number} */ var baseCellSize;
   1244 
   1245        /** @type {number} */ var fA;
   1246        /** @type {number} */ var fB;
   1247        /** @type {Array<number>} */ var colorA;
   1248        /** @type {Array<number>} */ var colorB;
   1249 
   1250        /** @type {number} */ var dudx;
   1251        /** @type {number} */ var dvdy;
   1252 
   1253        /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_textureSpec.format);
   1254        /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
   1255        /** @type {Array<number>} */ var viewportSize = this.getViewportSize();
   1256        /** @type {boolean} */ var isProj = es3fShaderTextureFunctionTests.functionHasProj(this.m_lookupSpec.func);
   1257        /** @type {boolean} */ var isAutoLod = es3fShaderTextureFunctionTests.functionHasAutoLod(
   1258            this.m_isVertexCase ? gluShaderProgram.shaderType.VERTEX : gluShaderProgram.shaderType.FRAGMENT,
   1259            this.m_lookupSpec.func); // LOD can vary significantly
   1260        /** @type {number} */ var proj = isProj ?
   1261            1.0 / this.m_lookupSpec.minCoord[this.m_lookupSpec.func === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3 ? 2 : 3] :
   1262            1.0;
   1263 
   1264        switch (this.m_textureSpec.type) {
   1265            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
   1266                levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1);
   1267                cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
   1268                cBias = fmtInfo.valueMin;
   1269                baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4);
   1270 
   1271                this.m_texture2D = gluTexture.texture2DFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width, this.m_textureSpec.height);
   1272                for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
   1273                    fA = level * levelStep;
   1274                    fB = 1.0 - fA;
   1275                    colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB]));
   1276                    colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA]));
   1277 
   1278                    this.m_texture2D.getRefTexture().allocLevel(level);
   1279                    tcuTextureUtil.fillWithGrid(this.m_texture2D.getRefTexture().getLevel(level), Math.max(1, baseCellSize >> level), colorA, colorB);
   1280                }
   1281                this.m_texture2D.upload();
   1282 
   1283                // Compute LOD.
   1284                dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0];
   1285                dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1];
   1286                this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy);
   1287 
   1288                // Append to texture list.
   1289                this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture2D, this.m_textureSpec.sampler));
   1290                break;
   1291 
   1292            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
   1293                levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1);
   1294                cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
   1295                cBias = fmtInfo.valueMin;
   1296                /** @type {Array<number>} */ var cCorner = deMath.add(cBias, deMath.scale(cScale, 0.5));
   1297                baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4);
   1298 
   1299                assertMsgOptions(this.m_textureSpec.width === this.m_textureSpec.height, 'Expected width === height', false, true);
   1300                this.m_textureCube = gluTexture.cubeFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width);
   1301                for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
   1302                    fA = level * levelStep;
   1303                    fB = 1.0 - fA;
   1304                    /** @type {Array<number>} */ var f = [fA, fB];
   1305 
   1306                    for (var face = 0; face < 6; face++) {
   1307                        /** @type {Array<number>} */ var swzA = texCubeSwz[face];
   1308                        /** @type {Array<number>} */ var swzB = deMath.subtract([1, 1, 1, 1], swzA);
   1309                        colorA = deMath.add(cBias, deMath.multiply(cScale, deMath.swizzle(f, [swzA[0], swzA[1], swzA[2], swzA[3]])));
   1310                        colorB = deMath.add(cBias, deMath.multiply(cScale, deMath.swizzle(f, [swzB[0], swzB[1], swzB[2], swzB[3]])));
   1311 
   1312                        this.m_textureCube.getRefTexture().allocLevel(face, level);
   1313 
   1314                        /** @type {tcuTexture.PixelBufferAccess} */ var access = this.m_textureCube.getRefTexture().getLevelFace(level, face);
   1315                        /** @type {number} */ var lastPix = access.getWidth() - 1;
   1316 
   1317                        tcuTextureUtil.fillWithGrid(access, Math.max(1, baseCellSize >> level), colorA, colorB);
   1318 
   1319                        // Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering
   1320                        access.setPixel(cCorner, 0, 0);
   1321                        access.setPixel(cCorner, 0, lastPix);
   1322                        access.setPixel(cCorner, lastPix, 0);
   1323                        access.setPixel(cCorner, lastPix, lastPix);
   1324                    }
   1325                }
   1326                this.m_textureCube.upload();
   1327 
   1328                // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
   1329                assertMsgOptions(Math.abs(this.m_lookupSpec.minCoord[2] - this.m_lookupSpec.maxCoord[2]) < 0.005, 'Expected abs(minCoord-maxCoord) < 0.005', false, true);
   1330                assertMsgOptions(Math.abs(this.m_lookupSpec.minCoord[0]) < Math.abs(this.m_lookupSpec.minCoord[2]) && Math.abs(this.m_lookupSpec.maxCoord[0]) < Math.abs(this.m_lookupSpec.minCoord[2]), 'Assert error: minCoord, maxCoord', false, true);
   1331                assertMsgOptions(Math.abs(this.m_lookupSpec.minCoord[1]) < Math.abs(this.m_lookupSpec.minCoord[2]) && Math.abs(this.m_lookupSpec.maxCoord[1]) < Math.abs(this.m_lookupSpec.minCoord[2]), 'Assert error: minCoord, maxCoord', false, true);
   1332 
   1333                /** @type {tcuTexture.CubeFaceCoords} */ var c00 = tcuTexture.getCubeFaceCoords([this.m_lookupSpec.minCoord[0] * proj, this.m_lookupSpec.minCoord[1] * proj, this.m_lookupSpec.minCoord[2] * proj]);
   1334                /** @type {tcuTexture.CubeFaceCoords} */ var c10 = tcuTexture.getCubeFaceCoords([this.m_lookupSpec.maxCoord[0] * proj, this.m_lookupSpec.minCoord[1] * proj, this.m_lookupSpec.minCoord[2] * proj]);
   1335                /** @type {tcuTexture.CubeFaceCoords} */ var c01 = tcuTexture.getCubeFaceCoords([this.m_lookupSpec.minCoord[0] * proj, this.m_lookupSpec.maxCoord[1] * proj, this.m_lookupSpec.minCoord[2] * proj]);
   1336                dudx = (c10.s - c00.s) * this.m_textureSpec.width / viewportSize[0];
   1337                dvdy = (c01.t - c00.t) * this.m_textureSpec.height / viewportSize[1];
   1338 
   1339                this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy);
   1340 
   1341                this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_textureCube, this.m_textureSpec.sampler));
   1342                break;
   1343 
   1344            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
   1345                /** @type {number} */ var layerStep = 1.0 / this.m_textureSpec.depth;
   1346                levelStep = isAutoLod ? 0.0 : 1.0 / (Math.max(1, this.m_textureSpec.numLevels - 1) * this.m_textureSpec.depth);
   1347                cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
   1348                cBias = fmtInfo.valueMin;
   1349                baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4);
   1350 
   1351                this.m_texture2DArray = gluTexture.texture2DArrayFromInternalFormat(gl,
   1352                    this.m_textureSpec.format,
   1353                    this.m_textureSpec.width,
   1354                    this.m_textureSpec.height,
   1355                    this.m_textureSpec.depth);
   1356 
   1357                for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
   1358                    this.m_texture2DArray.getRefTexture().allocLevel(level);
   1359                    /** @type {tcuTexture.PixelBufferAccess} */ var levelAccess = this.m_texture2DArray.getRefTexture().getLevel(level);
   1360 
   1361                    for (var layer = 0; layer < levelAccess.getDepth(); layer++) {
   1362                        fA = layer * layerStep + level * levelStep;
   1363                        fB = 1.0 - fA;
   1364                        colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB]));
   1365                        colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA]));
   1366 
   1367                        tcuTextureUtil.fillWithGrid(tcuTextureUtil.getSubregion(levelAccess, 0, 0, layer, levelAccess.getWidth(), levelAccess.getHeight(), 1), Math.max(1, baseCellSize >> level), colorA, colorB);
   1368                    }
   1369                }
   1370                this.m_texture2DArray.upload();
   1371 
   1372                // Compute LOD.
   1373                dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0];
   1374                dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1];
   1375                this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy);
   1376 
   1377                // Append to texture list.
   1378                this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture2DArray, this.m_textureSpec.sampler));
   1379                break;
   1380 
   1381            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
   1382                levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1);
   1383                cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
   1384                cBias = fmtInfo.valueMin;
   1385                baseCellSize = Math.min(this.m_textureSpec.width / 2, this.m_textureSpec.height / 2, this.m_textureSpec.depth / 2);
   1386 
   1387                this.m_texture3D = gluTexture.texture3DFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width, this.m_textureSpec.height, this.m_textureSpec.depth);
   1388                for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
   1389                    fA = level * levelStep;
   1390                    fB = 1.0 - fA;
   1391                    colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB]));
   1392                    colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA]));
   1393 
   1394                    this.m_texture3D.getRefTexture().allocLevel(level);
   1395                    tcuTextureUtil.fillWithGrid(this.m_texture3D.getRefTexture().getLevel(level), Math.max(1, baseCellSize >> level), colorA, colorB);
   1396                }
   1397                this.m_texture3D.upload();
   1398 
   1399                // Compute LOD.
   1400                dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0];
   1401                dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1];
   1402                /** @type {number} */ var dwdx = (this.m_lookupSpec.maxCoord[2] - this.m_lookupSpec.minCoord[2]) * 0.5 * proj * this.m_textureSpec.depth / viewportSize[0];
   1403                /** @type {number} */ var dwdy = (this.m_lookupSpec.maxCoord[2] - this.m_lookupSpec.minCoord[2]) * 0.5 * proj * this.m_textureSpec.depth / viewportSize[1];
   1404                this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, dwdx, 0.0, dvdy, dwdy);
   1405 
   1406                // Append to texture list.
   1407                this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture3D, this.m_textureSpec.sampler));
   1408                break;
   1409 
   1410            default:
   1411                throw new Error('Texture type not supported.');
   1412        }
   1413 
   1414        // Set lookup scale & bias
   1415        this.m_lookupParams.scale = fmtInfo.lookupScale;
   1416        this.m_lookupParams.bias = fmtInfo.lookupBias;
   1417        this.m_lookupParams.offset = this.m_lookupSpec.offset;
   1418    };
   1419 
   1420    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.initShaderSources = function() {
   1421        /** @type {es3fShaderTextureFunctionTests.TexFunction} */ var function_ = this.m_lookupSpec.func;
   1422        /** @type {boolean} */ var isVtxCase = this.m_isVertexCase;
   1423        /** @type {boolean} */ var isProj = es3fShaderTextureFunctionTests.functionHasProj(function_);
   1424        /** @type {boolean} */ var isGrad = es3fShaderTextureFunctionTests.functionHasGrad(function_);
   1425        /** @type {boolean} */ var isShadow = this.m_textureSpec.sampler.compare !== tcuTexture.CompareMode.COMPAREMODE_NONE;
   1426        /** @type {boolean} */ var is2DProj4 = !isShadow && this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D && (function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ || function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD || function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD);
   1427        /** @type {boolean} */ var isIntCoord = function_ === es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH;
   1428        /** @type {boolean} */ var hasLodBias = es3fShaderTextureFunctionTests.functionHasLod(this.m_lookupSpec.func) || this.m_lookupSpec.useBias;
   1429        /** @type {number} */ var texCoordComps = this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D ? 2 : 3;
   1430        /** @type {number} */ var extraCoordComps = (isProj ? (is2DProj4 ? 2 : 1) : 0) + (isShadow ? 1 : 0);
   1431        /** @type {gluShaderUtil.DataType} */ var coordType = gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, texCoordComps+extraCoordComps);
   1432        /** @type {gluShaderUtil.precision} */ var coordPrec = gluShaderUtil.precision.PRECISION_HIGHP;
   1433        /** @type {string} */ var coordTypeName = gluShaderUtil.getDataTypeName(coordType);
   1434        /** @type {string} */ var coordPrecName = gluShaderUtil.getPrecisionName(coordPrec);
   1435        /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_textureSpec.format);
   1436        /** @type {?gluShaderUtil.DataType} */ var samplerType = null;
   1437        /** @type {gluShaderUtil.DataType} */ var gradType = (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP || this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D) ? gluShaderUtil.DataType.FLOAT_VEC3 : gluShaderUtil.DataType.FLOAT_VEC2;
   1438        /** @type {string} */ var gradTypeName = gluShaderUtil.getDataTypeName(gradType);
   1439        /** @type {string} */ var baseFuncName = '';
   1440 
   1441        assertMsgOptions(!isGrad || !hasLodBias, 'Expected !isGrad || !hasLodBias', false, true);
   1442 
   1443        switch (this.m_textureSpec.type) {
   1444            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
   1445                samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_2D_SHADOW : gluTextureUtil.getSampler2DType(texFmt);
   1446                break;
   1447            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
   1448                samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW : gluTextureUtil.getSamplerCubeType(texFmt);
   1449                break;
   1450            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
   1451                samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW : gluTextureUtil.getSampler2DArrayType(texFmt);
   1452                break;
   1453            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
   1454                assertMsgOptions(!isShadow, 'Expected !isShadow', false, true);
   1455                samplerType = gluTextureUtil.getSampler3DType(texFmt);
   1456                break;
   1457            default:
   1458                throw new Error('Unexpected type.');
   1459        }
   1460 
   1461        switch (this.m_lookupSpec.func) {
   1462            case es3fShaderTextureFunctionTests.TexFunction.TEXTURE: baseFuncName = 'texture'; break;
   1463            case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ: baseFuncName = 'textureProj'; break;
   1464            case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3: baseFuncName = 'textureProj'; break;
   1465            case es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD: baseFuncName = 'textureLod'; break;
   1466            case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD: baseFuncName = 'textureProjLod'; break;
   1467            case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3: baseFuncName = 'textureProjLod'; break;
   1468            case es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD: baseFuncName = 'textureGrad'; break;
   1469            case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD: baseFuncName = 'textureProjGrad'; break;
   1470            case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3: baseFuncName = 'textureProjGrad'; break;
   1471            case es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH: baseFuncName = 'texelFetch'; break;
   1472            default:
   1473                throw new Error('Unexpected function.');
   1474        }
   1475 
   1476        /** @type {string} */ var vert = '';
   1477        /** @type {string} */ var frag = '';
   1478        /** @type {string} */ var op = '';
   1479 
   1480        vert += '#version 300 es\n' +
   1481                'in highp vec4 a_position;\n' +
   1482                'in ' + coordPrecName + ' ' + coordTypeName + ' a_in0;\n';
   1483 
   1484        if (isGrad) {
   1485            vert += 'in ' + coordPrecName + ' ' + gradTypeName + ' a_in1;\n';
   1486            vert += 'in ' + coordPrecName + ' ' + gradTypeName + ' a_in2;\n';
   1487        }
   1488        else if (hasLodBias)
   1489            vert += 'in ' + coordPrecName + ' float a_in1;\n';
   1490 
   1491        frag += '#version 300 es\n' +
   1492                'layout(location = 0) out mediump vec4 o_color;\n';
   1493 
   1494        if (isVtxCase) {
   1495            vert += 'out mediump vec4 v_color;\n';
   1496            frag += 'in mediump vec4 v_color;\n';
   1497        }
   1498        else
   1499        {
   1500            vert += 'out ' + coordPrecName + ' ' + coordTypeName + ' v_texCoord;\n';
   1501            frag += 'in ' + coordPrecName + ' ' + coordTypeName + ' v_texCoord;\n';
   1502 
   1503            if (isGrad) {
   1504                vert += 'out ' + coordPrecName + ' ' + gradTypeName + ' v_gradX;\n';
   1505                vert += 'out ' + coordPrecName + ' ' + gradTypeName + ' v_gradY;\n';
   1506                frag += 'in ' + coordPrecName + ' ' + gradTypeName + ' v_gradX;\n';
   1507                frag += 'in ' + coordPrecName + ' ' + gradTypeName + ' v_gradY;\n';
   1508            }
   1509 
   1510            if (hasLodBias) {
   1511                vert += 'out ' + coordPrecName + ' float v_lodBias;\n';
   1512                frag += 'in ' + coordPrecName + ' float v_lodBias;\n';
   1513            }
   1514        }
   1515 
   1516        // Uniforms
   1517        op += 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler;\n' +
   1518              'uniform highp vec4 u_scale;\n' +
   1519              'uniform highp vec4 u_bias;\n';
   1520 
   1521        vert += isVtxCase ? op : '';
   1522        frag += isVtxCase ? '' : op;
   1523        op = '';
   1524 
   1525        vert += '\nvoid main()\n{\n' +
   1526                '\tgl_Position = a_position;\n';
   1527        frag += '\nvoid main()\n{\n';
   1528 
   1529        if (isVtxCase)
   1530            vert += '\tv_color = ';
   1531        else
   1532            frag += '\to_color = ';
   1533 
   1534        // Op.
   1535        /** @type {string} */ var texCoord = isVtxCase ? 'a_in0' : 'v_texCoord';
   1536        /** @type {string} */ var gradX = isVtxCase ? 'a_in1' : 'v_gradX';
   1537        /** @type {string} */ var gradY = isVtxCase ? 'a_in2' : 'v_gradY';
   1538        /** @type {string} */ var lodBias = isVtxCase ? 'a_in1' : 'v_lodBias';
   1539 
   1540        op += 'vec4(' + baseFuncName;
   1541        if (this.m_lookupSpec.useOffset)
   1542            op += 'Offset';
   1543        op += '(u_sampler, ';
   1544 
   1545        if (isIntCoord)
   1546            op += 'ivec' + (texCoordComps+extraCoordComps) + '(';
   1547 
   1548        op += texCoord;
   1549 
   1550        if (isIntCoord)
   1551            op += ')';
   1552 
   1553        if (isGrad)
   1554            op += ', ' + gradX + ', ' + gradY;
   1555 
   1556        if (es3fShaderTextureFunctionTests.functionHasLod(function_)) {
   1557            if (isIntCoord)
   1558                op += ', int(' + lodBias + ')';
   1559            else
   1560                op += ', ' + lodBias;
   1561        }
   1562 
   1563        if (this.m_lookupSpec.useOffset) {
   1564            /** @type {number} */ var offsetComps = this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D ? 3 : 2;
   1565 
   1566            op += ', ivec' + offsetComps + '(';
   1567            for (var ndx = 0; ndx < offsetComps; ndx++) {
   1568                if (ndx !== 0)
   1569                    op += ', ';
   1570                op += this.m_lookupSpec.offset[ndx];
   1571            }
   1572            op += ')';
   1573        }
   1574 
   1575        if (this.m_lookupSpec.useBias)
   1576            op += ', ' + lodBias;
   1577 
   1578        op += ')';
   1579 
   1580        if (isShadow)
   1581            op += ', 0.0, 0.0, 1.0)';
   1582        else
   1583            op += ')*u_scale + u_bias';
   1584 
   1585        op += ';\n';
   1586 
   1587        vert += isVtxCase ? op : '';
   1588        frag += isVtxCase ? '' : op;
   1589        op = '';
   1590 
   1591        if (isVtxCase)
   1592            frag += '\to_color = v_color;\n';
   1593        else {
   1594            vert += '\tv_texCoord = a_in0;\n';
   1595 
   1596            if (isGrad) {
   1597                vert += '\tv_gradX = a_in1;\n';
   1598                vert += '\tv_gradY = a_in2;\n';
   1599            }
   1600            else if (hasLodBias)
   1601                vert += '\tv_lodBias = a_in1;\n';
   1602        }
   1603 
   1604        vert += '}\n';
   1605        frag += '}\n';
   1606 
   1607        this.m_vertShaderSource = vert;
   1608        this.m_fragShaderSource = frag;
   1609    };
   1610 
   1611    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.deinit = function() {
   1612        this.m_program = null;
   1613        this.m_texture2D = null;
   1614        this.m_textureCube = null;
   1615        this.m_texture2DArray = null;
   1616        this.m_texture3D = null;
   1617    };
   1618 
   1619    /**
   1620     * @param  {WebGLProgram} programID
   1621     * @param  {Array<number>} constCoords
   1622     */
   1623    es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.setupUniforms = function(programID, constCoords) {
   1624        gl.uniform1i(gl.getUniformLocation(programID, 'u_sampler'), 0);
   1625        gl.uniform4fv(gl.getUniformLocation(programID, 'u_scale'), this.m_lookupParams.scale);
   1626        gl.uniform4fv(gl.getUniformLocation(programID, 'u_bias'), this.m_lookupParams.bias);
   1627    };
   1628 
   1629 
   1630    /**
   1631     * @struct
   1632     * @constructor
   1633     * @param {Array<number>} textureSize
   1634     * @param {number} lod
   1635     * @param {number} lodBase
   1636     * @param {Array<number>} expectedSize
   1637     */
   1638    es3fShaderTextureFunctionTests.TestSize = function(textureSize, lod, lodBase, expectedSize) {
   1639        /** @type {Array<number>} */ this.textureSize = textureSize;
   1640        /** @type {number} */ this.lod = lod;
   1641        /** @type {number} */ this.lodBase = lodBase;
   1642        /** @type {Array<number>} */ this.expectedSize = expectedSize;
   1643    };
   1644 
   1645    /**
   1646     * @constructor
   1647     * @extends {tcuTestCase.DeqpTest}
   1648     * @param {string} name
   1649     * @param {string} desc
   1650     * @param {string} samplerType
   1651     * @param {es3fShaderTextureFunctionTests.TextureSpec} texture
   1652     * @param {boolean} isVertexCase
   1653     */
   1654    es3fShaderTextureFunctionTests.TextureSizeCase = function(name, desc, samplerType, texture, isVertexCase) {
   1655        tcuTestCase.DeqpTest.call(this, name, desc);
   1656        /** @type {string} */ this.m_samplerTypeStr = samplerType;
   1657        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.m_textureSpec = texture;
   1658        /** @type {boolean} */ this.m_isVertexCase = isVertexCase;
   1659        /** @type {boolean} */ this.m_has3DSize = texture.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D || texture.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY;
   1660        /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null;
   1661        /** @type {number} */ this.m_iterationCounter = 0;
   1662    };
   1663 
   1664    es3fShaderTextureFunctionTests.TextureSizeCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
   1665    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.constructor = es3fShaderTextureFunctionTests.TextureSizeCase;
   1666 
   1667    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.deinit = function() {
   1668        this.freeShader();
   1669    };
   1670 
   1671    /**
   1672     * @return {tcuTestCase.IterateResult}
   1673     */
   1674    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.iterate = function() {
   1675        /** @type {number} */ var currentIteration = this.m_iterationCounter++;
   1676        /** @type {Array<es3fShaderTextureFunctionTests.TestSize>} */ var testSizes = [
   1677            new es3fShaderTextureFunctionTests.TestSize([1, 2, 1], 1, 0, [1, 1, 1]),
   1678            new es3fShaderTextureFunctionTests.TestSize([1, 2, 1], 0, 0, [1, 2, 1]),
   1679 
   1680            new es3fShaderTextureFunctionTests.TestSize([1, 3, 2], 0, 0, [1, 3, 2]),
   1681            new es3fShaderTextureFunctionTests.TestSize([1, 3, 2], 1, 0, [1, 1, 1]),
   1682 
   1683            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 0, 0, [100, 31, 18]),
   1684            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 1, 0, [50, 15, 9]),
   1685            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 2, 0, [25, 7, 4]),
   1686            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 3, 0, [12, 3, 2]),
   1687            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 4, 0, [6, 1, 1]),
   1688            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 5, 0, [3, 1, 1]),
   1689            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 6, 0, [1, 1, 1]),
   1690 
   1691            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 0, 0, [100, 128, 32]),
   1692            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 1, 0, [50, 64, 16]),
   1693            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 2, 0, [25, 32, 8]),
   1694            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 3, 0, [12, 16, 4]),
   1695            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 4, 0, [6, 8, 2]),
   1696            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 5, 0, [3, 4, 1]),
   1697            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 6, 0, [1, 2, 1]),
   1698            new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 7, 0, [1, 1, 1]),
   1699 
   1700            // pow 2
   1701            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 0, 0, [128, 64, 32]),
   1702            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 1, 0, [64, 32, 16]),
   1703            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 2, 0, [32, 16, 8]),
   1704            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 3, 0, [16, 8, 4]),
   1705            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 4, 0, [8, 4, 2]),
   1706            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 5, 0, [4, 2, 1]),
   1707            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 6, 0, [2, 1, 1]),
   1708            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 7, 0, [1, 1, 1]),
   1709 
   1710            // w === h
   1711            new es3fShaderTextureFunctionTests.TestSize([1, 1, 1], 0, 0, [1, 1, 1]),
   1712            new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 0, 0, [64, 64, 64]),
   1713            new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 1, 0, [32, 32, 32]),
   1714            new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 2, 0, [16, 16, 16]),
   1715            new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 3, 0, [8, 8, 8]),
   1716            new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 4, 0, [4, 4, 4]),
   1717 
   1718            // with lod base
   1719            new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 3, 1, [6, 1, 1]),
   1720            new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 3, 1, [8, 4, 2]),
   1721            new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 1, 1, [16, 16, 16])
   1722 
   1723        ];
   1724        /** @type {number} */ var lastIterationIndex = testSizes.length + 1;
   1725 
   1726        if (currentIteration === 0) {
   1727            return this.initShader() ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
   1728        }
   1729        else if (currentIteration === lastIterationIndex) {
   1730            this.freeShader();
   1731            return tcuTestCase.IterateResult.STOP;
   1732        }
   1733        else {
   1734            if (!this.testTextureSize(testSizes[currentIteration - 1]))
   1735                testFailedOptions('Fail: Case ' + (currentIteration - 1) + ' Got unexpected texture size', false);
   1736            else
   1737                testPassedOptions('Pass', true);
   1738 
   1739            return tcuTestCase.IterateResult.CONTINUE;
   1740        }
   1741    };
   1742 
   1743    /**
   1744     * @return {boolean}
   1745     */
   1746    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.initShader = function() {
   1747        /** @type {string} */ var vertSrc = this.genVertexShader();
   1748        /** @type {string} */ var fragSrc = this.genFragmentShader();
   1749 
   1750        assertMsgOptions(this.m_program === null, 'Program should be null', false, true);
   1751        this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertSrc, fragSrc));
   1752 
   1753        if (!this.m_program.isOk()) {
   1754            testFailedOptions('Fail: Shader failed', false);
   1755            return false;
   1756        }
   1757 
   1758        return true;
   1759    };
   1760 
   1761    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.freeShader = function() {
   1762        this.m_program = null;
   1763    };
   1764 
   1765    /**
   1766     * @param {es3fShaderTextureFunctionTests.TestSize} testSize
   1767     * @return {boolean}
   1768     */
   1769    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.testTextureSize = function(testSize) {
   1770        /** @type {Array<number>} */ var triangle = [ // covers entire viewport
   1771            -1, -1, 0, 1, // was a 3x4 matrix
   1772            4, -1, 0, 1,
   1773            -1, 4, 0, 1
   1774        ];
   1775 
   1776        /** @type {number} */ var positionLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
   1777        /** @type {WebGLUniformLocation} */ var samplerLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler');
   1778        /** @type {WebGLUniformLocation} */ var sizeLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_texSize');
   1779        /** @type {WebGLUniformLocation} */ var lodLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_lod');
   1780        /** @type {number} */ var textureTarget = this.getGLTextureTarget();
   1781        /** @type {boolean} */ var isSquare = testSize.textureSize[0] === testSize.textureSize[1];
   1782        /** @type {boolean} */ var is2DLodValid = (testSize.textureSize[0] >> (testSize.lod + testSize.lodBase)) !== 0 || (testSize.textureSize[1] >> (testSize.lod + testSize.lodBase)) !== 0;
   1783        /** @type {boolean} */ var success = true;
   1784        /** @type {number} */ var errorValue;
   1785 
   1786        // Skip incompatible cases
   1787        if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP && !isSquare)
   1788            return true;
   1789        if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D && !is2DLodValid)
   1790            return true;
   1791        if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY && !is2DLodValid)
   1792            return true;
   1793 
   1794        // setup rendering
   1795        gl.useProgram(this.m_program.getProgram());
   1796        gl.uniform1i(samplerLoc, 0);
   1797        gl.clearColor(0.5, 0.5, 0.5, 1.0);
   1798        gl.viewport(0, 0, 1, 1);
   1799 
   1800        /** @type {WebGLBuffer} */ var triangleGlBuffer = gl.createBuffer();
   1801        gl.bindBuffer(gl.ARRAY_BUFFER, triangleGlBuffer);
   1802        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangle), gl.STATIC_DRAW);
   1803 
   1804        gl.vertexAttribPointer(positionLoc, 4, gl.FLOAT, false, 0, 0);
   1805        gl.enableVertexAttribArray(positionLoc);
   1806 
   1807        // setup texture
   1808        /** @type {number} */ var maxLevel = testSize.lod + testSize.lodBase;
   1809        /** @type {number} */ var levels = maxLevel + 1;
   1810        /** @type {?WebGLTexture} */ var texId = null;
   1811 
   1812        // gen texture
   1813        texId = gl.createTexture();
   1814        gl.bindTexture(textureTarget, texId);
   1815        gl.texParameteri(textureTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
   1816        gl.texParameteri(textureTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
   1817        gl.texParameteri(textureTarget, gl.TEXTURE_BASE_LEVEL, testSize.lodBase);
   1818        gl.texParameteri(textureTarget, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
   1819 
   1820        // set up texture
   1821 
   1822        switch (this.m_textureSpec.type) {
   1823            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
   1824                // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1] + 'x' + testSize.textureSize[2]);
   1825                // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase);
   1826                // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1] + 'x' + testSize.expectedSize[2]);
   1827 
   1828                gl.uniform3iv(sizeLoc, testSize.expectedSize);
   1829                gl.uniform1iv(lodLoc, [testSize.lod]);
   1830 
   1831                gl.texStorage3D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1], testSize.textureSize[2]);
   1832                break;
   1833 
   1834            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
   1835            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
   1836                // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1]);
   1837                // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase);
   1838                // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1]);
   1839 
   1840                gl.uniform2iv(sizeLoc, testSize.expectedSize.slice(0,2));
   1841                gl.uniform1iv(lodLoc, [testSize.lod]);
   1842 
   1843                gl.texStorage2D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1]);
   1844                break;
   1845 
   1846            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
   1847                /** @type {Array<number>} */ var expectedSize = [testSize.expectedSize[0], testSize.expectedSize[1], testSize.textureSize[2]];
   1848 
   1849                // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1] + ' with ' + testSize.textureSize[2] + ' layer(s)');
   1850                // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase);
   1851                // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1] + ' and ' + testSize.textureSize[2] + ' layer(s)');
   1852 
   1853                gl.uniform3iv(sizeLoc, expectedSize);
   1854                gl.uniform1iv(lodLoc, [testSize.lod]);
   1855 
   1856                gl.texStorage3D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1], testSize.textureSize[2]);
   1857                break;
   1858 
   1859            default:
   1860                throw new Error('Type not supported');
   1861        }
   1862 
   1863        // test
   1864        /** @type {number} */ var colorTolerance = 0.1;
   1865        /** @type {tcuSurface.Surface} */ var sample = new tcuSurface.Surface(1, 1);
   1866        /** @type {Array<number>} */ var outputColor;
   1867 
   1868        gl.clear(gl.COLOR_BUFFER_BIT);
   1869        gl.drawArrays(gl.TRIANGLES, 0, 3);
   1870        gl.finish();
   1871 
   1872        sample.readViewport(gl, [0, 0, 1, 1]);
   1873 
   1874        outputColor = sample.getAccess().getPixel(0, 0);
   1875 
   1876        if (outputColor[0] >= 1.0 - colorTolerance &&
   1877            outputColor[1] >= 1.0 - colorTolerance &&
   1878            outputColor[2] >= 1.0 - colorTolerance)
   1879            bufferedLogToConsole('Passed');
   1880        else {
   1881            // failure
   1882            bufferedLogToConsole('Failed');
   1883            success = false;
   1884        }
   1885 
   1886        // free
   1887        gl.bindTexture(textureTarget, null);
   1888        gl.deleteTexture(texId);
   1889 
   1890        gl.useProgram(null);
   1891 
   1892        return success;
   1893    };
   1894 
   1895    /**
   1896     * @return {string}
   1897     */
   1898    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.genVertexShader = function()  {
   1899        /** @type {string} */ var vert = '';
   1900        vert += '#version 300 es\n' +
   1901                'in highp vec4 a_position;\n';
   1902 
   1903        if (this.m_isVertexCase) {
   1904            vert += 'out mediump vec4 v_color;\n' +
   1905                    'uniform highp ' + this.m_samplerTypeStr + ' u_sampler;\n' +
   1906                    'uniform highp ivec' + (this.m_has3DSize ? 3 : 2) + ' u_texSize;\n' +
   1907                    'uniform highp int u_lod;\n';
   1908        }
   1909 
   1910        vert += 'void main()\n{\n';
   1911 
   1912        if (this.m_isVertexCase)
   1913            vert += '    v_color = (textureSize(u_sampler, u_lod) == u_texSize ? vec4(1.0, 1.0, 1.0, 1.0) : vec4(0.0, 0.0, 0.0, 1.0));\n';
   1914 
   1915        vert += '    gl_Position = a_position;\n' +
   1916                '}\n';
   1917 
   1918        return vert;
   1919    };
   1920 
   1921    /**
   1922     * @return {string}
   1923     */
   1924    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.genFragmentShader = function()  {
   1925        /** @type {string} */ var frag = '';
   1926 
   1927        frag += '#version 300 es\n' +
   1928                'layout(location = 0) out mediump vec4 o_color;\n';
   1929 
   1930        if (this.m_isVertexCase)
   1931                frag += 'in mediump vec4 v_color;\n';
   1932 
   1933        if (!this.m_isVertexCase) {
   1934            frag += 'uniform highp ' + this.m_samplerTypeStr + ' u_sampler;\n' +
   1935                    'uniform highp ivec' + (this.m_has3DSize ? 3 : 2) + ' u_texSize;\n' +
   1936                    'uniform highp int u_lod;\n';
   1937        }
   1938 
   1939        frag += 'void main()\n{\n';
   1940 
   1941        if (!this.m_isVertexCase)
   1942            frag += '    o_color = (textureSize(u_sampler, u_lod) == u_texSize ? vec4(1.0, 1.0, 1.0, 1.0) : vec4(0.0, 0.0, 0.0, 1.0));\n';
   1943        else
   1944            frag += '    o_color = v_color;\n';
   1945 
   1946        frag += '}\n';
   1947 
   1948        return frag;
   1949    };
   1950 
   1951    /**
   1952     * @return {number}
   1953     */
   1954    es3fShaderTextureFunctionTests.TextureSizeCase.prototype.getGLTextureTarget = function()  {
   1955        switch (this.m_textureSpec.type) {
   1956            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
   1957                return gl.TEXTURE_2D;
   1958            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
   1959                return gl.TEXTURE_CUBE_MAP;
   1960            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
   1961                return gl.TEXTURE_2D_ARRAY;
   1962            case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
   1963                return gl.TEXTURE_3D;
   1964            default:
   1965                throw new Error('Texture Type not supported.');
   1966        }
   1967    };
   1968 
   1969    /** @typedef {Array<string, es3fShaderTextureFunctionTests.TextureLookupSpec, es3fShaderTextureFunctionTests.TextureSpec, es3fShaderTextureFunctionTests.EvalFunc, es3fShaderTextureFunctionTests.CaseFlags>} */ es3fShaderTextureFunctionTests.TestSpec;
   1970 
   1971    /**
   1972     * @param {string} name
   1973     * @param {es3fShaderTextureFunctionTests.TexFunction} func
   1974     * @param {Array<number>} minCoord
   1975     * @param {Array<number>} maxCoord
   1976     * @param {boolean} useBias
   1977     * @param {number} minLodBias
   1978     * @param {number} maxLodBias
   1979     * @param {boolean} useOffset
   1980     * @param {Array<number>} offset
   1981     * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec
   1982     * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
   1983     * @param {es3fShaderTextureFunctionTests.CaseFlags} flags
   1984     * @return {es3fShaderTextureFunctionTests.TexFuncCaseSpec}
   1985     */
   1986    es3fShaderTextureFunctionTests.getCaseSpec = function(name, func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, useOffset, offset, texSpec, evalFunc, flags) {
   1987        return new es3fShaderTextureFunctionTests.TexFuncCaseSpec(name,
   1988            new es3fShaderTextureFunctionTests.TextureLookupSpec(func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], useOffset, offset),
   1989            texSpec,
   1990            evalFunc,
   1991            flags);
   1992    };
   1993 
   1994    /**
   1995     * @param {string} name
   1996     * @param {es3fShaderTextureFunctionTests.TexFunction} func
   1997     * @param {Array<number>} minCoord
   1998     * @param {Array<number>} maxCoord
   1999     * @param {Array<number>} mindx
   2000     * @param {Array<number>} maxdx
   2001     * @param {Array<number>} mindy
   2002     * @param {Array<number>} maxdy
   2003     * @param {boolean} useOffset
   2004     * @param {Array<number>} offset
   2005     * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec
   2006     * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
   2007     * @param {es3fShaderTextureFunctionTests.CaseFlags} flags
   2008     * @return {es3fShaderTextureFunctionTests.TexFuncCaseSpec}
   2009     */
   2010    es3fShaderTextureFunctionTests.getGradCaseSpec = function(name, func, minCoord, maxCoord, mindx, maxdx, mindy, maxdy, useOffset, offset, texSpec, evalFunc, flags) {
   2011        return new es3fShaderTextureFunctionTests.TexFuncCaseSpec(name,
   2012            new es3fShaderTextureFunctionTests.TextureLookupSpec(func, minCoord, maxCoord, false, 0.0, 0.0, mindx, maxdx, mindy, maxdy, useOffset, offset),
   2013            texSpec,
   2014            evalFunc,
   2015            flags);
   2016    };
   2017 
   2018    /**
   2019     * @enum {number}
   2020     */
   2021    es3fShaderTextureFunctionTests.CaseFlags = {
   2022        VERTEX: 1,
   2023        FRAGMENT: 2,
   2024        BOTH: 3
   2025    };
   2026 
   2027    /**
   2028     * @struct
   2029     * @constructor
   2030     * @param {string} name
   2031     * @param {es3fShaderTextureFunctionTests.TextureLookupSpec} lookupSpec
   2032     * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec
   2033     * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
   2034     * @param {number} flags
   2035     */
   2036    es3fShaderTextureFunctionTests.TexFuncCaseSpec = function(name, lookupSpec, texSpec, evalFunc, flags) {
   2037        /** @type {string} */ this.name = name;
   2038        /** @type {es3fShaderTextureFunctionTests.TextureLookupSpec} */ this.lookupSpec = lookupSpec;
   2039        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.texSpec = texSpec;
   2040        /** @type {es3fShaderTextureFunctionTests.TexEvalFunc} */ this.evalFunc = evalFunc;
   2041        /** @type {number} */ this.flags = flags;
   2042    };
   2043 
   2044    /**
   2045     * @param  {tcuTestCase.DeqpTest} parent
   2046     * @param  {string} groupName
   2047     * @param  {string} groupDesc
   2048     * @param  {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} cases
   2049     */
   2050    es3fShaderTextureFunctionTests.createCaseGroup = function(parent, groupName, groupDesc, cases) {
   2051        /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(groupName, groupDesc);
   2052        parent.addChild(group);
   2053 
   2054        for (var ndx = 0; ndx < cases.length; ndx++) {
   2055            /** @type {string} */ var name = cases[ndx].name;
   2056            if (cases[ndx].flags & es3fShaderTextureFunctionTests.CaseFlags.VERTEX)
   2057                group.addChild(new es3fShaderTextureFunctionTests.ShaderTextureFunctionCase(name + '_vertex', '', cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, true));
   2058            if (cases[ndx].flags & es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2059                group.addChild(new es3fShaderTextureFunctionTests.ShaderTextureFunctionCase(name + '_fragment', '', cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, false));
   2060        }
   2061    };
   2062 
   2063    /**
   2064    * @constructor
   2065    * @extends {tcuTestCase.DeqpTest}
   2066    */
   2067    es3fShaderTextureFunctionTests.ShaderTextureFunctionTests = function() {
   2068        tcuTestCase.DeqpTest.call(this, 'texture_functions', 'Texture Access Function Tests');
   2069    };
   2070 
   2071    es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
   2072    es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype.constructor = es3fShaderTextureFunctionTests.ShaderTextureFunctionTests;
   2073 
   2074    es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype.init = function() {
   2075        // Samplers
   2076        /** @type {tcuTexture.Sampler} */ var samplerNearestNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
   2077                                                             tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST,
   2078                                                             0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
   2079                                                             0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
   2080        /** @type {tcuTexture.Sampler} */ var samplerLinearNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
   2081                                                             tcuTexture.FilterMode.LINEAR, tcuTexture.FilterMode.LINEAR,
   2082                                                             0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
   2083                                                             0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
   2084        /** @type {tcuTexture.Sampler} */ var samplerNearestMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
   2085                                                             tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST,
   2086                                                             0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
   2087                                                             0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
   2088        /** @type {tcuTexture.Sampler} */ var samplerLinearMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
   2089                                                             tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST, tcuTexture.FilterMode.LINEAR,
   2090                                                             0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
   2091                                                             0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
   2092 
   2093        /** @type {tcuTexture.Sampler} */ var samplerShadowNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
   2094                                                             tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST,
   2095                                                             0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_LESS,
   2096                                                             0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
   2097        /** @type {tcuTexture.Sampler} */ var samplerShadowMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
   2098                                                             tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST,
   2099                                                             0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_LESS,
   2100                                                             0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
   2101 
   2102        /** @type {tcuTexture.Sampler} */ var samplerTexelFetch = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
   2103                                                             tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST,
   2104                                                             0.0 /* LOD threshold */, false /* non-normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
   2105                                                             0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
   2106 
   2107        // Default textures.
   2108        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
   2109        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
   2110        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
   2111        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
   2112        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
   2113        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 9, samplerLinearMipmap);
   2114        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
   2115        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
   2116 
   2117        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowNoMipmap);
   2118        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
   2119 
   2120        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 9, samplerTexelFetch);
   2121        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 9, samplerTexelFetch);
   2122        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 9, samplerTexelFetch);
   2123        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 9, samplerTexelFetch);
   2124 
   2125        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
   2126        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
   2127        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
   2128        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
   2129        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
   2130        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA16F, 128, 128, 1, 8, samplerLinearMipmap);
   2131        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
   2132        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
   2133 
   2134        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.DEPTH_COMPONENT16, 256, 256, 1, 1, samplerShadowNoMipmap);
   2135        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
   2136 
   2137        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 1, samplerLinearNoMipmap);
   2138        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 1, samplerLinearNoMipmap);
   2139        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 1, samplerNearestNoMipmap);
   2140        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 1, samplerNearestNoMipmap);
   2141        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 8, samplerLinearMipmap);
   2142        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 8, samplerLinearMipmap);
   2143        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 8, samplerNearestMipmap);
   2144        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 8, samplerNearestMipmap);
   2145 
   2146        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.DEPTH_COMPONENT16, 128, 128, 4, 1, samplerShadowNoMipmap);
   2147        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.DEPTH_COMPONENT16, 128, 128, 4, 8, samplerShadowMipmap);
   2148 
   2149        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 8, samplerTexelFetch);
   2150        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 8, samplerTexelFetch);
   2151        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 8, samplerTexelFetch);
   2152        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 8, samplerTexelFetch);
   2153 
   2154        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 1, samplerLinearNoMipmap);
   2155        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 1, samplerLinearNoMipmap);
   2156        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 1, samplerNearestNoMipmap);
   2157        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 1, samplerNearestNoMipmap);
   2158        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 7, samplerLinearMipmap);
   2159        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 7, samplerLinearMipmap);
   2160        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 7, samplerNearestMipmap);
   2161        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 7, samplerNearestMipmap);
   2162 
   2163        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 7, samplerTexelFetch);
   2164        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 7, samplerTexelFetch);
   2165        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 7, samplerTexelFetch);
   2166        /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 7, samplerTexelFetch);
   2167 
   2168        var testGroup = tcuTestCase.runner.testCases;
   2169        // texture() cases
   2170            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureCases = [
   2171                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2172                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2173                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2174                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2175                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2176                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2177                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2178                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2179 
   2180                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2181                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2182                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2183                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2184 
   2185                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeFixed, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2186                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2187                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeFloat, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2188                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2189                es3fShaderTextureFunctionTests.getCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeInt, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2190                es3fShaderTextureFunctionTests.getCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2191                es3fShaderTextureFunctionTests.getCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeUint, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2192                es3fShaderTextureFunctionTests.getCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2193 
   2194                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2195                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2196                es3fShaderTextureFunctionTests.getCaseSpec('isamplercube_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2197                es3fShaderTextureFunctionTests.getCaseSpec('usamplercube_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2198 
   2199                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayFixed, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2200                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2201                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayFloat, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2202                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2203                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayInt, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2204                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2205                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayUint, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2206                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2207 
   2208                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2209                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2210                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2211                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2212 
   2213                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2214                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2215                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2216                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2217                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DInt, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2218                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2219                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DUint, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2220                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2221 
   2222                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    1.0,    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2223                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    1.0,    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2224                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2225                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2226 
   2227                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadow, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2228                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadow, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2229                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2230 
   2231                es3fShaderTextureFunctionTests.getCaseSpec('samplercubeshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadow, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2232                es3fShaderTextureFunctionTests.getCaseSpec('samplercubeshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0],    false,    0.0,    0.0,    false, [0, 0, 0],    texCubeMipmapShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadow, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2233                es3fShaderTextureFunctionTests.getCaseSpec('samplercubeshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    texCubeMipmapShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadowBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2234 
   2235                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadow, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2236                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadow,        es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2237 
   2238                // Not in spec.
   2239                // es3fShaderTextureFunctionTests.getCaseSpec('sampler2darrayshadow_bias',    (es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0],    true,    -2.0,    2.0,    Vec2(0.0),    Vec2(0.0), false, [0, 0, 0]),    tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowBias,    FRAGMENT)
   2240            ];
   2241            es3fShaderTextureFunctionTests.createCaseGroup(this, 'texture', 'texture() Tests', textureCases);
   2242 
   2243            // textureOffset() cases
   2244            // \note _bias variants are not using mipmap thanks to wide allowed range for LOD computation
   2245            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureOffsetCases = [
   2246                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2247                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2248                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2249                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2250                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2251                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2252                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2253                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2254 
   2255                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2256                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2257                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2258                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2259 
   2260                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DArrayFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2261                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2262                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DArrayFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2263                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2264                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DArrayInt, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2265                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2266                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DArrayUint, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2267                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2268 
   2269                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DArrayFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2270                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DArrayFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2271                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DArrayInt, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2272                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DArrayUint, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2273 
   2274                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2275                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [7, 3, -8],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2276                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [3, -8, 7],    tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2277                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2278                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [7, 3, -8],    tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2279                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [3, -8, 7],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2280                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2281                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    0.0,    0.0,    true, [7, 3, -8],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2282 
   2283                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    1.0,    true, [-8, 7, 3],    tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2284                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    1.0,    true, [7, 3, -8],    tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2285                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    2.0,    true, [3, -8, 7],    tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2286                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 3],    tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2287 
   2288                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2289                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2290                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowOffsetBias,    es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2291            ];
   2292            es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureoffset', 'textureOffset() Tests', textureOffsetCases);
   2293 
   2294            // textureProj() cases
   2295            // \note Currently uses constant divider!
   2296            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjCases = [
   2297                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2298                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2299                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2300                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2301                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2302                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2303                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2304                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2305 
   2306                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2307                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2308                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2309                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2310 
   2311                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2312                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2313                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2314                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2315                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2316                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2317                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2318                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2319 
   2320                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2321                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2322                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2323                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2324 
   2325                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2326                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2327                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2328                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2329                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2330                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2331                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2332                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2333 
   2334                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    1.0,    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2335                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    1.0,    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2336                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2337                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2338 
   2339                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2340                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2341                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    true,    -2.0,    2.0,    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjBias,    es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2342            ];
   2343            es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureproj', 'textureProj() Tests', textureProjCases);
   2344 
   2345            // textureProjOffset() cases
   2346            // \note Currently uses constant divider!
   2347            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjOffsetCases = [
   2348                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2349                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2350                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2351                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2352                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2353                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2354                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2355                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2356 
   2357                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2358                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2359                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2360                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2361 
   2362                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2363                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2364                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2365                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2366                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2367                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2368                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2369                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2370 
   2371                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2372                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2373                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2374                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    true,    -2.0,    2.0,    true, [7, -8, 0],    tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2375 
   2376                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2377                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [7, 3, -8],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2378                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [3, -8, 7],    tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2379                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2380                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [7, 3, -8],    tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2381                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [3, -8, 7],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2382                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2383                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    0.0,    0.0,    true, [7, 3, -8],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2384 
   2385                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    2.0,    true, [-8, 7, 3],    tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2386                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    2.0,    true, [7, 3, -8],    tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2387                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    2.0,    true, [3, -8, 7],    tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2388                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    true,    -2.0,    2.0,    true, [-8, 7, 3],    tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2389 
   2390                // NOTE: offset changed from [-8, 7, 0] in native dEQP to [7, -8, 0] per https://github.com/KhronosGroup/WebGL/issues/2033
   2391                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2392                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    false,    0.0,    0.0,    true, [7, -8, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2393                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    true,    -2.0,    2.0,    true, [-8, 7, 0],    tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffsetBias,    es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2394            ];
   2395            es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojoffset', 'textureOffsetProj() Tests', textureProjOffsetCases);
   2396 
   2397            // textureLod() cases
   2398            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureLodCases = [
   2399                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2400                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2401                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2402                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2403 
   2404                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2405                es3fShaderTextureFunctionTests.getCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2406                es3fShaderTextureFunctionTests.getCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2407                es3fShaderTextureFunctionTests.getCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2408 
   2409                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    false, [0, 0, 0],    tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2410                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    false, [0, 0, 0],    tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2411                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    false, [0, 0, 0],    tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2412                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    false, [0, 0, 0],    tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2413 
   2414                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2415                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2416                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2417                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2418 
   2419                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowLod,    es3fShaderTextureFunctionTests.CaseFlags.BOTH)
   2420            ];
   2421            es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturelod', 'textureLod() Tests', textureLodCases);
   2422 
   2423            // textureLodOffset() cases
   2424            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureLodOffsetCases = [
   2425                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2426                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2427                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2428                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0],    false,    -1.0,    9.0,    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2429 
   2430                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    true, [-8, 7, 0],    tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2431                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    true, [7, -8, 0],    tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2432                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    true, [-8, 7, 0],    tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2433                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0],    false,    -1.0,    8.0,    true, [7, -8, 0],    tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2434 
   2435                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    true, [-8, 7, 3],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2436                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    true, [7, 3, -8],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2437                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    true, [3, -8, 7],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2438                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0],    false,    -1.0,    7.0,    true, [-8, 7, 3],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2439 
   2440                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowLodOffset,    es3fShaderTextureFunctionTests.CaseFlags.BOTH)
   2441            ];
   2442            es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturelodoffset', 'textureLodOffset() Tests', textureLodOffsetCases);
   2443 
   2444            // textureProjLod() cases
   2445            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjLodCases = [
   2446                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2447                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2448                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2449                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2450 
   2451                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2452                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2453                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2454                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2455 
   2456                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2457                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2458                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2459                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2460 
   2461                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    false,    -1.0,    9.0,    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjLod,    es3fShaderTextureFunctionTests.CaseFlags.BOTH)
   2462            ];
   2463            es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojlod', 'textureProjLod() Tests', textureProjLodCases);
   2464 
   2465            // textureProjLodOffset() cases
   2466            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjLodOffsetCases = [
   2467                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2468                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2469                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2470                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0],    false,    -1.0,    9.0,    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2471 
   2472                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2473                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2474                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2475                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5],    false,    -1.0,    9.0,    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2476 
   2477                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    true, [-8, 7, 3],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2478                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    true, [7, 3, -8],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2479                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    true, [3, -8, 7],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2480                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75],    false,    -1.0,    7.0,    true, [-8, 7, 3],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2481 
   2482                es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5],    false,    -1.0,    9.0,    true, [-8, 7, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjLodOffset,    es3fShaderTextureFunctionTests.CaseFlags.BOTH)
   2483            ];
   2484            es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojlodoffset', 'textureProjLodOffset() Tests', textureProjLodOffsetCases);
   2485 
   2486            // textureGrad() cases
   2487            // \note Only one of dudx, dudy, dvdx, dvdy is non-zero since spec allows approximating p from derivates by various methods.
   2488            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureGradCases = [
   2489                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2490                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2491                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2492                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2493 
   2494                es3fShaderTextureFunctionTests.getGradCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2495                es3fShaderTextureFunctionTests.getGradCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2496                es3fShaderTextureFunctionTests.getGradCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    false, [0, 0, 0],    texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2497                es3fShaderTextureFunctionTests.getGradCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    false, [0, 0, 0],    texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2498 
   2499                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2500                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2501                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    false, [0, 0, 0],    tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2502                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    false, [0, 0, 0],    tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2503 
   2504                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2505                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2506                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2507                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2508                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2509                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2],    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2510 
   2511                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2512                es3fShaderTextureFunctionTests.getGradCaseSpec('samplercubeshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    texCubeMipmapShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2513                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0],    false, [0, 0, 0],    tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2514                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0],    false, [0, 0, 0],    tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2515            ];
   2516            es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturegrad', 'textureGrad() Tests', textureGradCases);
   2517 
   2518            // textureGradOffset() cases
   2519            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureGradOffsetCases = [
   2520                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2521                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2522                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2523                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2524 
   2525                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 0],    tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2526                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [7, -8, 0],    tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2527                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    true, [-8, 7, 0],    tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2528                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    true, [7, -8, 0],    tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2529 
   2530                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 3],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2531                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [7, 3, -8],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2532                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [3, -8, 7],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2533                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    true, [-8, 7, 3],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2534                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    true, [7, 3, -8],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2535                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2],    true, [3, -8, 7],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2536 
   2537                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2538                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [7, -8, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2539                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0],    true, [-8, 7, 0],    tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2540                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0],    true, [7, -8, 0],    tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGradOffset,    es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2541            ];
   2542            es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturegradoffset', 'textureGradOffset() Tests', textureGradOffsetCases);
   2543 
   2544            // textureProjGrad() cases
   2545            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjGradCases = [
   2546                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2547                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2548                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2549                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2550 
   2551                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2552                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2553                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2554                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    false, [0, 0, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2555 
   2556                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2557                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2558                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2559                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    false, [0, 0, 0],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2560                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2561                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2],    false, [0, 0, 0],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2562 
   2563                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2564                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0],    false, [0, 0, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGrad,    es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2565            ];
   2566            es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojgrad', 'textureProjGrad() Tests', textureProjGradCases);
   2567 
   2568            // textureProjGradOffset() cases
   2569            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjGradOffsetCases = [
   2570                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2571                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2572                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2573                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2574 
   2575                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2576                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [7, -8, 0],    tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2577                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2578                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    true, [7, -8, 0],    tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2579 
   2580                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 3],    tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2581                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [7, 3, -8],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2582                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [3, -8, 7],    tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2583                es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0],    true, [-8, 7, 3],    tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2584                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0],    true, [7, 3, -8],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2585                es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2],    true, [3, -8, 7],    tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT),
   2586 
   2587                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],    true, [-8, 7, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX),
   2588                es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0],    true, [7, -8, 0],    tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGradOffset,    es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
   2589            ];
   2590            es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojgradoffset', 'textureProjGradOffset() Tests', textureProjGradOffsetCases);
   2591 
   2592            // texelFetch() cases
   2593            // \note Level is constant across quad
   2594            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var texelFetchCases = [
   2595                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [255.9, 255.9, 0.0, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2596                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [127.9, 127.9, 0.0, 0.0],    false,    1.0,    1.0,    false, [0, 0, 0],    tex2DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2597                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 63.9, 0.0, 0.0],    false,    2.0,    2.0,    false, [0, 0, 0],    tex2DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2598                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [15.9, 15.9, 0.0, 0.0],    false,    4.0,    4.0,    false, [0, 0, 0],    tex2DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2599 
   2600                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [127.9, 127.9, 3.9, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex2DArrayTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2601                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 63.9, 3.9, 0.0],    false,    1.0,    1.0,    false, [0, 0, 0],    tex2DArrayTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2602                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [31.9, 31.9, 3.9, 0.0],    false,    2.0,    2.0,    false, [0, 0, 0],    tex2DArrayTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2603                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [15.9, 15.9, 3.9, 0.0],    false,    3.0,    3.0,    false, [0, 0, 0],    tex2DArrayTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2604 
   2605                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 31.9, 31.9, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2606                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [31.9, 15.9, 15.9, 0.0],    false,    1.0,    1.0,    false, [0, 0, 0],    tex3DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2607                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [15.9,  7.9,  7.9, 0.0],    false,    2.0,    2.0,    false, [0, 0, 0],    tex3DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2608                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 31.9, 31.9, 0.0],    false,    0.0,    0.0,    false, [0, 0, 0],    tex3DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch3D,        es3fShaderTextureFunctionTests.CaseFlags.BOTH)
   2609            ];
   2610            es3fShaderTextureFunctionTests.createCaseGroup(this, 'texelfetch', 'texelFetch() Tests', texelFetchCases);
   2611 
   2612            // texelFetchOffset() cases
   2613            /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var texelFetchOffsetCases = [
   2614                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [263.9, 248.9, 0.0, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2615                es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [120.9, 135.9, 0.0, 0.0],    false,    1.0,    1.0,    true, [7, -8, 0],    tex2DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2616                es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [71.9, 56.9, 0.0, 0.0],    false,    2.0,    2.0,    true, [-8, 7, 0],    tex2DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2617                es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [8.9, 23.9, 0.0, 0.0],    false,    4.0,    4.0,    true, [7, -8, 0],    tex2DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2618 
   2619                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [135.9, 120.9, 3.9, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 0],    tex2DArrayTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2620                es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [56.9, 71.9, 3.9, 0.0],    false,    1.0,    1.0,    true, [7, -8, 0],    tex2DArrayTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2621                es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [39.9, 24.9, 3.9, 0.0],    false,    2.0,    2.0,    true, [-8, 7, 0],    tex2DArrayTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2622                es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [8.9, 23.9, 3.9, 0.0],    false,    3.0,    3.0,    true, [7, -8, 0],    tex2DArrayTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2623 
   2624                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, -3.0, 0.0], [71.9, 24.9, 28.9, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2625                es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, -3.0, 8.0, 0.0], [24.9, 12.9, 23.9, 0.0],    false,    1.0,    1.0,    true, [7, 3, -8],    tex3DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2626                es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-3.0, 8.0, -7.0, 0.0], [12.9, 15.9,  0.9, 0.0],    false,    2.0,    2.0,    true, [3, -8, 7],    tex3DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH),
   2627                es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, -3.0, 0.0], [71.9, 24.9, 28.9, 0.0],    false,    0.0,    0.0,    true, [-8, 7, 3],    tex3DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch3D,        es3fShaderTextureFunctionTests.CaseFlags.BOTH)
   2628            ];
   2629            es3fShaderTextureFunctionTests.createCaseGroup(this, 'texelfetchoffset', 'texelFetchOffset() Tests', texelFetchOffsetCases);
   2630 
   2631            // textureSize() cases
   2632            /**
   2633             * @struct
   2634             * @constructor
   2635             * @param  {string} name
   2636             * @param  {string} samplerName
   2637             * @param  {es3fShaderTextureFunctionTests.TextureSpec} textureSpec
   2638             */
   2639            var TextureSizeCaseSpec = function(name, samplerName, textureSpec) {
   2640                /** @type {string} */ this.name = name;
   2641                /** @type {string} */ this.samplerName = samplerName;
   2642                /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.textureSpec = textureSpec;
   2643            };
   2644 
   2645            /** @type {Array<TextureSizeCaseSpec>} */ var  textureSizeCases = [
   2646                new TextureSizeCaseSpec('sampler2d_fixed', 'sampler2D', tex2DFixed),
   2647                new TextureSizeCaseSpec('sampler2d_float', 'sampler2D', tex2DFloat),
   2648                new TextureSizeCaseSpec('isampler2d', 'isampler2D', tex2DInt),
   2649                new TextureSizeCaseSpec('usampler2d', 'usampler2D', tex2DUint),
   2650                new TextureSizeCaseSpec('sampler2dshadow', 'sampler2DShadow', tex2DShadow),
   2651                new TextureSizeCaseSpec('sampler3d_fixed', 'sampler3D', tex3DFixed),
   2652                new TextureSizeCaseSpec('sampler3d_float', 'sampler3D', tex3DFloat),
   2653                new TextureSizeCaseSpec('isampler3d', 'isampler3D', tex3DInt),
   2654                new TextureSizeCaseSpec('usampler3d', 'usampler3D', tex3DUint),
   2655                new TextureSizeCaseSpec('samplercube_fixed', 'samplerCube', texCubeFixed),
   2656                new TextureSizeCaseSpec('samplercube_float', 'samplerCube', texCubeFloat),
   2657                new TextureSizeCaseSpec('isamplercube', 'isamplerCube', texCubeInt),
   2658                new TextureSizeCaseSpec('usamplercube', 'usamplerCube', texCubeUint),
   2659                new TextureSizeCaseSpec('samplercubeshadow', 'samplerCubeShadow', texCubeShadow),
   2660                new TextureSizeCaseSpec('sampler2darray_fixed', 'sampler2DArray', tex2DArrayFixed),
   2661                new TextureSizeCaseSpec('sampler2darray_float', 'sampler2DArray', tex2DArrayFloat),
   2662                new TextureSizeCaseSpec('isampler2darray', 'isampler2DArray', tex2DArrayInt),
   2663                new TextureSizeCaseSpec('usampler2darray', 'usampler2DArray', tex2DArrayUint),
   2664                new TextureSizeCaseSpec('sampler2darrayshadow', 'sampler2DArrayShadow', tex2DArrayShadow)
   2665            ];
   2666 
   2667            /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest('texturesize', 'textureSize() Tests');
   2668            testGroup.addChild(group);
   2669 
   2670            for (var ndx = 0; ndx < textureSizeCases.length; ++ndx) {
   2671                group.addChild(new es3fShaderTextureFunctionTests.TextureSizeCase(textureSizeCases[ndx].name + '_vertex',  '', textureSizeCases[ndx].samplerName, textureSizeCases[ndx].textureSpec, true));
   2672                group.addChild(new es3fShaderTextureFunctionTests.TextureSizeCase(textureSizeCases[ndx].name + '_fragment', '', textureSizeCases[ndx].samplerName, textureSizeCases[ndx].textureSpec, false));
   2673            }
   2674 
   2675    };
   2676 
   2677    /**
   2678    * Run test
   2679    * @param {WebGL2RenderingContext} context
   2680    * @param {Array<number>=} range Test range
   2681    */
   2682    es3fShaderTextureFunctionTests.run = function(context, range) {
   2683        gl = context;
   2684 
   2685        const canvas = gl.canvas;
   2686        canvas.width = canvasWH;
   2687        canvas.height = canvasWH;
   2688 
   2689        //Set up Test Root parameters
   2690        var state = tcuTestCase.runner;
   2691        state.setRoot(new es3fShaderTextureFunctionTests.ShaderTextureFunctionTests());
   2692        if (range)
   2693            state.setRange(range);
   2694 
   2695        //Set up name and description of this test series.
   2696        setCurrentTestName(state.testCases.fullName());
   2697        description(state.testCases.getDescription());
   2698 
   2699        try {
   2700            //Run test cases
   2701            tcuTestCase.runTestCases();
   2702        }
   2703        catch (err) {
   2704            testFailedOptions('Failed to es3fShaderTextureFunctionTests.run tests', false);
   2705            tcuTestCase.runner.terminate();
   2706        }
   2707    };
   2708 
   2709 });